Date: Mon, 1 Feb 2021 01:09:51 GMT From: Allan Jude <allanjude@FreeBSD.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org Subject: git: bc185da8de - main - Improve the documentation front page with full book/article names Message-ID: <202102010109.11119pOY087266@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by allanjude: URL: https://cgit.FreeBSD.org/doc/commit/?id=bc185da8de5102c574e6dccbe3559591027a2d46 commit bc185da8de5102c574e6dccbe3559591027a2d46 Author: Allan Jude <allanjude@FreeBSD.org> AuthorDate: 2021-01-31 19:39:20 +0000 Commit: Allan Jude <allanjude@FreeBSD.org> CommitDate: 2021-02-01 01:09:37 +0000 Improve the documentation front page with full book/article names Use the title of the book or article rather than the directory name Also use the full name of the language, not just the short code Sponsored by: Klara Inc. Reviewed by: carlavilla Differential Revision: https://reviews.freebsd.org/D28440 --- documentation/themes/beastie/layouts/index.html | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/documentation/themes/beastie/layouts/index.html b/documentation/themes/beastie/layouts/index.html index e7c72d5ee3..1ba57c710a 100644 --- a/documentation/themes/beastie/layouts/index.html +++ b/documentation/themes/beastie/layouts/index.html @@ -19,15 +19,13 @@ </ul> </li> </ul> - <h1 class="books-title">{{ i18n "books" }} - {{ $home.Language }}</h1> + <h1 class="books-title">{{ i18n "books" }} - {{ $home.Language.LanguageName }}</h1> {{ $books := slice}} {{ range where .Site.Pages "Section" "books" }} - {{ with .File }} - {{ $subDirsNumer := .File.Path | strings.Count "/" }} - {{ if eq $subDirsNumer 2 }} - {{ $books = $books | append (dict "page" . "path" .File.Path) }} - {{ end }} + {{ $subDirsNumer := .File.Path | strings.Count "/" }} + {{ if eq $subDirsNumer 2 }} + {{ $books = $books | append (dict "page" . "path" .File.Path) }} {{ end }} {{ end }} @@ -36,20 +34,18 @@ {{ if in .path "_index.adoc" }} {{ $bookPath := replaceRE "/_index.adoc" "" .path }} {{ $bookName := replaceRE "books/" "" $bookPath }} - <li><a href="{{ $bookPath }}">{{ $bookName }}</a></li> + <li><a href="{{ $bookPath }}">{{ .page.Title }}</a></li> {{ end }} {{ end }} </ul> - <h1 class="articles-title">{{ i18n "articles" }} - {{ $home.Language }}</h1> + <h1 class="articles-title">{{ i18n "articles" }} - {{ $home.Language.LanguageName }}</h1> {{ $articles := slice}} {{ range where .Site.Pages "Section" "articles" }} - {{ with .File }} - {{ $subDirsNumer := .File.Path | strings.Count "/" }} - {{ if eq $subDirsNumer 2 }} - {{ $articles = $articles | append (dict "page" . "path" .File.Path) }} - {{ end }} + {{ $subDirsNumer := .File.Path | strings.Count "/" }} + {{ if eq $subDirsNumer 2 }} + {{ $articles = $articles | append (dict "page" . "path" .File.Path) }} {{ end }} {{ end }} @@ -58,7 +54,7 @@ {{ if in .path "_index.adoc" }} {{ $articlePath := replaceRE "/_index.adoc" "" .path }} {{ $articleName := replaceRE "articles/" "" $articlePath }} - <li><a href="{{ $articlePath }}">{{ $articleName }}</a></li> + <li><a href="{{ $articlePath }}">{{ .page.Title }}</a></li> {{ end }} {{ end }} </ul>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202102010109.11119pOY087266>