From: Alekos Filini Date: Wed, 18 Nov 2020 18:12:20 +0000 (+0100) Subject: Show author on blogposts, fix layouts X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/scripts/struct.CompactTarget.html?a=commitdiff_plain;h=50741d637d7e8f6e91e6143039f0851c81e91555;p=bitcoindevkit.org Show author on blogposts, fix layouts --- diff --git a/layouts/partials/header.html b/layouts/partials/header.html new file mode 100644 index 0000000000..3e9a7783b8 --- /dev/null +++ b/layouts/partials/header.html @@ -0,0 +1,121 @@ + + + + + + + + {{ hugo.Generator }} + {{ partial "meta.html" . }} + {{ partial "favicon.html" . }} + {{ .Title }} {{ default "::" .Site.Params.titleSeparator }} {{ .Site.Title }} + + {{ $assetBusting := not .Site.Params.disableAssetsBusting }} + + + + + + + + + + {{with .Site.Params.themeVariant}} + + {{end}} + {{ range .Site.Params.custom_css -}} + + {{- end }} + + + + + {{ partial "custom-header.html" . }} + + + {{ partial "menu.html" . }} +
+
+
+ {{if not .IsHome}} +
+
+ {{ if and (or .IsPage .IsSection) .Site.Params.editURL }} + {{ $File := .File }} + {{ $Site := .Site }} + {{with $File.Path }} + + {{ end }} + {{ end }} + {{$toc := (and (not .Params.disableToc) (not .Params.chapter))}} + + {{ if $toc }} + {{ partial "toc.html" . }} + {{ end }} +
+
+ {{ end }} +
+ {{ partial "tags.html" . }} +
+ {{ if .Params.chapter }} +
+ {{ end }} +
+ {{if and (not .IsHome) (not .Params.chapter) }} + {{ if (eq .Type "blog") }} +

{{ .Title }}

+ {{ if isset .Params "author" }} + By {{ .Params.author }} +
+ {{ end }} + {{ else }} +

+ {{ if or (eq .Kind "taxonomy") (eq .Kind "term") }} + {{.Data.Singular}} :: + {{ end }} + {{.Title}} +

+ {{ end }} + {{end}} + + {{define "breadcrumb"}} + {{$parent := .page.Parent }} + {{ if $parent }} + {{ $value := (printf "%s > %s" $parent.RelPermalink $parent.Title .value) }} + {{ template "breadcrumb" dict "page" $parent "value" $value }} + {{else}} + {{.value|safeHTML}} + {{end}} + {{end}} diff --git a/layouts/partials/menu.html b/layouts/partials/menu.html new file mode 100644 index 0000000000..551b63c2cb --- /dev/null +++ b/layouts/partials/menu.html @@ -0,0 +1,155 @@ + + + + + + +{{ define "section-tree-nav" }} +{{ $showvisitedlinks := .showvisitedlinks }} +{{ $currentNode := .currentnode }} +{{ $currentFileUniqueID := "" }} +{{ with $currentNode.File }}{{ $currentFileUniqueID = .UniqueID }}{{ end }} + {{with .sect}} + {{if and .IsSection (or (not .Params.hidden) $.showhidden)}} + {{safeHTML .Params.head}} +
  • + + {{safeHTML .Params.Pre}}{{or .Params.menuTitle .LinkTitle .Title}}{{safeHTML .Params.Post}} + {{ if $showvisitedlinks}} + + {{ end }} + + {{ $numberOfPages := (add (len ( where .Pages "Params.hidden" "ne" true )) (len ( where .Sections "Params.hidden" "ne" true ))) }} + {{ if ne $numberOfPages 0 }} +
      + {{ $currentNode.Scratch.Set "pages" .Pages }} + {{ if .Sections}} + {{ $currentNode.Scratch.Set "pages" (.Pages | union .Sections) }} + {{end}} + {{ $pages := ($currentNode.Scratch.Get "pages") }} + + {{if eq .Site.Params.ordersectionsby "title"}} + {{ range $pages.ByTitle }} + {{ if and .Params.hidden (not $.showhidden) }} + {{else}} + {{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks }} + {{end}} + {{ end }} + {{else}} + {{ range $pages.ByWeight }} +
    • {{ .Pages }}
    • + {{ if and .Params.hidden (not $.showhidden) }} + {{else}} + {{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode "showvisitedlinks" $showvisitedlinks }} + {{end}} + {{ end }} + {{end}} +
    + {{ end }} +
  • + {{else}} + {{ if not .Params.Hidden }} +
  • + + {{safeHTML .Params.Pre}}{{or .Params.menuTitle .LinkTitle .Title}}{{safeHTML .Params.Post}} + {{ if $showvisitedlinks}}{{end}} + +
  • + {{ end }} + {{end}} + {{ end }} +{{ end }} diff --git a/static/css/blog.css b/static/css/blog.css index fe479652a8..b0c60eda8e 100644 --- a/static/css/blog.css +++ b/static/css/blog.css @@ -1,3 +1,18 @@ +h1.blog-title { + margin-top: 0; + margin-bottom: 0; +} + +span.blog-author { + font-weight: bolder; + font-size: 1.2em; +} + +div.tags { + display: flex; + justify-content: center; +} + h3.blog-post { display: flex; align-items: center; @@ -16,6 +31,10 @@ span.blog-post-tags { } a.tag-link::before { - left: calc(-1em + 0.5px) !important; - top: 0.5px !important; + width: 1em !important; + height: 2em !important; +} + +a.tag-link { + border-radius: 1px 3px 3px 1px !important; } diff --git a/themes/learn b/themes/learn index 023fe7ef2b..ae732f3931 160000 --- a/themes/learn +++ b/themes/learn @@ -1 +1 @@ -Subproject commit 023fe7ef2b4c45fe66ac932d9e25d09f30b74a4e +Subproject commit ae732f39317e4619770bc086e08ac21a256fa0e3