Initial commit

This commit is contained in:
周中平 2021-12-28 08:36:20 +08:00
commit 3f09561d7c
17 changed files with 321 additions and 0 deletions

48
archives.ftl Normal file
View File

@ -0,0 +1,48 @@
<#include "module/macro.ftl">
<@layout title="归档 - ${blog_title!}">
<h1>归档</h1>
<ul>
<#list archives as archive>
<h2>${archive.year?c}</h2>
<#list archive.posts as post>
<li>
<a href="${post.fullPath!}">${post.title!}</a>
</li>
</#list>
</#list>
</ul>
<h1>分页</h1>
<#if posts.totalPages gt 1>
<ul>
<@paginationTag method="archives" page="${posts.number}" total="${posts.totalPages}" display="3">
<#if pagination.hasPrev>
<li>
<a href="${pagination.prevPageFullPath!}">
上一页
</a>
</li>
</#if>
<#list pagination.rainbowPages as number>
<li>
<#if number.isCurrent>
<span class="current">第 ${number.page!} 页</span>
<#else>
<a href="${number.fullPath!}">第 ${number.page!} 页</a>
</#if>
</li>
</#list>
<#if pagination.hasNext>
<li>
<a href="${pagination.nextPageFullPath!}">
下一页
</a>
</li>
</#if>
</@paginationTag>
</ul>
<#else>
<span>当前只有一页</span>
</#if>
</@layout>

13
categories.ftl Normal file
View File

@ -0,0 +1,13 @@
<#include "module/macro.ftl">
<@layout title="分类列表 - ${blog_title!}">
<h1>分类列表</h1>
<ul>
<@categoryTag method="list">
<#if categories?? && categories?size gt 0>
<#list categories as category>
<li><a href="${category.fullPath!}">${category.name}</a></li>
</#list>
</#if>
</@categoryTag>
</ul>
</@layout>

45
category.ftl Normal file
View File

@ -0,0 +1,45 @@
<#include "module/macro.ftl">
<@layout title="分类:${category.name} - ${blog_title!}">
<h1>分类:${category.name}</h1>
<ul>
<#list posts.content as post>
<li>
<a href="${post.fullPath}">${post.title}</a>
</li>
</#list>
</ul>
<h1>分页</h1>
<#if posts.totalPages gt 1>
<ul>
<@paginationTag method="categoryPosts" page="${posts.number}" total="${posts.totalPages}" display="3" slug="${category.slug!}">
<#if pagination.hasPrev>
<li>
<a href="${pagination.prevPageFullPath!}">
上一页
</a>
</li>
</#if>
<#list pagination.rainbowPages as number>
<li>
<#if number.isCurrent>
<span class="current">第 ${number.page!} 页</span>
<#else>
<a href="${number.fullPath!}">第 ${number.page!} 页</a>
</#if>
</li>
</#list>
<#if pagination.hasNext>
<li>
<a href="${pagination.nextPageFullPath!}">
下一页
</a>
</li>
</#if>
</@paginationTag>
</ul>
<#else>
<span>当前只有一页</span>
</#if>
</@layout>

50
index.ftl Normal file
View File

@ -0,0 +1,50 @@
<#include "module/macro.ftl">
<@layout title="${blog_title!}">
<h1>公告</h1>
<p>
${settings.index_notice!}
</p>
<h1>文章列表</h1>
<ul>
<#list posts.content as post>
<li>
<a href="${post.fullPath!}">${post.title}</a>
</li>
</#list>
</ul>
<h1>分页</h1>
<#if posts.totalPages gt 1>
<ul>
<@paginationTag method="index" page="${posts.number}" total="${posts.totalPages}" display="3">
<#if pagination.hasPrev>
<li>
<a href="${pagination.prevPageFullPath!}">
上一页
</a>
</li>
</#if>
<#list pagination.rainbowPages as number>
<li>
<#if number.isCurrent>
<span class="current">第 ${number.page!} 页</span>
<#else>
<a href="${number.fullPath!}">第 ${number.page!} 页</a>
</#if>
</li>
</#list>
<#if pagination.hasNext>
<li>
<a href="${pagination.nextPageFullPath!}">
下一页
</a>
</li>
</#if>
</@paginationTag>
</ul>
<#else>
<span>当前只有一页</span>
</#if>
</@layout>

18
links.ftl Normal file
View File

@ -0,0 +1,18 @@
<#include "module/macro.ftl">
<@layout title="友情链接 - ${blog_title!}">
<h1>友情链接</h1>
<ul>
<@linkTag method="list">
<#if links?? && links?size gt 0>
<#list links as link>
<li>
<a href="${link.url}" target="_blank" rel="external">${link.name}</a>
<#if link.description!=''>
${link.description}
</#if>
</li>
</#list>
</#if>
</@linkTag>
</ul>
</@layout>

7
module/comment.ftl Normal file
View File

@ -0,0 +1,7 @@
<#macro comment post,type>
<#if !post.disallowComment!false>
<script src="//cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.min.js"></script>
<script src="${options.comment_internal_plugin_js!'//cdn.jsdelivr.net/gh/halo-dev/halo-comment@latest/dist/halo-comment.min.js'}"></script>
<halo-comment id="${post.id?c}" type="${type}"/>
</#if>
</#macro>

31
module/macro.ftl Normal file
View File

@ -0,0 +1,31 @@
<#macro layout title>
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="keywords" content="${meta_keywords!}"/>
<meta name="description" content="${meta_description!}" />
<#--
公共 head 代码详情请参考https://docs.halo.run/zh/developer-guide/theme/public-template-tag
包含Favicon自定义 head 等
-->
<@global.head />
<title>${title}</title>
</head>
<body>
<#include "menu.ftl">
<#nested >
<#--
公共底部代码详情请参考https://docs.halo.run/zh/developer-guide/theme/public-template-tag
包含:统计代码,底部信息
-->
<@global.footer />
</body>
</html>
</#macro>

10
module/menu.ftl Normal file
View File

@ -0,0 +1,10 @@
<@menuTag method="list">
<#--
?sort_by('priority'):根据菜单的排序编号排序
-->
<#list menus?sort_by('priority') as menu>
<li>
<a href="${menu.url}" target="${menu.target!}">${menu.name} </a>
</li>
</#list>
</@menuTag>

9
post.ftl Normal file
View File

@ -0,0 +1,9 @@
<#include "module/macro.ftl">
<@layout title="${post.title!} - ${blog_title!}">
<h1>${post.title!}</h1>
<article>
${post.formatContent!}
</article>
<#include "module/comment.ftl">
<@comment post=post type="post" />
</@layout>

9
settings.yaml Normal file
View File

@ -0,0 +1,9 @@
# 配置详情请参考https://docs.halo.run/zh/developer-guide/theme/config-files
genernal:
label: 基本设置
items:
index_notice:
name: index_notice
label: 首页公告
type: textarea
default: '欢迎来到我的博客'

9
sheet.ftl Normal file
View File

@ -0,0 +1,9 @@
<#include "module/macro.ftl">
<@layout title="${sheet.title!} - ${blog_title!}">
<h1>${sheet.title!}</h1>
<article>
${sheet.formatContent!}
</article>
<#include "module/comment.ftl">
<@comment post=sheet type="sheet" />
</@layout>

1
source/css/style.css Normal file
View File

@ -0,0 +1 @@
style.css

0
source/images/.gitkeep Normal file
View File

1
source/js/index.js Normal file
View File

@ -0,0 +1 @@
index.js

45
tag.ftl Normal file
View File

@ -0,0 +1,45 @@
<#include "module/macro.ftl">
<@layout title="标签:${tag.name} - ${blog_title!}">
<h1>标签:${tag.name}</h1>
<ul>
<#list posts.content as post>
<li>
<a href="${post.fullPath!}">${post.title}</a>
</li>
</#list>
</ul>
<h1>分页</h1>
<#if posts.totalPages gt 1>
<ul>
<@paginationTag method="tagPosts" page="${posts.number}" total="${posts.totalPages}" display="3" slug="${tag.slug!}">
<#if pagination.hasPrev>
<li>
<a href="${pagination.prevPageFullPath!}">
上一页
</a>
</li>
</#if>
<#list pagination.rainbowPages as number>
<li>
<#if number.isCurrent>
<span class="current">第 ${number.page!} 页</span>
<#else>
<a href="${number.fullPath!}">第 ${number.page!} 页</a>
</#if>
</li>
</#list>
<#if pagination.hasNext>
<li>
<a href="${pagination.nextPageFullPath!}">
下一页
</a>
</li>
</#if>
</@paginationTag>
</ul>
<#else>
<span>当前只有一页</span>
</#if>
</@layout>

13
tags.ftl Normal file
View File

@ -0,0 +1,13 @@
<#include "module/macro.ftl">
<@layout title="标签列表 - ${blog_title!}">
<h1>标签列表</h1>
<ul>
<@tagTag method="list">
<#if tags?? && tags?size gt 0>
<#list tags as tag>
<li><a href="${tag.fullPath!}">${tag.name}</a></li>
</#list>
</#if>
</@tagTag>
</ul>
</@layout>

12
theme.yaml Normal file
View File

@ -0,0 +1,12 @@
# 配置详情请参考https://docs.halo.run/zh/developer-guide/theme/config-files
id: halo_quickstarter
name: QuickStarter
author:
name: halo-dev
website: https://halo.run
description: Quick starter theme for halo
logo: https://avatars.githubusercontent.com/u/48195280?s=200&v=4
website: https://github.com/halo-dev/halo-theme-quick-starter
repo: https://github.com/halo-dev/halo-theme-quick-starter
version: 1.0.0
require: 1.4.2