From 0a78ba6856713994d90c75541959e5ac66627d82 Mon Sep 17 00:00:00 2001 From: George Cushen Date: Tue, 22 Jan 2019 18:22:06 +0000 Subject: [PATCH] feat: hide page modification date for talks and publications Having both talk/pub. date and page modification date displayed may cause confusion. Close #891 --- exampleSite/config/_default/languages.toml | 5 ++-- exampleSite/config/_default/params.toml | 2 +- exampleSite/content/privacy.md | 1 + layouts/_default/single.html | 26 ++++++++++--------- layouts/partials/header.html | 2 +- layouts/partials/page_metadata.html | 29 ++++++++++++---------- layouts/publication/single.html | 14 ----------- 7 files changed, 36 insertions(+), 43 deletions(-) diff --git a/exampleSite/config/_default/languages.toml b/exampleSite/config/_default/languages.toml index 7e9925df..72b55a63 100644 --- a/exampleSite/config/_default/languages.toml +++ b/exampleSite/config/_default/languages.toml @@ -9,10 +9,11 @@ # Uncomment the lines below to configure your website in a second language. #[zh] # languageCode = "zh-Hans" +# contentDir = "content/zh" # title = "Chinese website title..." -# [languages.zh.params] +# [zh.params] # description = "Site description in Chinese..." -# [[languages.zh.menu.main]] +# [[zh.menu.main]] # name = "Wo" # url = "#about" # weight = 1 diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index 10984abf..5c90722e 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -49,7 +49,7 @@ highlight = true # highlight_languages = ["r"] # Add support for highlighting additional languages # highlight_style = "github" # For supported styles, see https://cdnjs.com/libraries/highlight.js/ -# Enable native social sharing buttons? +# Enable in-built social sharing buttons? sharing = true # Privacy pack diff --git a/exampleSite/content/privacy.md b/exampleSite/content/privacy.md index 56123fa3..ebea4184 100644 --- a/exampleSite/content/privacy.md +++ b/exampleSite/content/privacy.md @@ -3,6 +3,7 @@ title = "Privacy Policy" date = 2018-06-28T00:00:00 draft = true +share = false # [header] # image = "" diff --git a/layouts/_default/single.html b/layouts/_default/single.html index d97fce16..7554c85a 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -12,19 +12,21 @@ {{ partial "tags.html" . }} - {{ partial "page_author.html" . }} - {{ $related := .Site.RegularPages.Related . | first 5 }} - {{ with $related }} -
-
-

{{ i18n "related" }}

- -
+ {{ if ne .Type "page" }} + {{ partial "page_author.html" . }} + {{ $related := .Site.RegularPages.Related . | first 5 }} + {{ with $related }} +
+
+

{{ i18n "related" }}

+ +
+ {{ end }} {{ end }} {{ if .Site.Params.section_pager }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 4d610953..340a36c9 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -16,7 +16,7 @@ {{ $superuser_role := "" }} {{ range first 1 (where (where $.Site.Pages "Section" "author") "Params.superuser" true) }} {{ $superuser_name = .Params.name }} - {{ $superuser_username = .File.ContentBaseName }} + {{ $superuser_username = delimit (last 1 (split (substr .File.Dir 0 -1) "/")) "" }} {{ $superuser_role = .Params.role }} {{ end }} {{ $scr.Set "superuser_username" $superuser_username }}{{/* For access from page_author.html. */}} diff --git a/layouts/partials/page_metadata.html b/layouts/partials/page_metadata.html index a9761015..0f1ce7d2 100644 --- a/layouts/partials/page_metadata.html +++ b/layouts/partials/page_metadata.html @@ -1,10 +1,15 @@ {{ $is_list := .is_list }} {{ $ := .content }} + + + +
{{/* If `authors` is set and is not empty. */}} {{ if $.Params.authors }} {{ $authorLen := len $.Params.authors }} + {{ if gt $authorLen 0 }}
{{ range $k, $v := $.Params.authors -}}
- {{ else }} - + {{ end }} {{ end }} + {{ if not (in (slice "talk" "page") $.Type) }} - - + + {{ end }} {{ if and (eq $.Type "post") (not (or (eq $.Site.Params.reading_time false) (eq $.Params.reading_time false))) }} diff --git a/layouts/publication/single.html b/layouts/publication/single.html index 79f801bd..959c3d07 100644 --- a/layouts/publication/single.html +++ b/layouts/publication/single.html @@ -45,20 +45,6 @@
{{ end }} -
-
-
-
-
{{ i18n "date" }}
- -
-
-
-
-
-
{{ .Content }}