From 4320f2244d7392d3c2b0cce22a6bbce58657ce05 Mon Sep 17 00:00:00 2001 From: 79E <5980844@qq.com> Date: Fri, 15 Jul 2022 17:44:44 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=80=E6=96=B0=E5=A2=9E=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E5=B8=83=E5=B1=80=E5=92=8C=E6=96=87=E7=AB=A0=E7=9B=AE?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README-EN.md | 9 +- README.md | 8 + _config.yml | 2 + layout/_partial/head.ejs | 4 +- layout/_partial/home.ejs | 79 +- layout/_partial/post_centent.ejs | 10 +- source/css/index.less | 1 + source/css/pages/home.less | 153 +++- source/css/pages/post.less | 21 + source/css/public/article_cente.less | 2 + source/css/public/mixins.less | 10 + source/js/hljs.min.js | 1201 +++++++++++++++++++++++++- 12 files changed, 1457 insertions(+), 43 deletions(-) create mode 100644 source/css/public/mixins.less diff --git a/README-EN.md b/README-EN.md index 9cd8a8d..f52a4fc 100644 --- a/README-EN.md +++ b/README-EN.md @@ -75,7 +75,11 @@ prismjs: line_number: true tab_replace: '' ``` - +#### 🏠 Homepage layout +``` +# The default layout of the home page article is'card', and'block-card' can be selected +home_layout: card +``` #### 🔧Tags page Go to the `source` folder in the root directory to create a `tags` folder and create a new `index.md` file @@ -173,6 +177,7 @@ tags: - you - use excerpt: A simple and generous flat theme for Hexo - Quiet +toc: false date: 2020-11-03 20:33:36 cover: 'https://cdn.jsdelivr.net/gh/duogongneng/MyBlogImg/imgQuietView.png' ``` @@ -187,6 +192,8 @@ cover: 'https://cdn.jsdelivr.net/gh/duogongneng/MyBlogImg/imgQuietView.png' `excerpt`: A short description of the article +`toc`:Whether to display the article directory (the default value is false) + `date`:Creation date `cover`:Thumbnail (you can leave this empty to use a random default cover) diff --git a/README.md b/README.md index ba59d2a..751376f 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,11 @@ prismjs: line_number: true tab_replace: '' ``` +#### 🏠首页布局 +``` +# 首页文章布局 默认 'card' 可选择 'block-card' +home_layout: card +``` #### 🔧标签页 @@ -172,6 +177,7 @@ tags: - 主题 - 静态主题 excerpt: 采用简约大方的扁平化Hexo-Quiet主题 +toc: false date: 2020-11-03 20:33:36 cover: 'https://cdn.jsdelivr.net/gh/duogongneng/MyBlogImg/imgQuietView.png' ``` @@ -186,6 +192,8 @@ cover: 'https://cdn.jsdelivr.net/gh/duogongneng/MyBlogImg/imgQuietView.png' `excerpt`:描述 +`toc`:是否显示文章目录(默认值false) + `date`:创建日期 `cover`:缩略图(你不填就用默认的了) diff --git a/_config.yml b/_config.yml index 3f90a6b..c9cfabf 100644 --- a/_config.yml +++ b/_config.yml @@ -10,6 +10,8 @@ keyword: hexo主题,hexo扁平化主题,Quiet主题 is_article_img: true # 网站描述 web_description: 描述 +# 首页文章布局 默认 'card' 可选择 'block-card' +home_layout: card # 导航名称 menus_title: home: HOME diff --git a/layout/_partial/head.ejs b/layout/_partial/head.ejs index 9a5c77d..da7c1a0 100644 --- a/layout/_partial/head.ejs +++ b/layout/_partial/head.ejs @@ -15,7 +15,7 @@ if (page.title) { %> <% page.tags.data.forEach((item, index) => { text += item.name + ',' - }) %> +}) %> <% }else{ %> @@ -27,5 +27,5 @@ if (page.title) { <%- js('js/fancybox.umd.js') %> <%- js('js/fancybox-images.js') %> <%- js('js/gitalk.min.js') %> -<%- js('js/hljs.min.js') %> +<%- js('js/hljs.min.js') %> diff --git a/layout/_partial/home.ejs b/layout/_partial/home.ejs index db669c9..ccf4edb 100644 --- a/layout/_partial/home.ejs +++ b/layout/_partial/home.ejs @@ -1,35 +1,68 @@