mirror of
https://github.com/CaiJimmy/hugo-theme-stack.git
synced 2025-04-29 03:53:30 +08:00
zh-cn_localization
This commit is contained in:
parent
13568d8ff0
commit
b6d2fbbda6
22
README.md
22
README.md
@ -1,3 +1,25 @@
|
|||||||
|
# Features
|
||||||
|
- 添加busuanzi页面计数功能
|
||||||
|
```
|
||||||
|
[params.busuanzi]
|
||||||
|
enabled = true
|
||||||
|
```
|
||||||
|
- 添加百度统计
|
||||||
|
```
|
||||||
|
[params.baidu]
|
||||||
|
enabled = true
|
||||||
|
id = "******"
|
||||||
|
```
|
||||||
|
- 底部悬挂ICP备案号
|
||||||
|
```
|
||||||
|
[params.footer]
|
||||||
|
icp = "ICP备202308111103"
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
Original `README.md`
|
||||||
|
---
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
# Hugo Theme Stack
|
# Hugo Theme Stack
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 373 B After Width: | Height: | Size: 50 KiB |
@ -1,12 +1,10 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"*": [
|
"*": [
|
||||||
"*"
|
"*"
|
||||||
]
|
]
|
||||||
},
|
}
|
||||||
"lib": ["es2020", "dom"],
|
}
|
||||||
"jsx": "preserve"
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,5 +1,5 @@
|
|||||||
<article class="{{ if .Params.image }}has-image {{ end }}main-article">
|
<article class="{{ if .Params.image }}has-image {{ end }}main-article">
|
||||||
{{ partial "article/components/header" . }}
|
{{ partial "article/components/header_content" . }}
|
||||||
|
|
||||||
{{ partial "article/components/content" . }}
|
{{ partial "article/components/content" . }}
|
||||||
|
|
||||||
|
73
layouts/partials/article/components/details_content.html
Normal file
73
layouts/partials/article/components/details_content.html
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
<div class="article-details">
|
||||||
|
{{ 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>
|
||||||
|
{{ end }}
|
||||||
|
</header>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
<div class="article-title-wrapper">
|
||||||
|
<h2 class="article-title">
|
||||||
|
<a href="{{ .RelPermalink }}">
|
||||||
|
{{- .Title -}}
|
||||||
|
</a>
|
||||||
|
</h2>
|
||||||
|
|
||||||
|
{{ with .Params.description }}
|
||||||
|
<h3 class="article-subtitle">
|
||||||
|
{{ . }}
|
||||||
|
</h3>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{ $showReadingTime := .Params.readingTime | default (.Site.Params.article.readingTime) }}
|
||||||
|
{{ $showDate := not .Date.IsZero }}
|
||||||
|
{{ $showFooter := or $showDate $showReadingTime }}
|
||||||
|
{{ if $showFooter }}
|
||||||
|
<footer class="article-time">
|
||||||
|
{{ if $showDate }}
|
||||||
|
<div>
|
||||||
|
{{ partial "helper/icon" "date" }}
|
||||||
|
<time class="article-time--published">
|
||||||
|
{{- .Date.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>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{- if .Site.Params.busuanzi.enabled -}}
|
||||||
|
<footer class="article-time">
|
||||||
|
<div class="meta-item">
|
||||||
|
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
||||||
|
<span id="busuanzi_container_page_pv" style="display: inline;">
|
||||||
|
<i class="fa fa-eye"></i> 浏览量:<span id="busuanzi_value_page_pv"></span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
|
{{- 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>
|
||||||
|
{{ end }}
|
||||||
|
</div>
|
35
layouts/partials/article/components/header_content.html
Normal file
35
layouts/partials/article/components/header_content.html
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<header class="article-header">
|
||||||
|
{{- $image := partialCached "helper/image" (dict "Context" . "Type" "article") .RelPermalink "article" -}}
|
||||||
|
{{ if $image.exists }}
|
||||||
|
<div class="article-image">
|
||||||
|
<a href="{{ .RelPermalink }}">
|
||||||
|
{{ if $image.resource }}
|
||||||
|
{{- $Permalink := $image.resource.RelPermalink -}}
|
||||||
|
{{- $Width := $image.resource.Width -}}
|
||||||
|
{{- $Height := $image.resource.Height -}}
|
||||||
|
{{- $Srcset := "" -}}
|
||||||
|
|
||||||
|
{{- if (default true .Page.Site.Params.imageProcessing.cover.enabled) -}}
|
||||||
|
{{- $thumbnail := $image.resource.Resize "800x" -}}
|
||||||
|
{{- $thumbnailRetina := $image.resource.Resize "1600x" -}}
|
||||||
|
{{- $Srcset = printf "%s 800w, %s 1600w" $thumbnail.RelPermalink $thumbnailRetina.RelPermalink -}}
|
||||||
|
{{- $Permalink = $thumbnail.RelPermalink -}}
|
||||||
|
{{- $Width = $thumbnail.Width -}}
|
||||||
|
{{- $Height = $thumbnail.Height -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
<img src="{{ $Permalink }}"
|
||||||
|
{{ with $Srcset }}srcset="{{ . }}"{{ end }}
|
||||||
|
width="{{ $Width }}"
|
||||||
|
height="{{ $Height }}"
|
||||||
|
loading="lazy"
|
||||||
|
alt="Featured image of post {{ .Title }}" />
|
||||||
|
{{ else }}
|
||||||
|
<img src="{{ $image.permalink }}" loading="lazy" alt="Featured image of post {{ .Title }}" />
|
||||||
|
{{ end }}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
{{ partialCached "article/components/details_content" . .RelPermalink }}
|
||||||
|
</header>
|
@ -8,6 +8,10 @@
|
|||||||
{{ now.Format "2006" }} {{ .Site.Title }}
|
{{ now.Format "2006" }} {{ .Site.Title }}
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
|
{{if (.Site.Params.footer.icp)}}
|
||||||
|
<a href="http://beian.miit.gov.cn/publish/query/indexFirst.action" target="_blank" rel="noopener noreferrer nofollow">{{ (.Site.Params.footer.icp)}}</a>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
<section class="powerby">
|
<section class="powerby">
|
||||||
{{ with .Site.Params.footer.customText }}
|
{{ with .Site.Params.footer.customText }}
|
||||||
{{ . | safeHTML }} <br/>
|
{{ . | safeHTML }} <br/>
|
||||||
|
@ -0,0 +1,21 @@
|
|||||||
|
<!-- Baidu -->
|
||||||
|
|
||||||
|
{{- if .Site.Params.baidu.enabled -}}
|
||||||
|
<script>
|
||||||
|
var _hmt = _hmt || [];
|
||||||
|
(function() {
|
||||||
|
var hm = document.createElement("script");
|
||||||
|
hm.src = "https://hm.baidu.com/hm.js?{{- .Site.Params.baidu.id -}}";
|
||||||
|
var s = document.getElementsByTagName("script")[0];
|
||||||
|
s.parentNode.insertBefore(hm, s);
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
<!-- busuanzi -->
|
||||||
|
{{- if .Site.Params.busuanzi.enabled -}}
|
||||||
|
<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
|
||||||
|
<meta name="referrer" content="no-referrer-when-downgrade">
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
|||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
<div class="site-meta">
|
<div class="site-meta">
|
||||||
<h1 class="site-name"><a href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Title }}</a></h1>
|
<h1 class="site-name"><a href="{{ .Site.BaseURL | relLangURL }}">{{ .Site.Params.username }}</a></h1>
|
||||||
<h2 class="site-description">{{ .Site.Params.sidebar.subtitle }}</h2>
|
<h2 class="site-description">{{ .Site.Params.sidebar.subtitle }}</h2>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
Loading…
Reference in New Issue
Block a user