Created
September 6, 2022 09:45
-
-
Save dholbach/8bef68721db91a4ea874a6975d27902d to your computer and use it in GitHub Desktop.
Diff over Docsy partials
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ru themes/docsy/layouts/404.html layouts/404.html | |
--- themes/docsy/layouts/404.html 2022-09-05 16:20:48.000000000 +0200 | |
+++ layouts/404.html 2022-02-07 14:57:17.873525067 +0100 | |
@@ -1,6 +1,37 @@ | |
-{{ define "main" -}} | |
-<div class="td-content"> | |
- <h1>Not found</h1> | |
- <p>Oops! This page doesn't exist. Try going back to the <a href="{{ "" | relURL }}">home page</a>.</p> | |
-</div> | |
-{{- end }} | |
+{{ define "main"}} | |
+<main id="main"> | |
+ <div class="d-flex justify-content-center"> | |
+ <div class="page404"> | |
+ <h1 id="title">Sorry, page not found ... 🤷</h1> | |
+ <h3>Were you looking for?</h3> | |
+ <div class="links404"> | |
+ <a href="/docs">Documentation</a> | |
+ <a href="/blog">Blog</a> | |
+ <a href="/support">Support</a> | |
+ <a href="/roadmap">Roadmap</a> | |
+ </div> | |
+ | |
+ <div class="search404"> | |
+ <h3>Something else...</h3> | |
+ <div> | |
+ <input type="search" class="form-control search-404-input" | |
+ aria-label="{{ T "ui_search" }}" | |
+ autocomplete="off"> | |
+ </div> | |
+ </div> | |
+ </div> | |
+ </div> | |
+</main> | |
+ | |
+<script defer type="text/javascript"> | |
+ $(function() { | |
+ const docsearch = docsearchInit('.search-404-input'); | |
+ const ac = docsearch.autocomplete.autocomplete | |
+ | |
+ let algoliaQuery = document.location.pathname.replace(/\.\w+/, '').replace(/\W/g, ' ').trim(); | |
+ ac.setVal(algoliaQuery); | |
+ ac.open(); | |
+ }); | |
+</script> | |
+ | |
+{{ end }} | |
diff -ru themes/docsy/layouts/blog/baseof.html layouts/blog/baseof.html | |
--- themes/docsy/layouts/blog/baseof.html 2022-09-05 16:20:48.000000000 +0200 | |
+++ layouts/blog/baseof.html 2022-09-06 11:37:26.400549399 +0200 | |
@@ -24,6 +24,9 @@ | |
<i class="fa-solid fa-rss" aria-hidden="true"></i> | |
</a> | |
{{ end -}} | |
+ {{ block "deprecated" . }} | |
+ {{ partial "deprecation-warning.html" . }} | |
+ {{ end }} | |
{{ block "main" . }}{{ end }} | |
</main> | |
</div> | |
diff -ru themes/docsy/layouts/blog/list.html layouts/blog/list.html | |
--- themes/docsy/layouts/blog/list.html 2022-09-05 16:20:48.000000000 +0200 | |
+++ layouts/blog/list.html 2022-09-06 10:43:38.165915203 +0200 | |
@@ -8,15 +8,15 @@ | |
<div class="row"> | |
<div class="col-12"> | |
{{- if .Pages -}} | |
- {{ $pag := .Paginate (( $.Scratch.Get "blog-pages").GroupByDate "2006" "asc" )}} | |
+ {{ $pag := .Paginate (( $.Scratch.Get "blog-pages").GroupByDate "2006")}} | |
{{ range $pag.PageGroups }} | |
<h2>{{ T "post_posts_in" }} {{ .Key }}</h2> | |
<ul class="list-unstyled mt-4"> | |
{{ range .Pages }} | |
- <li class="media mb-4"> | |
+ <li class="media mb-5"> | |
<div class="media-body"> | |
<h5 class="mt-0 mb-1"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h5> | |
- <p class="mb-2 mb-md-3"><small class="text-muted">{{ .Date.Format ($.Param "time_format_blog") }} {{ T "ui_in"}} {{ .CurrentSection.LinkTitle }}</small></p> | |
+ <p class="mt-0 mb-1"><small class="text-muted">{{ .Date.Format ($.Param "time_format_blog") }} {{ T "ui_in"}} {{ .CurrentSection.LinkTitle }}</small></p> | |
<header class="article-meta"> | |
{{ partial "taxonomy_terms_article_wrapper.html" . }} | |
{{ if (and (not .Params.hide_readingtime) (.Site.Params.ui.readingtime.enable)) }} | |
@@ -24,8 +24,13 @@ | |
{{ end }} | |
</header> | |
{{ partial "featured-image.html" (dict "p" . "w" 250 "h" 125 "class" "float-left mr-3 pt-1 d-none d-md-block") }} | |
- <p class="pt-0 mt-0">{{ .Plain | safeHTML | truncate 250 }}</p> | |
+ <p class="mb-md-2"><small class="text-muted">tl;dr: {{ .Description }}</small></p> | |
+ <p class="mb-2 mb-md-3"> | |
+ {{ .Plain | safeHTML | truncate 400 }} | |
+ </p> | |
+ {{ if .Truncated }} | |
<p class="pt-0"><a href="{{ .RelPermalink }}" aria-label="{{ T "ui_read_more"}} - {{ .LinkTitle }}">{{ T "ui_read_more"}}</a></p> | |
+ {{ end }} | |
</div> | |
</li> | |
{{ end }} | |
diff -ru themes/docsy/layouts/docs/baseof.html layouts/docs/baseof.html | |
--- themes/docsy/layouts/docs/baseof.html 2022-09-05 16:20:48.000000000 +0200 | |
+++ layouts/docs/baseof.html 2022-07-13 14:38:55.458396587 +0200 | |
@@ -13,14 +13,28 @@ | |
<aside class="col-12 col-md-3 col-xl-2 td-sidebar d-print-none"> | |
{{ partial "sidebar.html" . }} | |
</aside> | |
+ {{ if not .Params.hugeTable }} | |
<aside class="d-none d-xl-block col-xl-2 td-sidebar-toc d-print-none"> | |
{{ partial "page-meta-links.html" . }} | |
{{ partial "toc.html" . }} | |
+<!-- | |
+ Disabling because of https://github.com/google/docsy/issues/38 | |
+ | |
+ Essentially there is just one set of tags across /docs and /blog | |
+ So for now we disable showing the tag cloud, etc in our documentation. | |
+ | |
{{ partial "taxonomy_terms_clouds.html" . }} | |
+--> | |
</aside> | |
+ {{ end }} | |
+ {{ if not .Params.hugeTable }} | |
<main class="col-12 col-md-9 col-xl-8 pl-md-5" role="main"> | |
+ {{ else }} | |
+ <main class="col-12 col-md-12 col-xl-10 pl-md-5 " role="main"> | |
+ {{ end }} | |
{{ partial "version-banner.html" . }} | |
{{ if not .Site.Params.ui.breadcrumb_disable }}{{ partial "breadcrumb.html" . }}{{ end }} | |
+ {{ if in .Permalink "/legacy" }}{{ partial "docs/legacy-warning.html" }}{{ end }} | |
{{ block "main" . }}{{ end }} | |
</main> | |
</div> | |
diff -ru themes/docsy/layouts/partials/favicons.html layouts/partials/favicons.html | |
--- themes/docsy/layouts/partials/favicons.html 2022-09-05 16:20:48.000000000 +0200 | |
+++ layouts/partials/favicons.html 2022-08-17 11:19:04.174682808 +0200 | |
@@ -1,12 +1,11 @@ | |
- | |
-<!-- Favicons as generated by http://cthedot.de/icongen --> | |
-<link rel="shortcut icon" href="{{ "favicons/favicon.ico" | relURL }}" > | |
-<link rel="apple-touch-icon" href="{{ "favicons/apple-touch-icon-180x180.png" | relURL }}" sizes="180x180"> | |
-<link rel="icon" type="image/png" href="{{ "favicons/favicon-16x16.png" | relURL }}" sizes="16x16"> | |
-<link rel="icon" type="image/png" href="{{ "favicons/favicon-32x32.png" | relURL }}" sizes="32x32"> | |
-<link rel="icon" type="image/png" href="{{ "favicons/android-36x36.png" | relURL }}" sizes="36x36"> | |
-<link rel="icon" type="image/png" href="{{ "favicons/android-48x48.png" | relURL }}" sizes="48x48"> | |
-<link rel="icon" type="image/png" href="{{ "favicons/android-72x72.png" | relURL }}" sizes="72x72"> | |
-<link rel="icon" type="image/png" href="{{ "favicons/android-96x96.png" | relURL }}" sizes="96x96"> | |
-<link rel="icon" type="image/png" href="{{ "favicons/android-144x144.png" | relURL }}" sizes="144x144"> | |
-<link rel="icon" type="image/png" href="{{ "favicons/android-192x192.png" | relURL }}" sizes="192x192"> | |
+<link rel="apple-touch-icon" sizes="180x180" href="{{ "/favicons/apple-touch-icon.png" | relURL }}"> | |
+<link rel="icon" type="image/png" sizes="32x32" href="{{ "/favicons/favicon-32x32.png" | relURL }}"> | |
+<link rel="icon" type="image/png" sizes="16x16" href="{{ "/favicons/favicon-16x16.png" | relURL }}"> | |
+<link rel="icon" type="image/svg+xml" href="{{ "/favicons/favicon.svg" | relURL }}"> | |
+<link rel="icon" type="image/png" href="{{ "/favicons/favicon.png" | relURL }}"> | |
+<link rel="manifest" href="{{ "/favicons/site.webmanifest" | relURL }}"> | |
+<link rel="shortcut icon" type="image/x-icon" href="{{ "/favicons/favicon.ico" | relURL }}"/> | |
+<link rel="mask-icon" color="#1a1a1a" href="{{ "/favicons/safari-pinned-tab.svg" | relURL }}"> | |
+<meta name="msapplication-config" content="{{ "/favicons/browserconfig.xml" | relURL }}" /> | |
+<meta name="msapplication-TileColor" content="#1a1a1a"> | |
+<meta name="theme-color" content="#1a1a1a"> | |
diff -ru themes/docsy/layouts/partials/hooks/body-end.html layouts/partials/hooks/body-end.html | |
--- themes/docsy/layouts/partials/hooks/body-end.html 2022-09-05 16:20:48.000000000 +0200 | |
+++ layouts/partials/hooks/body-end.html 2022-07-13 14:38:55.458396587 +0200 | |
@@ -1,3 +1,23 @@ | |
-{{ with .Site.Params.algolia_docsearch }} | |
-<!-- scripts for algolia docsearch --> | |
-{{ end }} | |
\ No newline at end of file | |
+{{ if isset .Site.Params "algolia_docsearch" }} | |
+<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.js"></script> | |
+ | |
+{{ $calendar := resources.Get "js/calendar.js" | js.Build "calendar.js" }} | |
+<script type="text/javascript" src="{{ $calendar.RelPermalink }}" defer></script> | |
+ | |
+<script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3"></script> | |
+<script type="text/javascript"> | |
+ | |
+docsearch({ | |
+ container: '#docsearch', | |
+ apiKey: 'd466984187cbf406354da362d45b8e3f', | |
+ appId: 'Z41T3FAXIU', | |
+ indexName: 'fluxcd', | |
+ {{ if in .Permalink "/legacy" }} | |
+ searchParameters: { 'facetFilters': ['tags:legacy'], }, | |
+ {{ else }} | |
+ searchParameters: { 'facetFilters': ['tags:current'], }, | |
+ {{ end }} | |
+}); | |
+ | |
+</script> | |
+{{ end }} | |
diff -ru themes/docsy/layouts/partials/hooks/head-end.html layouts/partials/hooks/head-end.html | |
--- themes/docsy/layouts/partials/hooks/head-end.html 2022-09-05 16:20:48.000000000 +0200 | |
+++ layouts/partials/hooks/head-end.html 2022-07-13 14:38:55.458396587 +0200 | |
@@ -1,3 +1,8 @@ | |
+{{ if .IsHome }} | |
+{{ partial "asciinema-head.html" . }} | |
+{{ end }} | |
+ | |
{{ with .Site.Params.algolia_docsearch }} | |
-<!-- stylesheet for algolia docsearch --> | |
-{{ end }} | |
\ No newline at end of file | |
+<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3" /> | |
+{{ end }} | |
+ | |
diff -ru themes/docsy/layouts/partials/navbar.html layouts/partials/navbar.html | |
--- themes/docsy/layouts/partials/navbar.html 2022-09-05 16:20:48.000000000 +0200 | |
+++ layouts/partials/navbar.html 2022-09-06 11:37:26.404549346 +0200 | |
@@ -1,36 +1,66 @@ | |
+{{ $logo := "icons/logo.svg" }} | |
+{{ $title := .Site.Title }} | |
+ | |
+{{ if in .Permalink "/flagger" }} | |
+{{ $logo = "icons/flagger.svg" }} | |
+{{ $title = "Flagger" }} | |
+{{ end }} | |
+ | |
{{ $cover := and | |
(.HasShortcode "blocks/cover") | |
(not .Site.Params.ui.navbar_translucent_over_cover_disable) | |
-}} | |
<nav | |
- class="js-navbar-scroll navbar navbar-expand navbar-dark {{ if $cover }}td-navbar-cover{{ end }} flex-column flex-md-row td-navbar"> | |
+ class="js-navbar-scroll navbar-expand-lg navbar navbar-dark {{ if $cover }}td-navbar-cover{{ end }} flex-row td-navbar"> | |
<a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}"> | |
{{- /**/ -}} | |
<span class="navbar-logo"> | |
{{- if .Site.Params.ui.navbar_logo -}} | |
- {{ with resources.Get "icons/logo.svg" -}} | |
+ {{ with resources.Get $logo -}} | |
{{ ( . | minify).Content | safeHTML -}} | |
{{ end -}} | |
{{ end -}} | |
</span> | |
{{- /**/ -}} | |
<span class="font-weight-bold"> | |
- {{- .Site.Title -}} | |
+ {{- $title -}} | |
</span> | |
{{- /**/ -}} | |
</a> | |
- <div class="td-navbar-nav-scroll ml-md-auto" id="main_navbar"> | |
+ <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarContent" aria-controls="navbarContent" aria-expanded="false" aria-label="Toggle navigation"> | |
+ <span class="navbar-toggler-icon"></span> | |
+ </button> | |
+ <div class="collapse navbar-collapse justify-content-end" id="navbarContent"> | |
<ul class="navbar-nav mt-2 mt-lg-0"> | |
+ {{ if .Site.Params.versions -}} | |
+ <li class="nav-item dropdown mr-4"> | |
+ {{ partial "navbar-version-selector.html" . -}} | |
+ </li> | |
+ {{ end -}} | |
{{ $p := . -}} | |
{{ range .Site.Menus.main -}} | |
- <li class="nav-item mr-4 mb-2 mb-lg-0"> | |
{{ $active := or ($p.IsMenuCurrent "main" .) ($p.HasMenuCurrent "main" .) -}} | |
{{ with .Page }}{{ $active = or $active ( $.IsDescendant .) }}{{ end -}} | |
{{ $pre := .Pre -}} | |
{{ $post := .Post -}} | |
{{ $url := urls.Parse .URL -}} | |
{{ $baseurl := urls.Parse $.Site.Params.Baseurl -}} | |
+ | |
+ {{ if .HasChildren }} | |
+ <li class="nav-item dropdown"> | |
+ <a class="nav-link {{if $active }} active{{end}} dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | |
+ {{ .Name }} | |
+ </a> | |
+ <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownMenuLink"> | |
+ {{ range .Children }} | |
+ {{ $childrenurl := urls.Parse .URL }} | |
+ <a class="dropdown-item" href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}" {{ if ne $childrenurl.Host $baseurl.Host }}target="_blank" {{ end }}>{{ .Name }}</a> | |
+ {{ end }} | |
+ </div> | |
+ </li> | |
+ {{ else }} | |
+ <li class="nav-item mr-4 mb-2 mb-lg-0"> | |
<a {{/**/ -}} | |
class="nav-link {{- if $active }} active {{- end }}" {{/**/ -}} | |
href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}" | |
@@ -44,19 +74,15 @@ | |
</a> | |
</li> | |
{{ end -}} | |
- {{ if .Site.Params.versions -}} | |
- <li class="nav-item dropdown mr-4 d-none d-lg-block"> | |
- {{ partial "navbar-version-selector.html" . -}} | |
- </li> | |
- {{ end -}} | |
+ {{ end -}} | |
{{ if (gt (len .Site.Home.Translations) 0) -}} | |
<li class="nav-item dropdown mr-4 d-none d-lg-block"> | |
{{ partial "navbar-lang-selector.html" . -}} | |
</li> | |
{{ end -}} | |
+ <li class="nav-item nav-search-item"> | |
+ {{ partial "search-input.html" . }} | |
+ </li> | |
</ul> | |
</div> | |
- <div class="navbar-nav d-none d-lg-block"> | |
- {{ partial "search-input.html" . }} | |
- </div> | |
-</nav> | |
\ No newline at end of file | |
+</nav> | |
diff -ru themes/docsy/layouts/partials/page-meta-links.html layouts/partials/page-meta-links.html | |
--- themes/docsy/layouts/partials/page-meta-links.html 2022-09-05 16:20:48.000000000 +0200 | |
+++ layouts/partials/page-meta-links.html 2022-09-06 11:37:26.404549346 +0200 | |
@@ -5,6 +5,7 @@ | |
{{ $gh_subdir := ($.Param "github_subdir") -}} | |
{{ $gh_project_repo := ($.Param "github_project_repo") -}} | |
{{ $gh_branch := (default "main" ($.Param "github_branch")) -}} | |
+{{ $importedDoc := $.Param "importedDoc" | default "false" }} | |
<div class="td-page-meta ml-2 pb-1 pt-2 mb-0"> | |
{{ if $gh_url -}} | |
{{ warnf "Warning: use of `github_url` is deprecated. For details see https://www.docsy.dev/docs/adding-content/repository-links/#github_url-optional" -}} | |
@@ -37,9 +38,11 @@ | |
{{ $newPageQS := querify "value" $newPageStub.Content "filename" "change-me.md" | safeURL -}} | |
{{ $newPageURL := printf "%s/new/%s?%s" $gh_repo $gh_repo_path $newPageQS -}} | |
+ {{ if eq $importedDoc "false" }} | |
<a href="{{ $viewURL }}" class="td-page-meta--view" target="_blank" rel="noopener"><i class="fa-solid fa-file-lines fa-fw"></i> {{ T "post_view_this" }}</a> | |
<a href="{{ $editURL }}" class="td-page-meta--edit" target="_blank" rel="noopener"><i class="fa-solid fa-pen-to-square fa-fw"></i> {{ T "post_edit_this" }}</a> | |
<a href="{{ $newPageURL }}" class="td-page-meta--child" target="_blank" rel="noopener"><i class="fa-solid fa-pen-to-square fa-fw"></i> {{ T "post_create_child_page" }}</a> | |
+ {{ end }} | |
<a href="{{ $issuesURL }}" class="td-page-meta--issue" target="_blank" rel="noopener"><i class="fa-solid fa-list-check fa-fw"></i> {{ T "post_create_issue" }}</a> | |
{{ with $gh_project_repo -}} | |
{{ $project_issueURL := printf "%s/issues/new" . -}} | |
diff -ru themes/docsy/layouts/partials/sidebar-tree.html layouts/partials/sidebar-tree.html | |
--- themes/docsy/layouts/partials/sidebar-tree.html 2022-09-05 16:20:48.000000000 +0200 | |
+++ layouts/partials/sidebar-tree.html 2022-07-18 16:19:00.967665638 +0200 | |
@@ -11,7 +11,6 @@ | |
{{ else -}} | |
<div id="content-mobile"> | |
<form class="td-sidebar__search d-flex align-items-center"> | |
- {{ partial "search-input.html" . }} | |
<button class="btn btn-link td-sidebar__toggle d-md-none p-0 ml-3 fas fa-bars" type="button" data-toggle="collapse" data-target="#td-section-nav" aria-controls="td-section-nav" aria-expanded="false" aria-label="Toggle section navigation"> | |
</button> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment