Merge branch 'master' into template-search
This commit is contained in:
commit
c266204f98
@ -35,7 +35,12 @@ The only JavaScript library being used is [node-vibrant](https://github.com/Vibr
|
|||||||
|
|
||||||
This theme uses SCSS and TypeScript. For that reason, it's necessary to use **Hugo ≥ 0.74.0**.
|
This theme uses SCSS and TypeScript. For that reason, it's necessary to use **Hugo ≥ 0.74.0**.
|
||||||
|
|
||||||
**Note**: You'll need Hugo Extended version to edit SCSS files
|
Use Hugo Extended version if you want to:
|
||||||
|
|
||||||
|
* Use the latest feature/fix from `master` branch
|
||||||
|
* Edit SCSS files
|
||||||
|
|
||||||
|
**Compiled CSS are updated once per release.**
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
@ -104,6 +104,7 @@
|
|||||||
|
|
||||||
.article-tags {
|
.article-tags {
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
|
text-transform: unset;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
---
|
---
|
||||||
title: 中文文章内容测试
|
title: Chinese Test
|
||||||
description: 这是一个副标题
|
description: 这是一个副标题
|
||||||
date: 2020-09-09
|
date: 2020-09-09
|
||||||
slug: test-chinese
|
slug: test-chinese
|
||||||
image: helena-hertz-wWZzXlDpMog-unsplash.jpg
|
image: helena-hertz-wWZzXlDpMog-unsplash.jpg
|
||||||
categories:
|
categories:
|
||||||
- Test
|
- Test
|
||||||
|
- 测试
|
||||||
---
|
---
|
||||||
|
|
||||||
## 正文测试
|
## 正文测试
|
||||||
|
@ -4,11 +4,13 @@ title = "Placeholder Text"
|
|||||||
date = "2019-03-09"
|
date = "2019-03-09"
|
||||||
description = "Lorem Ipsum Dolor Si Amet"
|
description = "Lorem Ipsum Dolor Si Amet"
|
||||||
categories = [
|
categories = [
|
||||||
"Test"
|
"Test",
|
||||||
|
"Test with whitespaces"
|
||||||
]
|
]
|
||||||
tags = [
|
tags = [
|
||||||
"markdown",
|
"markdown",
|
||||||
"text",
|
"text",
|
||||||
|
"tag with whitespaces"
|
||||||
]
|
]
|
||||||
image = "matt-le-SJSpo9hQf7s-unsplash.jpg"
|
image = "matt-le-SJSpo9hQf7s-unsplash.jpg"
|
||||||
+++
|
+++
|
||||||
|
@ -1,18 +1,21 @@
|
|||||||
{{ $image := partialCached "helper/image" (dict "Context" . "Type" "article") .RelPermalink "article" }}
|
{{ $image := partialCached "helper/image" (dict "Context" . "Type" "article") .RelPermalink "article" }}
|
||||||
{{- $context := . -}}
|
{{- $context := . -}}
|
||||||
{{- $categories := .Params.categories -}}
|
|
||||||
<div class="article-details">
|
<div class="article-details">
|
||||||
{{ if $categories }}
|
{{ if .Params.categories }}
|
||||||
<header class="article-category">
|
<header class="article-category">
|
||||||
{{ range $category := $categories }}
|
{{ range (.GetTerms "categories") }}
|
||||||
{{ $term := $.Site.GetPage (printf "/categories/%s" $category) }}
|
|
||||||
{{ if and $image.exists $image.resource }}
|
{{ if and $image.exists $image.resource }}
|
||||||
{{- $imageRaw := $image.resource | resources.Fingerprint "md5" -}}
|
{{- $imageRaw := $image.resource | resources.Fingerprint "md5" -}}
|
||||||
{{- $20x := $imageRaw.Fill "20x20 smart" -}}
|
{{- $20x := $imageRaw.Fill "20x20 smart" -}}
|
||||||
<a href="{{ $term.Permalink }}" class="color-tag"
|
<a href="{{ .Permalink }}"
|
||||||
data-image="{{ $20x.RelPermalink }}" data-key="{{ $context.Slug }}" data-hash="{{ $imageRaw.Data.Integrity }}">{{ $term.Title | humanize }}</a>
|
class="color-tag"
|
||||||
|
data-image="{{ $20x.RelPermalink }}"
|
||||||
|
data-key="{{ $context.Slug }}"
|
||||||
|
data-hash="{{ $imageRaw.Data.Integrity }}">
|
||||||
|
{{ .LinkTitle }}
|
||||||
|
</a>
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<a href="{{ $term.Permalink }}">{{ $term.Title | humanize }}</a>
|
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</header>
|
</header>
|
||||||
@ -32,7 +35,7 @@
|
|||||||
|
|
||||||
{{- if not .Date.IsZero -}}
|
{{- if not .Date.IsZero -}}
|
||||||
<footer class="article-time">
|
<footer class="article-time">
|
||||||
{{ (resources.Get "icons/clock.svg").Content | safeHTML }}
|
{{ partial "helper/icon" "clock" }}
|
||||||
<time class="article-time--published">
|
<time class="article-time--published">
|
||||||
{{- .Date.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
|
{{- .Date.Format (or .Site.Params.dateFormat.published "Jan 02, 2006") -}}
|
||||||
</time>
|
</time>
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
|
|
||||||
{{ if and (.Site.Params.article.license.enabled) (not (eq .Params.license false)) }}
|
{{ if and (.Site.Params.article.license.enabled) (not (eq .Params.license false)) }}
|
||||||
<section class="article-copyright">
|
<section class="article-copyright">
|
||||||
{{ (resources.Get "icons/copyright.svg").Content | safeHTML }}
|
{{ partial "helper/icon" "copyright" }}
|
||||||
<span>{{ default .Site.Params.article.license.default .Params.license }}</span>
|
<span>{{ default .Site.Params.article.license.default .Params.license }}</span>
|
||||||
</section>
|
</section>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
{{- if ne .Lastmod .Date -}}
|
{{- if ne .Lastmod .Date -}}
|
||||||
<section class="article-time">
|
<section class="article-time">
|
||||||
{{ (resources.Get "icons/clock.svg").Content | safeHTML }}
|
{{ partial "helper/icon" "clock" }}
|
||||||
<span class="article-time--modified">
|
<span class="article-time--modified">
|
||||||
{{ T "lastUpdatedOn" }} {{ .Lastmod.Format ( or .Site.Params.dateFormat.lastUpdated "Jan 02, 2006 15:04 MST" ) }}
|
{{ T "lastUpdatedOn" }} {{ .Lastmod.Format ( or .Site.Params.dateFormat.lastUpdated "Jan 02, 2006 15:04 MST" ) }}
|
||||||
</span>
|
</span>
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
{{- $tags := .Params.Tags -}}
|
{{ if .Params.Tags }}
|
||||||
{{ if $tags }}
|
|
||||||
<section class="article-tags">
|
<section class="article-tags">
|
||||||
{{ range $tag := $tags }}
|
{{ range (.GetTerms "tags") }}
|
||||||
{{ with $.Site.GetPage (printf "/tags/%s" $tag) }}
|
<a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
|
||||||
<a href="{{ .Permalink }}">{{ .Title | humanize }}</a>
|
|
||||||
{{ end }}
|
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</section>
|
</section>
|
||||||
{{ end }}
|
{{ end }}
|
@ -2,7 +2,7 @@
|
|||||||
<section class="copyright">© {{ now.Format "2006" }} {{ .Site.Title }}</section>
|
<section class="copyright">© {{ now.Format "2006" }} {{ .Site.Title }}</section>
|
||||||
<section class="powerby">
|
<section class="powerby">
|
||||||
Built with <a href="https://gohugo.io/" target="_blank" rel="noopener">Hugo</a> <br />
|
Built with <a href="https://gohugo.io/" target="_blank" rel="noopener">Hugo</a> <br />
|
||||||
Theme <b><a href="https://github.com/CaiJimmy/hugo-theme-stack" target="_blank" rel="noopener" data-version="1.0.4">Stack</a></b> designed by
|
Theme <b><a href="https://github.com/CaiJimmy/hugo-theme-stack" target="_blank" rel="noopener" data-version="1.0.5">Stack</a></b> designed by
|
||||||
<a href="https://jimmycai.com" target="_blank" rel="noopener">Jimmy</a>
|
<a href="https://jimmycai.com" target="_blank" rel="noopener">Jimmy</a>
|
||||||
</section>
|
</section>
|
||||||
</footer>
|
</footer>
|
6
layouts/partials/helper/icon.html
Normal file
6
layouts/partials/helper/icon.html
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{{- $iconFile := resources.GetMatch (printf "icons/%s.svg" .) -}}
|
||||||
|
{{- if $iconFile -}}
|
||||||
|
{{- $iconFile.Content | safeHTML -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- errorf "Error: icon '%s.svg' is not found under 'assets/icons' folder" . -}}
|
||||||
|
{{- end -}}
|
@ -33,7 +33,7 @@
|
|||||||
<li {{ if $active }} class='current' {{ end }}>
|
<li {{ if $active }} class='current' {{ end }}>
|
||||||
<a href='{{ .URL | absLangURL }}'>
|
<a href='{{ .URL | absLangURL }}'>
|
||||||
{{ if .Pre }}
|
{{ if .Pre }}
|
||||||
{{ (resources.Get (delimit (slice "icons/" .Pre ".svg") "")).Content | safeHTML }}
|
{{ partial "helper/icon" .Pre }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<span>{{- .Name -}}</span>
|
<span>{{- .Name -}}</span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<section class="widget archives">
|
<section class="widget archives">
|
||||||
<div class="widget-icon">
|
<div class="widget-icon">
|
||||||
{{ (resources.Get "icons/infinity.svg").Content | safeHTML }}
|
{{ partial "helper/icon" "infinity" }}
|
||||||
</div>
|
</div>
|
||||||
<h1 class="widget-title">{{ T "widgetArchivesTitle" }}</h1>
|
<h1 class="widget-title">{{ T "widgetArchivesTitle" }}</h1>
|
||||||
|
|
||||||
|
@ -1,16 +1,13 @@
|
|||||||
{{ $tags := .Site.Taxonomies.tags.ByCount }}
|
|
||||||
|
|
||||||
<section class="widget tagCloud">
|
<section class="widget tagCloud">
|
||||||
<div class="widget-icon">
|
<div class="widget-icon">
|
||||||
{{ (resources.Get "icons/tag.svg").Content | safeHTML }}
|
{{ partial "helper/icon" "tag" }}
|
||||||
</div>
|
</div>
|
||||||
<h1 class="widget-title">{{ T "widgetTagCloudTitle" }}</h1>
|
<h1 class="widget-title">{{ T "widgetTagCloudTitle" }}</h1>
|
||||||
|
|
||||||
<div class="tagCloud-tags">
|
<div class="tagCloud-tags">
|
||||||
{{ range first .Site.Params.widgets.tagCloud.limit $tags }}
|
{{ range first .Site.Params.widgets.tagCloud.limit .Site.Taxonomies.tags.ByCount }}
|
||||||
{{ $term := $.Site.GetPage (printf "/tags/%s" .Term) }}
|
<a href="{{ .Page.Permalink }}" class="font_size_{{ .Count }}">
|
||||||
<a href="{{ $term.Permalink }}" class="font_size_{{ .Count }}">
|
{{ .Page.Title }}
|
||||||
{{ $term.Title | humanize }}
|
|
||||||
</a>
|
</a>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</div>
|
</div>
|
||||||
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user