v0.1
25
README.md
@ -1,28 +1,17 @@
|
||||

|
||||
|
||||
# Hugo Theme Stack
|
||||
# 此项目为二次修改后的主题,为我的博客而用。
|
||||
|
||||
<img align="right" width="150" alt="logo" src="https://user-images.githubusercontent.com/5889006/190859553-5b229b4f-c476-4cbd-928f-890f5265ca4c.png">
|
||||
你可以前往我的博客预览:
|
||||
|
||||
Card-style Hugo theme designed for bloggers.
|
||||
[我的博客](https://blog.sakurasen.cn)
|
||||
|
||||
## Quickstart
|
||||
# 注意
|
||||
|
||||
Use this template: [CaiJimmy/hugo-theme-stack-starter](https://github.com/CaiJimmy/hugo-theme-stack-starter)
|
||||
如果你要自己使用,请修改以下文件:
|
||||
|
||||
## Demo
|
||||
data/external.yaml
|
||||
|
||||
* Starter template demo: [demo.stack.jimmycai.com](https://demo.stack.jimmycai.com)
|
||||
* Dev build: [dev.stack.jimmycai.com](https://dev.stack.jimmycai.com)
|
||||
layouts/partials/head/custom.html
|
||||
|
||||
## Documentation
|
||||
|
||||
Visit [stack.jimmycai.com](https://stack.jimmycai.com)
|
||||
|
||||
## Copyright
|
||||
|
||||
**Licensed under the GNU General Public License v3.0**
|
||||
|
||||
Please do not remove the "*Theme Stack designed by Jimmy*" text and link.
|
||||
|
||||
If you want to port this theme to another blogging platform, please let me know🙏.
|
||||
|
1
assets/icons/brand-bilibili.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-brand-bilibili"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M3 10a4 4 0 0 1 4 -4h10a4 4 0 0 1 4 4v6a4 4 0 0 1 -4 4h-10a4 4 0 0 1 -4 -4v-6z" /><path d="M8 3l2 3" /><path d="M16 3l-2 3" /><path d="M9 13v-2" /><path d="M15 11v2" /></svg>
|
After Width: | Height: | Size: 498 B |
1
assets/icons/brand-netease-music.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-brand-netease-music"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M9 4c-2.93 1.346 -5 5.046 -5 8.492c0 4.508 4 7.508 8 7.508s8 -3 8 -7c0 -3.513 -3.5 -5.513 -6 -5.513s-5 1.513 -5 4.513c0 2 1.5 3 3 3s3 -1 3 -3c0 -3.513 -2 -4.508 -2 -6.515c0 -3.504 3.5 -2.603 4 -1.502" /></svg>
|
After Width: | Height: | Size: 538 B |
1
assets/icons/brand-qq.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-brand-qq"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 9.748a14.716 14.716 0 0 0 11.995 -.052c.275 -9.236 -11.104 -11.256 -11.995 .052z" /><path d="M18 10c.984 2.762 1.949 4.765 2 7.153c.014 .688 -.664 1.346 -1.184 .303c-.346 -.696 -.952 -1.181 -1.816 -1.456" /><path d="M17 16c.031 1.831 .147 3.102 -1 4" /><path d="M8 20c-1.099 -.87 -.914 -2.24 -1 -4" /><path d="M6 10c-.783 2.338 -1.742 4.12 -1.968 6.43c-.217 2.227 .716 1.644 1.16 .917c.296 -.487 .898 -.934 1.808 -1.347" /><path d="M15.898 13l-.476 -2" /><path d="M8 20l-1.5 1c-.5 .5 -.5 1 .5 1h10c1 0 1 -.5 .5 -1l-1.5 -1" /><path d="M13.75 7m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /><path d="M10.25 7m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" /></svg>
|
After Width: | Height: | Size: 962 B |
1
assets/icons/brand-steam.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-brand-steam"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M16.5 5a4.5 4.5 0 1 1 -.653 8.953l-4.347 3.009l0 .038a3 3 0 0 1 -2.824 3l-.176 0a3 3 0 0 1 -2.94 -2.402l-2.56 -1.098v-3.5l3.51 1.755a2.989 2.989 0 0 1 2.834 -.635l2.727 -3.818a4.5 4.5 0 0 1 4.429 -5.302z" /><circle cx="16.5" cy="9.5" r="1" fill="currentColor" /></svg>
|
After Width: | Height: | Size: 589 B |
5
assets/icons/code-header.svg
Normal file
@ -0,0 +1,5 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" x="0px" y="0px" width="450px" height="130px">
|
||||
<ellipse cx="65" cy="65" rx="50" ry="52" stroke="rgb(220,60,54)" stroke-width="2" fill="rgb(237,108,96)"/>
|
||||
<ellipse cx="225" cy="65" rx="50" ry="52" stroke="rgb(218,151,33)" stroke-width="2" fill="rgb(247,193,81)"/>
|
||||
<ellipse cx="385" cy="65" rx="50" ry="52" stroke="rgb(27,161,37)" stroke-width="2" fill="rgb(100,200,86)"/>
|
||||
</svg>
|
After Width: | Height: | Size: 446 B |
1
assets/icons/edit.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1746498603987" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3852" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M170.667 810.667h682.666a42.667 42.667 0 0 1 0 85.333H170.667a42.667 42.667 0 0 1 0-85.333z m0-204.502a21.333 21.333 0 0 1 6.229-15.061l448-448a21.333 21.333 0 0 1 30.208 0l97.792 97.792a21.333 21.333 0 0 1 0 30.208l-448 448a21.333 21.333 0 0 1-15.061 6.23H181.333a10.667 10.667 0 0 1-10.666-10.667V606.165zM640 218.496L234.667 623.829v37.504h37.504L677.504 256 640 218.496z" p-id="3853"></path></svg>
|
After Width: | Height: | Size: 734 B |
1
assets/icons/file-description.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1746495917232" class="icon" viewBox="0 0 1070 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2729" xmlns:xlink="http://www.w3.org/1999/xlink" width="208.984375" height="200"><path d="M779.729455 791.272727l-86.43491-186.181818h-316.043636l-86.434909 186.181818H349.090909a23.272727 23.272727 0 1 1 0 46.545455h-139.636364a23.272727 23.272727 0 1 1 0-46.545455h32.628364a23.179636 23.179636 0 0 1 2.187636-10.286545l269.870546-581.352727a23.272727 23.272727 0 0 1 42.263273 0l270.196363 582.050909a23.179636 23.179636 0 0 1 2.187637 9.588363h32.302545a23.272727 23.272727 0 1 1 0 46.545455h-139.636364a23.272727 23.272727 0 1 1 0-46.545455h58.27491zM398.894545 558.545455h272.849455L535.272727 264.704 398.894545 558.545455z" fill="#666666" p-id="2730"></path></svg>
|
After Width: | Height: | Size: 922 B |
1
assets/icons/moon.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1746549290469" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3608" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M676.64 72.373333a21.333333 21.333333 0 0 0-28.426667 24.96c7.733333 32 17.333333 77.973333 17.333334 108.64a407.36 407.36 0 0 1-585.173334 366.4 21.333333 21.333333 0 0 0-30.293333 23.04 469.333333 469.333333 0 0 0 485.333333 385.333334c243.84-11.84 439.413333-212.16 445.76-456.213334a469.333333 469.333333 0 0 0-304.533333-452.16zM512 906.666667a395.306667 395.306667 0 0 1-357.333333-226.4 2.186667 2.186667 0 0 1 2.453333-3.04 480 480 0 0 0 100.96 10.666666 482.506667 482.506667 0 0 0 481.92-481.92v-11.68a2.186667 2.186667 0 0 1 3.466667-1.813333 395.52 395.52 0 0 1 81.44 78.986667A390.826667 390.826667 0 0 1 906.666667 512a395.146667 395.146667 0 0 1-394.666667 394.666667zM202.293333 262.72a8.96 8.96 0 0 0 2.88 0.426667 75.946667 75.946667 0 0 1 75.733334 75.733333 7.626667 7.626667 0 0 0 0.48 2.88 11.52 11.52 0 0 0 22.186666 0 8.746667 8.746667 0 0 0 0.426667-2.88 76 76 0 0 1 75.733333-75.733333 8.746667 8.746667 0 0 0 2.88-0.426667 11.573333 11.573333 0 0 0 0-22.24 8.746667 8.746667 0 0 0-2.88-0.426667A75.946667 75.946667 0 0 1 304 164.32a8.746667 8.746667 0 0 0-0.426667-2.88 11.52 11.52 0 0 0-22.186666 0 7.626667 7.626667 0 0 0-0.48 2.88A75.893333 75.893333 0 0 1 205.386667 240a8.96 8.96 0 0 0-2.88 0.426667 11.573333 11.573333 0 0 0 0 22.24z" p-id="3609" fill="#e6e6e6"></path></svg>
|
After Width: | Height: | Size: 1.6 KiB |
1
assets/icons/sun.svg
Normal file
@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1746549266794" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2634" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M512 768c-141.376 0-256-114.624-256-256s114.624-256 256-256 256 114.624 256 256-114.624 256-256 256z m0-85.333333a170.666667 170.666667 0 1 0 0-341.333334 170.666667 170.666667 0 0 0 0 341.333334zM469.333333 85.333333a42.666667 42.666667 0 1 1 85.333334 0v85.333334a42.666667 42.666667 0 1 1-85.333334 0V85.333333z m0 768a42.666667 42.666667 0 1 1 85.333334 0v85.333334a42.666667 42.666667 0 1 1-85.333334 0v-85.333334zM85.333333 554.666667a42.666667 42.666667 0 1 1 0-85.333334h85.333334a42.666667 42.666667 0 1 1 0 85.333334H85.333333z m768 0a42.666667 42.666667 0 1 1 0-85.333334h85.333334a42.666667 42.666667 0 1 1 0 85.333334h-85.333334zM161.834667 222.165333a42.666667 42.666667 0 0 1 60.330666-60.330666l64 64a42.666667 42.666667 0 0 1-60.330666 60.330666l-64-64z m576 576a42.666667 42.666667 0 0 1 60.330666-60.330666l64 64a42.666667 42.666667 0 0 1-60.330666 60.330666l-64-64z m-515.669334 64a42.666667 42.666667 0 0 1-60.330666-60.330666l64-64a42.666667 42.666667 0 0 1 60.330666 60.330666l-64 64z m576-576a42.666667 42.666667 0 0 1-60.330666-60.330666l64-64a42.666667 42.666667 0 0 1 60.330666 60.330666l-64 64z" fill="#000000" p-id="2635"></path></svg>
|
After Width: | Height: | Size: 1.5 KiB |
@ -1 +1,82 @@
|
||||
/* Place your custom SCSS in HUGO_SITE_FOLDER/assets/scss/custom.scss */
|
||||
.archives-group {
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
||||
.article-list--compact {
|
||||
align-items: center;
|
||||
--image-size: 75px;
|
||||
display: inline-flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.article-list--compact img {
|
||||
margin-left: 10px;
|
||||
border-radius: 10px;
|
||||
box-shadow: 0 0 0.3em;
|
||||
}
|
||||
.article-list--compact article>a {
|
||||
gap: 0;
|
||||
padding: 2em;
|
||||
}
|
||||
|
||||
.article-list--compact article:not(:last-of-type) {
|
||||
border-bottom: none;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.article-description {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
|
||||
.article-list--compact.links {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
background: none;
|
||||
box-shadow: none;
|
||||
|
||||
article {
|
||||
background: var(--card-background);
|
||||
border: none;
|
||||
box-shadow: var(--shadow-l2);
|
||||
margin-bottom: 8px;
|
||||
border-radius: 10px;
|
||||
|
||||
&:nth-child(odd) {
|
||||
margin-right: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.article-time>div,
|
||||
.article-translations>div {
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.totalcount {
|
||||
color: var(--card-text-color-secondary);
|
||||
font-weight: normal;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.article-content .highlight {
|
||||
background-color: #282c34;
|
||||
}
|
||||
// 文章页字体
|
||||
body, .article-content {
|
||||
font-family: 'Noto Serif SC', serif;
|
||||
}
|
||||
|
||||
// 标题字体
|
||||
body, .article-title {
|
||||
font-family: 'Noto Serif SC', serif;
|
||||
}
|
||||
|
||||
|
||||
// 首页字体
|
||||
body, .article-page {
|
||||
font-family: 'Noto Serif SC', serif;
|
||||
}
|
@ -458,4 +458,4 @@
|
||||
border-radius: 4px;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
}
|
@ -33,6 +33,15 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.tagCloud-count {
|
||||
color: var(--body-text-color);
|
||||
}
|
||||
}
|
||||
|
||||
.article-category {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
/* Archives widget */
|
||||
|
@ -47,10 +47,12 @@ let Stack = {
|
||||
|
||||
const colors = await getColor(key, hash, imageURL);
|
||||
|
||||
articleDetails.style.background = `
|
||||
linear-gradient(0deg,
|
||||
rgba(${colors.DarkMuted.rgb[0]}, ${colors.DarkMuted.rgb[1]}, ${colors.DarkMuted.rgb[2]}, 0.5) 0%,
|
||||
rgba(${colors.Vibrant.rgb[0]}, ${colors.Vibrant.rgb[1]}, ${colors.Vibrant.rgb[2]}, 0.75) 100%)`;
|
||||
/**
|
||||
* articleDetails.style.background = `
|
||||
* linear-gradient(0deg,
|
||||
* rgba(${colors.DarkMuted.rgb[0]}, ${colors.DarkMuted.rgb[1]}, ${colors.DarkMuted.rgb[2]}, 0.5) 0%,
|
||||
* rgba(${colors.Vibrant.rgb[0]}, ${colors.Vibrant.rgb[1]}, ${colors.Vibrant.rgb[2]}, 0.75) 100%)`;
|
||||
*/
|
||||
})
|
||||
})
|
||||
});
|
||||
|
@ -1,44 +1,44 @@
|
||||
Vibrant:
|
||||
- src: https://cdn.jsdelivr.net/npm/node-vibrant@3.1.6/dist/vibrant.min.js
|
||||
- src: https://blog.sakurasen.cn/src/vibrant.min.js
|
||||
integrity: sha256-awcR2jno4kI5X0zL8ex0vi2z+KMkF24hUW8WePSA9HM=
|
||||
type: script
|
||||
|
||||
PhotoSwipe:
|
||||
- src: https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.js
|
||||
- src: https://blog.sakurasen.cn/src/photoswipe.min.js
|
||||
integrity: sha256-ePwmChbbvXbsO02lbM3HoHbSHTHFAeChekF1xKJdleo=
|
||||
type: script
|
||||
defer: true
|
||||
|
||||
- src: https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe-ui-default.min.js
|
||||
- src: https://blog.sakurasen.cn/src/photoswipe-ui-default.min.js
|
||||
integrity: sha256-UKkzOn/w1mBxRmLLGrSeyB4e1xbrp4xylgAWb3M42pU=
|
||||
type: script
|
||||
defer: true
|
||||
|
||||
- src: https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/default-skin/default-skin.min.css
|
||||
- src: https://blog.sakurasen.cn/src/default-skin.min.css
|
||||
type: style
|
||||
|
||||
- src: https://cdn.jsdelivr.net/npm/photoswipe@4.1.3/dist/photoswipe.min.css
|
||||
- src: https://blog.sakurasen.cn/src/photoswipe.min.css
|
||||
type: style
|
||||
|
||||
KaTeX:
|
||||
- src: https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.css
|
||||
- src: https://blog.sakurasen.cn/src/katex.min.css
|
||||
integrity: sha384-n8MVd4RsNIU0tAv4ct0nTaAbDJwPJzDEaqSD1odI+WdtXRGWt2kTvGFasHpSy3SV
|
||||
type: style
|
||||
|
||||
- src: https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/katex.min.js
|
||||
- src: https://blog.sakurasen.cn/src/katex.min.js
|
||||
integrity: sha384-XjKyOOlGwcjNTAIQHIpgOno0Hl1YQqzUOEleOLALmuqehneUG+vnGctmUb0ZY0l8
|
||||
type: script
|
||||
defer: true
|
||||
|
||||
- src: https://cdn.jsdelivr.net/npm/katex@0.16.9/dist/contrib/auto-render.min.js
|
||||
- src: https://blog.sakurasen.cn/src/auto-render.min.js
|
||||
integrity: sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05
|
||||
type: script
|
||||
defer: true
|
||||
|
||||
Cactus:
|
||||
- src: https://latest.cactus.chat/cactus.js
|
||||
- src: https://blog.sakurasen.cn/src/cactus.js
|
||||
integrity:
|
||||
type: script
|
||||
- src: https://latest.cactus.chat/style.css
|
||||
- src: https://blog.sakurasen.cn/src/style.css
|
||||
integrity:
|
||||
type: style
|
||||
|
10
i18n/en.yaml
@ -32,6 +32,10 @@ article:
|
||||
readingTime:
|
||||
one: "{{ .Count }} minute read"
|
||||
other: "{{ .Count }} minute read"
|
||||
wordCount:
|
||||
other: "{{.Count}} words"
|
||||
totalword:
|
||||
other: "{{ .PostCount }} Posts and {{ .TotalWords }} Words"
|
||||
|
||||
notFound:
|
||||
title:
|
||||
@ -71,3 +75,9 @@ footer:
|
||||
|
||||
designedBy:
|
||||
other: Theme {{ .Theme }} designed by {{ .DesignedBy }}
|
||||
copy:
|
||||
other: Copyright
|
||||
donate:
|
||||
other: Donate
|
||||
feedback:
|
||||
other: Feedback
|
||||
|
@ -26,6 +26,10 @@ article:
|
||||
|
||||
readingTime:
|
||||
other: "阅读时长: {{ .Count }} 分钟"
|
||||
wordCount:
|
||||
other: "{{.Count}} 字"
|
||||
totalword:
|
||||
other: "发表了 {{ .PostCount }} 篇文章 · 总计 {{ .TotalWords }} 字"
|
||||
|
||||
notFound:
|
||||
title:
|
||||
@ -65,3 +69,10 @@ footer:
|
||||
|
||||
designedBy:
|
||||
other: 主题 {{ .Theme }} 由 {{ .DesignedBy }} 设计
|
||||
copy:
|
||||
other: 版权说明
|
||||
donate:
|
||||
other: 支持我
|
||||
feedback:
|
||||
other: 反馈
|
||||
|
||||
|
@ -1,3 +1,10 @@
|
||||
<a class="link" href="{{ .Destination | safeURL }}" {{ with .Title}} title="{{ . }}"
|
||||
{{ end }}{{ if strings.HasPrefix .Destination "http" }} target="_blank" rel="noopener"
|
||||
{{ end }}>{{ .Text | safeHTML }}</a>
|
||||
<a class="link" href="{{ .Destination | safeURL }}" {{ with .Title}} title="{{ . }}" {{ end }}{{ if strings.HasPrefix
|
||||
.Destination "http" }} target="_blank" rel="noopener" {{ end }}>{{ .Text | safeHTML }}</a>
|
||||
{{ if strings.HasPrefix .Destination "http" }}
|
||||
<span style="white-space: nowrap;"><svg width=".7em" height=".7em" viewBox="0 0 21 21"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="m13 3l3.293 3.293l-7 7l1.414 1.414l7-7L21 11V3z" fill="currentColor" />
|
||||
<path d="M19 19H5V5h7l-2-2H5c-1.103 0-2 .897-2 2v14c0 1.103.897 2 2 2h14c1.103 0 2-.897 2-2v-5l-2-2v7z"
|
||||
fill="currentColor">
|
||||
</svg></span>
|
||||
{{ end }}
|
@ -14,7 +14,25 @@
|
||||
</div>
|
||||
{{ end }}
|
||||
</header>
|
||||
|
||||
{{- $taxonomy := $.Site.GetPage "taxonomyTerm" "tags" -}}
|
||||
{{- $terms := $taxonomy.Pages -}}
|
||||
{{ if $terms }}
|
||||
<section class="widget tagCloud">
|
||||
<h2 class="section-title">{{ $taxonomy.Title }}</h2>
|
||||
|
||||
<div class="tagCloud-tags">
|
||||
{{ if ne (len $.Site.Taxonomies.tags) 0 }}
|
||||
{{ range $name, $taxonomy := $.Site.Taxonomies.tags }}
|
||||
{{ $tagCount := len $taxonomy.Pages }}
|
||||
<a href="{{ "/tags/" | relURL }}{{ $name | urlize }}" class="tagCloud-tags">
|
||||
{{ $name }}<span class="tagCloud-count">{{ $tagCount }}</span>
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
<section>
|
||||
{{ end }}
|
||||
|
||||
{{ $pages := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
||||
{{ $notHidden := where .Site.RegularPages "Params.hidden" "!=" true }}
|
||||
{{ $filtered := ($pages | intersect $notHidden) }}
|
||||
|
@ -4,11 +4,17 @@
|
||||
<h2 class="article-title">
|
||||
{{- .Title -}}
|
||||
</h2>
|
||||
{{ with .Params.description }}
|
||||
<h3 class="article-description">
|
||||
{{ . }}
|
||||
</h3>
|
||||
{{ end }}
|
||||
<footer class="article-time">
|
||||
<time datetime='{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}'>
|
||||
{{- .Date.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
|
||||
</time>
|
||||
</footer>
|
||||
|
||||
</div>
|
||||
|
||||
{{- $image := partialCached "helper/image" (dict "Context" . "Type" "articleList") .RelPermalink "articleList" -}}
|
||||
|
@ -2,9 +2,9 @@
|
||||
{{ if .Params.categories }}
|
||||
<header class="article-category">
|
||||
{{ range (.GetTerms "categories") }}
|
||||
<a href="{{ .RelPermalink }}" {{ with .Params.style }}style="background-color: {{ .background }}; color: {{ .color }};"{{ end }}>
|
||||
{{ .LinkTitle }}
|
||||
</a>
|
||||
<a href="{{ .RelPermalink }}">
|
||||
{{ .LinkTitle }}
|
||||
</a>
|
||||
{{ end }}
|
||||
</header>
|
||||
{{ end }}
|
||||
@ -15,7 +15,7 @@
|
||||
{{- .Title -}}
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
|
||||
{{ with .Params.description }}
|
||||
<h3 class="article-subtitle">
|
||||
{{ . }}
|
||||
@ -29,33 +29,43 @@
|
||||
{{ if $showFooter }}
|
||||
<footer class="article-time">
|
||||
{{ if $showDate }}
|
||||
<div>
|
||||
{{ partial "helper/icon" "date" }}
|
||||
<time class="article-time--published">
|
||||
{{- .Date | time.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
|
||||
</time>
|
||||
</div>
|
||||
<div>
|
||||
{{ partial "helper/icon" "date" }}
|
||||
<time class="article-time--published">
|
||||
{{- .Date | time.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
|
||||
</time>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ if $showReadingTime }}
|
||||
<div>
|
||||
{{ partial "helper/icon" "clock" }}
|
||||
<time class="article-time--reading">
|
||||
{{ T "article.readingTime" .ReadingTime }}
|
||||
</time>
|
||||
</div>
|
||||
<div>
|
||||
{{ partial "helper/icon" "clock" }}
|
||||
<time class="article-time--reading">
|
||||
{{ T "article.readingTime" .ReadingTime }}
|
||||
</time>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ if .Site.Params.article.readingTime }}
|
||||
<div>
|
||||
{{ partial "helper/icon" "file-description" }}
|
||||
<time class="article-words">
|
||||
{{ T "article.wordCount" .WordCount }}
|
||||
</time>
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
</footer>
|
||||
{{ end }}
|
||||
|
||||
{{ if .IsTranslated }}
|
||||
<footer class="article-translations">
|
||||
{{ partial "helper/icon" "language" }}
|
||||
<div>
|
||||
{{ range .Translations }}
|
||||
<a href="{{ .Permalink }}" class="link">{{ .Language.LanguageName }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</footer>
|
||||
<footer class="article-translations">
|
||||
{{ partial "helper/icon" "language" }}
|
||||
<div>
|
||||
{{ range .Translations }}
|
||||
<a href="{{ .Permalink }}" class="link">{{ .Language.LanguageName }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</footer>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
</div>
|
@ -1,11 +0,0 @@
|
||||
<script>
|
||||
(function () {
|
||||
const customFont = document.createElement('link');
|
||||
customFont.href = "https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&display=swap";
|
||||
|
||||
customFont.type = "text/css";
|
||||
customFont.rel = "stylesheet";
|
||||
|
||||
document.head.appendChild(customFont);
|
||||
}());
|
||||
</script>
|
@ -0,0 +1,19 @@
|
||||
<!-- layouts/partials/footer/custom.html -->
|
||||
<script
|
||||
src="https://sakurasen.cn/cdn/npo/nprogress.min.js"
|
||||
integrity="sha384-bHDlAEUFxsRI7JfULv3DTpL2IXbbgn4JHQJibgo5iiXSK6Iu8muwqHANhun74Cqg"
|
||||
crossorigin="anonymous"
|
||||
></script>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="https://sakurasen.cn/cdn/npo/nprogress.css"
|
||||
integrity="sha384-KJyhr2syt5+4M9Pz5dipCvTrtvOmLk/olWVdfhAp858UCa64Ia5GFpTN7+G4BWpE"
|
||||
crossorigin="anonymous"
|
||||
/>
|
||||
<script>
|
||||
NProgress.start();
|
||||
document.addEventListener("readystatechange", () => {
|
||||
if (document.readyState === "interactive") NProgress.inc(0.8);
|
||||
if (document.readyState === "complete") NProgress.done();
|
||||
});
|
||||
</script>
|
@ -1,23 +1,59 @@
|
||||
{{- $ThemeVersion := "3.30.0" -}}
|
||||
<footer class="site-footer">
|
||||
<!---
|
||||
<section class="copyright">
|
||||
©
|
||||
©
|
||||
{{ if and (.Site.Params.footer.since) (ne .Site.Params.footer.since (int (now.Format "2006"))) }}
|
||||
{{ .Site.Params.footer.since }} -
|
||||
{{ .Site.Params.footer.since }} -
|
||||
{{ end }}
|
||||
{{ now.Format "2006" }} {{ default .Site.Title .Site.Copyright }}
|
||||
</section>
|
||||
|
||||
-->
|
||||
<!-- Add total page and word count time -->
|
||||
|
||||
<div>
|
||||
<p id="footer-sponsor"><a href="https://www.rainyun.com/?ref=MjEwOTk=" target="_blank" alt="Server Sponsor" rel="nofollow"><img src="https://blog.sakurasen.cn/src/rainyun.svg" alt="Server Sponsor" style="height: 2em;"> <a href="https://github.com/CaiJimmy/hugo-theme-stack" target="_blank" alt="Theme Sponsor" rel="nofollow"><img src="https://blog.sakurasen.cn/src/Stack.svg" alt="Theme Sponsor" style="height: 2em;"></a> <a href="https://gohugo.io/" target="_blank" alt="Theme Sponsor" rel="nofollow"><img src="https://blog.sakurasen.cn/src/hugo.svg" alt="Blog SyStem Sponsor" style="height: 2em;"></a></p>
|
||||
</div>
|
||||
<!---
|
||||
<section class="powerby">
|
||||
{{ with .Site.Params.footer.customText }}
|
||||
{{ . | safeHTML }} <br/>
|
||||
{{ . | safeHTML }} <br />
|
||||
{{ end }}
|
||||
|
||||
{{- $Generator := `<a href="https://gohugo.io/" target="_blank" rel="noopener">Hugo</a>` -}}
|
||||
{{- $Theme := printf `<b><a href="https://github.com/CaiJimmy/hugo-theme-stack" target="_blank" rel="noopener" data-version="%s">Stack</a></b>` $ThemeVersion -}}
|
||||
{{- $Theme := printf `<b><a href="https://github.com/CaiJimmy/hugo-theme-stack" target="_blank" rel="noopener"
|
||||
data-version="%s">Stack</a></b>` $ThemeVersion -}}
|
||||
{{- $DesignedBy := `<a href="https://jimmycai.com" target="_blank" rel="noopener">Jimmy</a>` -}}
|
||||
|
||||
{{ T "footer.builtWith" (dict "Generator" $Generator) | safeHTML }} <br />
|
||||
{{ T "footer.designedBy" (dict "Theme" $Theme "DesignedBy" $DesignedBy) | safeHTML }}
|
||||
</section>
|
||||
</footer>
|
||||
-->
|
||||
<section class="totalcount">
|
||||
{{ $scratch := newScratch }}
|
||||
{{ range where .Site.Pages "Kind" "page" }}
|
||||
{{ $scratch.Add "total" .WordCount }}
|
||||
{{ end }}
|
||||
|
||||
{{ $postCount := len (where .Site.RegularPages "Section" "post") }}
|
||||
{{ $totalWords := div ($scratch.Get "total") 1 }}
|
||||
|
||||
{{ $params := dict
|
||||
"PostCount" $postCount
|
||||
"TotalWords" $totalWords
|
||||
}}
|
||||
|
||||
{{ T "article.totalword" $params | safeHTML }}
|
||||
|
||||
</section>
|
||||
<div>
|
||||
<a href="/copyright">{{T "footer.copy"}}</a> | <a href="/donate">{{T "footer.donate"}}</a> | <a href="/feedback">{{T "footer.feedback"}}</a>
|
||||
</div>
|
||||
|
||||
|
||||
<div style="display: inline-flex; justify-items: center;">
|
||||
<a target="_blank" href="https://beian.miit.gov.cn/" id="beian">豫ICP备2024071946号</a><a> | </a>
|
||||
<a target="_blank" id="ga" href="https://beian.mps.gov.cn/#/query/webSearch?code=41040302000150"
|
||||
style="display:inline-block;text-decoration:none;">豫公网安备41040302000150号</a>
|
||||
</div>
|
||||
</footer>
|
@ -0,0 +1,3 @@
|
||||
<link rel="preconnect" href="https://sakurasen.cn">
|
||||
<link rel="preconnect" href="https://sakurasen.cn" crossorigin>
|
||||
<link href="https://sakurasen.cn/cdn/font/noto_serif_sc_500_original.css" rel="stylesheet">
|
@ -100,4 +100,4 @@
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
</aside>
|
||||
</aside>
|
@ -1,15 +1,15 @@
|
||||
{{- $context := .Context -}}
|
||||
{{- $limit := default 10 .Params.limit -}}
|
||||
<section class="widget tagCloud">
|
||||
<section class="widget category">
|
||||
<div class="widget-icon">
|
||||
{{ partial "helper/icon" "categories" }}
|
||||
</div>
|
||||
<h2 class="widget-title section-title">{{ T "widget.categoriesCloud.title" }}</h2>
|
||||
|
||||
<div class="tagCloud-tags">
|
||||
<div class="category-label">
|
||||
{{ range first $limit $context.Site.Taxonomies.categories.ByCount }}
|
||||
<a href="{{ .Page.RelPermalink }}" class="font_size_{{ .Count }}">
|
||||
{{ .Page.Title }}
|
||||
{{ .Page.Title }}<span class="category-count">{{ .Count }}</span>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
@ -10,6 +10,8 @@
|
||||
{{ range first $limit $context.Site.Taxonomies.tags.ByCount }}
|
||||
<a href="{{ .Page.RelPermalink }}" class="font_size_{{ .Count }}">
|
||||
{{ .Page.Title }}
|
||||
{{/* 添加计数显示 */}}
|
||||
<span class="tagCloud-count">{{ .Count }}</span>
|
||||
</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
|