diff options
author | Franck Cuny <franck@fcuny.net> | 2021-04-22 12:44:27 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2021-04-22 12:44:27 -0700 |
commit | ef3fa6ba26fcf11fdd2325764147f56c90b94a7b (patch) | |
tree | 4da9b40592d68d96f24c188cded6853c0f8b77bd /users/fcuny/blog/layouts/partials | |
parent | toml: re-configure markup (diff) | |
download | world-ef3fa6ba26fcf11fdd2325764147f56c90b94a7b.tar.gz |
layout: add a navbar
I want to differentiate blog's entries from more general notes. For this, we create two menu entries, and add a navbar at the top. The nav bar let us select between the two kind of articles: blogs or notes. For now we have a single blog entry, and no notes. The page to list entries is simplified: we use the same layout for all lists (tags, notes, blogs). The CSS is updated to support the new nav bar.
Diffstat (limited to '')
-rw-r--r-- | users/fcuny/blog/layouts/partials/header.html | 15 | ||||
-rw-r--r-- | users/fcuny/blog/layouts/partials/postlist.html | 20 |
2 files changed, 16 insertions, 19 deletions
diff --git a/users/fcuny/blog/layouts/partials/header.html b/users/fcuny/blog/layouts/partials/header.html new file mode 100644 index 0000000..f918823 --- /dev/null +++ b/users/fcuny/blog/layouts/partials/header.html @@ -0,0 +1,15 @@ +<header> + <nav> + <a href="{{ .Site.Home.Permalink }}">{{ .Site.Home.Title }}</a> + <ul> + {{ $currentPage := . }} + {{ range .Site.Menus.main }} + <li> + <a class='{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }}menu-active{{ end }}' href="{{ absURL .URL }}"> + {{ .Title }} + </a> + </li> + {{ end }} + </ul> + </nav> +</header> diff --git a/users/fcuny/blog/layouts/partials/postlist.html b/users/fcuny/blog/layouts/partials/postlist.html index 3695d82..28fd9b2 100644 --- a/users/fcuny/blog/layouts/partials/postlist.html +++ b/users/fcuny/blog/layouts/partials/postlist.html @@ -1,28 +1,10 @@ -<p><a href="/">← Back to Franck's homepage</a></p> - -{{ range .GroupByDate "2006-Jan" }} +{{ range .GroupByDate "2006" }} <h2>{{ .Key }}</h2> <ul> {{ range .Pages.ByDate }} <li> <div> <a href="{{ .Permalink }}"><h3>{{ .Title }}</h3></a> - {{ if .Params.tags }} - <div> - Tags: - {{ range $idx, $tag := .Params.tags }} - <span class="tags"><a href="/tags/{{ $tag | urlize }}/">{{ $tag }}</a></span> - {{ end }} - </div> - {{ else }} - <div></div> - {{ end }} - </div> - <div> - <p> - {{ .Summary }} - <span><a href="{{ .Permalink }}">Read more →</a></span> - </p> </div> </li> {{ end }} |