From ac64425506fc24979bc6debfdcf8bf694fd9e0fb Mon Sep 17 00:00:00 2001 From: julylies Date: Fri, 15 Apr 2022 13:11:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E6=A4=8D=E8=BF=9B=E5=BA=A610%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.ftl | 61 ++-------------------------- archives.ftl | 95 ++++++++++++++++++++++---------------------- categories.ftl | 48 ++++++++++++++++------ category.ftl | 50 +++-------------------- comments.ftl | 1 - index.ftl | 69 ++------------------------------ journals.ftl | 3 ++ links.ftl | 6 +-- module/macro.ftl | 44 -------------------- module/post-list.ftl | 66 ++++++++++++++++++++++++++++++ page.ftl | 4 +- photos.ftl | 3 ++ post.ftl | 79 +++++++++++++++++++++++++++++++----- sheet.ftl | 15 ++++--- tag.ftl | 49 ++--------------------- tags.ftl | 52 ++++++++++++++++++------ 16 files changed, 295 insertions(+), 350 deletions(-) delete mode 100644 comments.ftl create mode 100644 journals.ftl delete mode 100644 module/macro.ftl create mode 100644 module/post-list.ftl create mode 100644 photos.ftl diff --git a/404.ftl b/404.ftl index 4e3345c..24ae757 100644 --- a/404.ftl +++ b/404.ftl @@ -1,59 +1,5 @@ - - - - - - - - - <#-- 导航面包蟹 未完成--> - - - - - <@global.head /> - <#if ! (options.blog_favicon?? && options.blog_favicon!='')> - - - <#-- 背景图片--> - <#if settings.rimage_url?? && settings.rimage_url!=''> - - - <#-- 自定css 未完成--> - - -
-
-

${blog_title!}

-
-
-
-
-
-
- - -
+<#include "header.ftl" /> +<@head title="404 - ${blog_title!}"/>
@@ -63,5 +9,4 @@
-<#include "footer.ftl"> - +<#include "footer.ftl"> \ No newline at end of file diff --git a/archives.ftl b/archives.ftl index 281552d..2eb06c6 100644 --- a/archives.ftl +++ b/archives.ftl @@ -1,48 +1,49 @@ -<#include "module/macro.ftl"> -<@layout title="归档 - ${blog_title!}"> -

归档

- - -

分页

- - <#if posts.totalPages gt 1> - - <#else> - 当前只有一页 - - + + +
+ <@postTag method="archive" type="month"> +
+ <#list archives as archive> +

${archive.year?c}-${archive.month?c}

+
    + <#list archive.posts?sort_by("createTime")?reverse as post> +
  • + ${post.title!} + +
  • + +
+ +
+ +
+ + +<#include "footer.ftl"> diff --git a/categories.ftl b/categories.ftl index 8c78219..0451a3c 100644 --- a/categories.ftl +++ b/categories.ftl @@ -1,13 +1,35 @@ -<#include "module/macro.ftl"> -<@layout title="分类列表 - ${blog_title!}"> -

分类列表

- - +<#include "header.ftl"> +<@head title="分类列表 - ${blog_title!}"/> +
+ +
+
+

分类列表

+
+
+ <@categoryTag method="list"> +
+ <#if categories?? && categories?size gt 0> + <#list categories as category> + ${category.name}(${category.postCount!}) + + + +
+
+
+<#include "footer.ftl"> diff --git a/category.ftl b/category.ftl index 49358ca..e886042 100644 --- a/category.ftl +++ b/category.ftl @@ -1,45 +1,5 @@ -<#include "module/macro.ftl"> -<@layout title="分类:${category.name} - ${blog_title!}"> -

分类:${category.name}

- - -

分页

- - <#if posts.totalPages gt 1> - - <#else> - 当前只有一页 - - +<#include "header.ftl"> +<@head title="分类:${category.name} - ${blog_title!}" /> +

分类:${category.name}

+<#include "module/post-list.ftl"> +<#include "footer.ftl"> diff --git a/comments.ftl b/comments.ftl deleted file mode 100644 index 8d1c8b6..0000000 --- a/comments.ftl +++ /dev/null @@ -1 +0,0 @@ - diff --git a/index.ftl b/index.ftl index dfd5a22..070f263 100644 --- a/index.ftl +++ b/index.ftl @@ -1,69 +1,6 @@ -<#include "header.ftl"> +<#include "header.ftl" /> <@head title="${blog_title!}"/> <#--

公告

<#macro greet>Hello Joe!<@greet>

${settings.index_notice!}

--> -
-
-
-

${blog_title!}

- ${user.description!} - <#-- 待优化--> -
- <#if settings.home_social?? && settings.home_social != ''> - ${settings.home_social!} - -
-
-
- <#list posts.content as post> -
-

- ${post.title!} -

-

${post.summary!}

- -
- -
- -
-
-<#include "footer.ftl"> \ No newline at end of file +<#include "module/post-list.ftl"> +<#include "footer.ftl" /> \ No newline at end of file diff --git a/journals.ftl b/journals.ftl new file mode 100644 index 0000000..9d91046 --- /dev/null +++ b/journals.ftl @@ -0,0 +1,3 @@ +<#include "header.ftl"> +<@head title="日志 -${blog_title!}" /> +<#include "footer.ftl"> \ No newline at end of file diff --git a/links.ftl b/links.ftl index f32e580..3d3db77 100644 --- a/links.ftl +++ b/links.ftl @@ -1,5 +1,5 @@ -<#include "module/macro.ftl"> -<@layout title="友情链接 - ${blog_title!}"> +<#include "header.ftl"> +<@head title="友情链接 -${blog_title!}" />

友情链接

- +<#include "footer.ftl"> diff --git a/module/macro.ftl b/module/macro.ftl deleted file mode 100644 index 1ebbf9b..0000000 --- a/module/macro.ftl +++ /dev/null @@ -1,44 +0,0 @@ -<#macro head title> - - - - - - - - - <#-- - 公共 head 代码,详情请参考:https://docs.halo.run/zh/developer-guide/theme/public-template-tag - 包含:Favicon,自定义 head 等 - --> - - <@global.head /> - - ${title} - - -<#-- <#include "menu.ftl"> ---> -<@menuTag method="list"> - <#-- - ?sort_by('priority'):根据菜单的排序编号排序 - --> - <#list menus?sort_by('priority') as menu> -
  • - ${menu.name} -
  • - - -<#nested > -<#-- - 公共底部代码,详情请参考:https://docs.halo.run/zh/developer-guide/theme/public-template-tag - 包含:统计代码,底部信息 ---> - - - -<@global.footer /> - - - - diff --git a/module/post-list.ftl b/module/post-list.ftl new file mode 100644 index 0000000..63e5406 --- /dev/null +++ b/module/post-list.ftl @@ -0,0 +1,66 @@ +
    +
    + <#if is_index??> +
    +

    ${blog_title!}

    + ${user.description!} + <#-- 待优化--> +
    + <#if settings.home_social?? && settings.home_social != ''> + ${settings.home_social!} + +
    +
    + +
    + <#list posts.content as post> +
    +

    + ${post.title!} +

    +

    ${post.summary!}

    + +
    + +
    + +
    +
    \ No newline at end of file diff --git a/page.ftl b/page.ftl index 8d1c8b6..4d1262b 100644 --- a/page.ftl +++ b/page.ftl @@ -1 +1,3 @@ - +<#include "header.ftl"> +<@head title="page -${blog_title!}" /> +<#include "footer.ftl"> diff --git a/photos.ftl b/photos.ftl new file mode 100644 index 0000000..76ea914 --- /dev/null +++ b/photos.ftl @@ -0,0 +1,3 @@ +<#include "header.ftl"> +<@head title="图库 -${blog_title!}" /> +<#include "footer.ftl"> \ No newline at end of file diff --git a/post.ftl b/post.ftl index a75139e..01a5dd6 100644 --- a/post.ftl +++ b/post.ftl @@ -1,9 +1,70 @@ -<#include "module/macro.ftl"> -<@layout title="${post.title!} - ${blog_title!}"> -

    ${post.title!}

    -
    - ${post.formatContent!} -
    - <#include "module/comment.ftl"> - <@comment post=post type="post" /> - +<#include "header.ftl"> +<@head title="${post.title!} - ${blog_title!}"/> +
    +
    +
    +

    ${post.title!}

    + +
    +
    +
    这篇文章上次修改于${sinceLastTime!}天前,可能其部分内容已经发生变化,如有疑问可询问作者。
    + ${post.formatContent!} +
    +
    +
      +
    • + 上一篇: + <#if prevPost??> + ${prevPost.title!} + <#else> + 看完啦 (つд⊂) + +
    • +
    • + 下一篇: + <#if nextPost??> + ${nextPost.title!} + <#else> + 看完啦 (つд⊂) + +
    • +
    +
    + + <#if settings.author_text?? && settings.author_text!=''> + + + <#include "module/comment.ftl"> + <@comment post=post type="post" /> +
    +
    +<#include "footer.ftl"> diff --git a/sheet.ftl b/sheet.ftl index 61878a7..844e958 100644 --- a/sheet.ftl +++ b/sheet.ftl @@ -1,9 +1,14 @@ -<#include "module/macro.ftl"> -<@layout title="${sheet.title!} - ${blog_title!}"> -

    ${sheet.title!}

    -
    +<#include "header.ftl"> +<@head title="${sheet.title!} - ${blog_title!}"/> +
    +
    +

    ${sheet.title!}

    +
    +
    ${sheet.formatContent!}
    <#include "module/comment.ftl"> <@comment post=sheet type="sheet" /> - + +
    +<#include "footer.ftl"> \ No newline at end of file diff --git a/tag.ftl b/tag.ftl index be5920d..a5231ae 100644 --- a/tag.ftl +++ b/tag.ftl @@ -1,45 +1,4 @@ -<#include "module/macro.ftl"> -<@layout title="标签:${tag.name} - ${blog_title!}"> -

    标签:${tag.name}

    - - -

    分页

    - - <#if posts.totalPages gt 1> - - <#else> - 当前只有一页 - - +<#include "header.ftl"> +<@head title="标签:${tag.name} - ${blog_title!}" /> +<#include "module/post-list.ftl"> +<#include "footer.ftl"> \ No newline at end of file diff --git a/tags.ftl b/tags.ftl index 9013c8a..c81cec4 100644 --- a/tags.ftl +++ b/tags.ftl @@ -1,13 +1,39 @@ -<#include "module/macro.ftl"> -<@layout title="标签列表 - ${blog_title!}"> -

    标签列表

    - - +<#include "header.ftl"> +<@head title="标签云 - ${blog_title!}" /> +<#-- +标签云 +@package custom +--> +
    + +
    +
    +

    标签云

    +
    +
    + <@tagTag method="list"> +
    + <#if tags?? && tags?size gt 0> + <#list tags as tag> + ${tag.name}(${tag.postCount!}) + + + +
    +
    +
    +<#include "footer.ftl"> \ No newline at end of file