diff options
author | otis <xiaohei.zyx@gmail.com> | 2019-12-31 05:36:51 +0300 |
---|---|---|
committer | otis <xiaohei.zyx@gmail.com> | 2019-12-31 05:36:51 +0300 |
commit | 546fb9345bd722cf46bd1b705b22ae839d9684e2 (patch) | |
tree | 6052d040229a0a3f97a6d2e04da8cf0428466fa9 | |
parent | 94e9e3a2beefd7880e29a2055501a01de34dfcf8 (diff) | |
parent | 01a94577a4481398008925dbd1ecb124a96aee03 (diff) |
Merge branch 'master' of https://github.com/xiaoheiAh/hugo-theme-pure
-rw-r--r-- | exampleSite/config.yml | 12 | ||||
-rw-r--r-- | layouts/_default/category.html | 2 | ||||
-rw-r--r-- | layouts/_default/list.html | 6 | ||||
-rw-r--r-- | layouts/partials/item-post.html | 5 | ||||
-rw-r--r-- | layouts/partials/post/date.html | 4 | ||||
-rw-r--r-- | static/css/style.css | 6 |
6 files changed, 23 insertions, 12 deletions
diff --git a/exampleSite/config.yml b/exampleSite/config.yml index 8868dab..32d16c9 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -21,7 +21,7 @@ outputFormats: # use for search. recommend not to modify baseName: "searchindex" isPlainText: true notAlternative: true - + outputs: home: ["HTML","RSS","SearchIndex"] # recommend not to modify # sitemap @@ -34,32 +34,32 @@ menu: main: - identifier: home name: Home - title: Home + title: Home url: / weight: 1 - identifier: archives name: Archives title: Archives - url: /posts + url: /posts/ weight: 2 - identifier: categories name: Categories title: Categories - url: /categories + url: /categories/ weight: 3 - identifier: tags name: Tags title: Tags - url: /tags + url: /tags/ weight: 4 - identifier: about name: About title: About - url: /about + url: /about/ weight: 5 diff --git a/layouts/_default/category.html b/layouts/_default/category.html index fb5ae98..379c32a 100644 --- a/layouts/_default/category.html +++ b/layouts/_default/category.html @@ -7,7 +7,7 @@ <p class="text-muted hidden-xs">{{- T "total_category" (len $categories) }}</p> <nav role="navigation" id="nav-main" class="okayNav"> <ul> - <li><a href="{{- "categories" | relURL }}">{{- T "nav_all" }}</a></li> + <li><a href="{{- "categories/" | relURL }}">{{- T "nav_all" }}</a></li> {{- range $categories }} <li><a href="{{ .Page.Permalink }}">{{ .Page.Title }}</a></li> {{- end }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 794da11..767cbd3 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -3,11 +3,11 @@ <article class="content article article-archives article-type-list" itemscope=""> <header class="article-header"> <h1 itemprop="title">{{ .Title }}</h1> - <p class="text-muted">{{- T "total_article" (len .RegularPages) }}</p> + <p class="text-muted">{{- T "total_article" (len .Site.RegularPages) }}</p> </header> <div class="article-body"> {{- $currentYearSection := 0}} - {{- range $idx,$page := .RegularPages}} + {{- range $idx,$page := .Site.RegularPages}} {{- $thisYear := $page.Date.Format ("2006") }} {{- if eq $currentYearSection 0 }} {{- $currentYearSection = $thisYear}} @@ -37,4 +37,4 @@ </div> </article> </main> -{{- end }}
\ No newline at end of file +{{- end }} diff --git a/layouts/partials/item-post.html b/layouts/partials/item-post.html index d7a58a3..cc289d2 100644 --- a/layouts/partials/item-post.html +++ b/layouts/partials/item-post.html @@ -1,5 +1,8 @@ <a href="{{- .Permalink }}" class="collection-item" itemprop="url" target="_blank" > <time datetime="{{ .Date }}" - itemprop="datePublished">{{- .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}</time> + itemprop="datePublished"> + {{ if .Date }} + {{- .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }} + {{ end }}</time> <span> </span> {{- .Title }} </a>
\ No newline at end of file diff --git a/layouts/partials/post/date.html b/layouts/partials/post/date.html index e24600f..b440287 100644 --- a/layouts/partials/post/date.html +++ b/layouts/partials/post/date.html @@ -1,6 +1,8 @@ +{{ if .Date }} <span class="article-date"> <i class="icon icon-calendar-check"></i> <a href="{{- .Permalink }}" class="{{ .Scratch.Get "class_name" }}"> <time datetime="{{ .Date }}" itemprop="datePublished">{{- .Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }}</time> </a> -</span>
\ No newline at end of file +</span> +{{ end }}
\ No newline at end of file diff --git a/static/css/style.css b/static/css/style.css index f642324..02930ad 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -9433,3 +9433,9 @@ body.okayNav-loaded { max-height: 200px; } } + +/* Assures listing in categories indentiation is consistent */ +time { + width: 10ch; + display: inline-block; +}
\ No newline at end of file |