summaryrefslogtreecommitdiffhomepage
path: root/themes/docsy/layouts/partials
diff options
context:
space:
mode:
authorIan Lewis <ianmlewis@gmail.com>2019-10-18 00:19:24 -0400
committerIan Lewis <ianlewis@google.com>2019-11-13 13:03:16 -0800
commita2b055de52cb90180ad57c26119fe72e61d70494 (patch)
treea156c39ba5e044fa42600a6c2d7ddd7dd91c350c /themes/docsy/layouts/partials
parentcf5b8ec088eac99ede97a6c9e381485695638dee (diff)
Updated to Docsy HEAD
This updates the vendored docsy to https://github.com/google/docsy/tree/1a09abe6d7eaf02e44f79de3eadf8178a3792e81
Diffstat (limited to 'themes/docsy/layouts/partials')
-rw-r--r--themes/docsy/layouts/partials/community_links.html2
-rw-r--r--themes/docsy/layouts/partials/favicons.html4
-rw-r--r--themes/docsy/layouts/partials/footer.html4
-rw-r--r--themes/docsy/layouts/partials/head.html4
-rw-r--r--themes/docsy/layouts/partials/hooks/body-end.html3
-rw-r--r--themes/docsy/layouts/partials/hooks/head-end.html3
-rw-r--r--themes/docsy/layouts/partials/navbar-version-selector.html8
-rw-r--r--themes/docsy/layouts/partials/navbar.html13
-rw-r--r--themes/docsy/layouts/partials/page-meta-links.html12
-rw-r--r--themes/docsy/layouts/partials/scripts.html5
-rw-r--r--themes/docsy/layouts/partials/search-input.html2
-rw-r--r--themes/docsy/layouts/partials/section-index.html29
12 files changed, 75 insertions, 14 deletions
diff --git a/themes/docsy/layouts/partials/community_links.html b/themes/docsy/layouts/partials/community_links.html
index c61c67e35..48d64584a 100644
--- a/themes/docsy/layouts/partials/community_links.html
+++ b/themes/docsy/layouts/partials/community_links.html
@@ -1,6 +1,6 @@
{{ $links := .Site.Params.links }}
-<section class="row td-box td-box--4 td-box--gradient td-box--height-auto">
+<section class="row td-box td-box--4 td-box--gradient td-box--height-auto linkbox">
<div class="col-xs-12 col-sm-6 col-md-6 col-lg-6">
<h2>Learn and Connect</h2>
<p>Using or want to use {{ .Site.Title }}? Find out more here:
diff --git a/themes/docsy/layouts/partials/favicons.html b/themes/docsy/layouts/partials/favicons.html
index 43e5c9032..43897755e 100644
--- a/themes/docsy/layouts/partials/favicons.html
+++ b/themes/docsy/layouts/partials/favicons.html
@@ -7,6 +7,6 @@
<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-96x196.png" | relURL }}" sizes="96x196">
+<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="icon" type="image/png" href="{{ "favicons/android-192x192.png" | relURL }}" sizes="192x192">
diff --git a/themes/docsy/layouts/partials/footer.html b/themes/docsy/layouts/partials/footer.html
index d05eeb48a..dfb1f64d7 100644
--- a/themes/docsy/layouts/partials/footer.html
+++ b/themes/docsy/layouts/partials/footer.html
@@ -18,7 +18,7 @@
</div>
<div class="col-12 col-sm-4 text-center py-2 order-sm-2">
{{ with .Site.Params.copyright }}<small class="text-white">&copy; {{ now.Year}} {{ .}} {{ T "footer_all_rights_reserved" }}</small>{{ end }}
- {{ with .Site.Params.privacy_policy }}<small class="ml-1"><a href="{{ . }}">{{ T "footer_privacy_policy" }}</a></small>{{ end }}
+ {{ with .Site.Params.privacy_policy }}<small class="ml-1"><a href="{{ . }}" target="_blank">{{ T "footer_privacy_policy" }}</a></small>{{ end }}
{{ if not .Site.Params.ui.footer_about_disable }}
{{ with .Site.GetPage "about" }}<p class="mt-2"><a href="{{ .RelPermalink }}">{{ .Title }}</a></p>{{ end }}
{{ end }}
@@ -29,7 +29,7 @@
{{ define "footer-links-block" }}
<ul class="list-inline mb-0">
{{ range . }}
- <li class="list-inline-item mx-2 h3" data-toggle="tooltip" data-placement="top" title="{{ .name }}">
+ <li class="list-inline-item mx-2 h3" data-toggle="tooltip" data-placement="top" title="{{ .name }}" aria-label="{{ .name }}">
<a class="text-white" target="_blank" href="{{ .url }}">
<i class="{{ .icon }}"></i>
</a>
diff --git a/themes/docsy/layouts/partials/head.html b/themes/docsy/layouts/partials/head.html
index cb0375720..303eb8b8f 100644
--- a/themes/docsy/layouts/partials/head.html
+++ b/themes/docsy/layouts/partials/head.html
@@ -1,6 +1,6 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
-{{ .Hugo.Generator }}
+{{ hugo.Generator }}
{{ if eq (getenv "HUGO_ENV") "production" }}
<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW">
{{ else }}
@@ -23,4 +23,4 @@
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
-{{ partial "hooks/head-end.html" . }} \ No newline at end of file
+{{ partial "hooks/head-end.html" . }}
diff --git a/themes/docsy/layouts/partials/hooks/body-end.html b/themes/docsy/layouts/partials/hooks/body-end.html
index e69de29bb..3e09f7aa1 100644
--- a/themes/docsy/layouts/partials/hooks/body-end.html
+++ b/themes/docsy/layouts/partials/hooks/body-end.html
@@ -0,0 +1,3 @@
+{{ with .Site.Params.algolia_docsearch }}
+<!-- scripts for algolia docsearch -->
+{{ end }} \ No newline at end of file
diff --git a/themes/docsy/layouts/partials/hooks/head-end.html b/themes/docsy/layouts/partials/hooks/head-end.html
index e69de29bb..e25d67d4b 100644
--- a/themes/docsy/layouts/partials/hooks/head-end.html
+++ b/themes/docsy/layouts/partials/hooks/head-end.html
@@ -0,0 +1,3 @@
+{{ with .Site.Params.algolia_docsearch }}
+<!-- stylesheet for algolia docsearch -->
+{{ end }} \ No newline at end of file
diff --git a/themes/docsy/layouts/partials/navbar-version-selector.html b/themes/docsy/layouts/partials/navbar-version-selector.html
new file mode 100644
index 000000000..6ac1ef63e
--- /dev/null
+++ b/themes/docsy/layouts/partials/navbar-version-selector.html
@@ -0,0 +1,8 @@
+<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
+ {{ .Site.Params.version_menu }}
+</a>
+<div class="dropdown-menu" aria-labelledby="navbarDropdownMenuLink">
+ {{ range .Site.Params.versions }}
+ <a class="dropdown-item" href="{{ .url }}">{{ .version }}</a>
+ {{ end }}
+</div>
diff --git a/themes/docsy/layouts/partials/navbar.html b/themes/docsy/layouts/partials/navbar.html
index 5ed33d097..284283b3c 100644
--- a/themes/docsy/layouts/partials/navbar.html
+++ b/themes/docsy/layouts/partials/navbar.html
@@ -1,7 +1,7 @@
{{ $cover := .HasShortcode "blocks/cover" }}
<nav class="js-navbar-scroll navbar navbar-expand navbar-dark {{ if $cover}} td-navbar-cover {{ end }}flex-column flex-md-row td-navbar">
- <a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}">
- <span class="navbar-logo">{{ with resources.Get "icons/logo.svg" }}{{ ( . | minify).Content | safeHTML }} {{ end }}</span><span class="text-uppercase font-weight-bold">{{ .Site.Title }}</span>
+ <a class="navbar-brand" href="{{ .Site.Home.RelPermalink }}">
+ <span class="navbar-logo">{{ if .Site.Params.ui.navbar_logo }}{{ with resources.Get "icons/logo.svg" }}{{ ( . | minify).Content | safeHTML }}{{ end }}{{ end }}</span><span class="text-uppercase font-weight-bold">{{ .Site.Title }}</span>
</a>
<div class="td-navbar-nav-scroll ml-md-auto" id="main_navbar">
<ul class="navbar-nav mt-2 mt-lg-0">
@@ -12,7 +12,14 @@
{{ with .Page }}
{{ $active = or $active ( $.IsDescendant .) }}
{{ end }}
- <a class="nav-link{{if $active }} active{{end}}" href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}"><span{{if $active }} class="active"{{end}}>{{ .Name }}</span></a>
+ {{ $url := urls.Parse .URL }}
+ {{ $baseurl := urls.Parse $.Site.Params.Baseurl }}
+ <a class="nav-link{{if $active }} active{{end}}" href="{{ with .Page }}{{ .RelPermalink }}{{ else }}{{ .URL | relLangURL }}{{ end }}" {{ if ne $url.Host $baseurl.Host }}target="_blank" {{ end }}><span{{if $active }} class="active"{{end}}>{{ .Name }}</span></a>
+ </li>
+ {{ end }}
+ {{ if .Site.Params.versions }}
+ <li class="nav-item dropdown d-none d-lg-block">
+ {{ partial "navbar-version-selector.html" . }}
</li>
{{ end }}
{{ if (gt (len .Site.Home.Translations) 0) }}
diff --git a/themes/docsy/layouts/partials/page-meta-links.html b/themes/docsy/layouts/partials/page-meta-links.html
index 0f18b1e37..8e2650f81 100644
--- a/themes/docsy/layouts/partials/page-meta-links.html
+++ b/themes/docsy/layouts/partials/page-meta-links.html
@@ -1,14 +1,24 @@
{{ if .Path }}
{{ $gh_repo := ($.Param "github_repo") }}
+{{ $gh_subdir := ($.Param "github_subdir") }}
+{{ $gh_project_repo := ($.Param "github_project_repo") }}
{{ if $gh_repo }}
<div class="td-page-meta ml-2 pb-1 pt-2 mb-0">
{{ $editURL := printf "%s/edit/master/content/%s" $gh_repo .Path }}
-{{ if .Site.IsMultiLingual }}
+{{ if and ($gh_subdir) (.Site.Language.Lang) }}
+{{ $editURL = printf "%s/edit/master/%s/content/%s/%s" $gh_repo $gh_subdir ($.Site.Language.Lang) $.Path }}
+{{ else if .Site.Language.Lang }}
{{ $editURL = printf "%s/edit/master/content/%s/%s" $gh_repo ($.Site.Language.Lang) .Path }}
+{{ else if $gh_subdir }}
+{{ $editURL = printf "%s/edit/master/%s/content/%s" $gh_repo $gh_subdir $.Path }}
{{ end }}
{{ $issuesURL := printf "%s/issues/new?title=%s" $gh_repo (htmlEscape $.Title )}}
<a href="{{ $editURL }}" target="_blank"><i class="fa fa-edit fa-fw"></i> {{ T "post_edit_this" }}</a>
<a href="{{ $issuesURL }}" target="_blank"><i class="fab fa-github fa-fw"></i> {{ T "post_create_issue" }}</a>
+{{ if $gh_project_repo }}
+{{ $project_issueURL := printf "%s/issues/new" $gh_project_repo }}
+<a href="{{ $project_issueURL }}" target="_blank"><i class="fas fa-tasks fa-fw"></i> {{ T "post_create_project_issue" }}</a>
+{{ end }}
</div>
{{ end }}
{{ end }}
diff --git a/themes/docsy/layouts/partials/scripts.html b/themes/docsy/layouts/partials/scripts.html
index 7267b3393..cc8dc071e 100644
--- a/themes/docsy/layouts/partials/scripts.html
+++ b/themes/docsy/layouts/partials/scripts.html
@@ -2,12 +2,13 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
{{ $jsBase := resources.Get "js/base.js" }}
+{{ $jsAnchor := resources.Get "js/anchor.js" }}
{{ $jsSearch := resources.Get "js/search.js" | resources.ExecuteAsTemplate "js/search.js" .Site.Home }}
-{{ $js := (slice $jsBase $jsSearch) | resources.Concat "js/main.js" }}
+{{ $js := (slice $jsBase $jsAnchor $jsSearch) | resources.Concat "js/main.js" }}
{{ if .Site.IsServer }}
<script src="{{ $js.RelPermalink }}"></script>
{{ else }}
{{ $js := $js | minify | fingerprint }}
-<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}"></script>
+<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}" crossorigin="anonymous"></script>
{{ end }}
{{ partial "hooks/body-end.html" . }}
diff --git a/themes/docsy/layouts/partials/search-input.html b/themes/docsy/layouts/partials/search-input.html
index 883ca3c3a..ee82a6988 100644
--- a/themes/docsy/layouts/partials/search-input.html
+++ b/themes/docsy/layouts/partials/search-input.html
@@ -1,3 +1,3 @@
-{{ with .Site.Params.gcs_engine_id }}
+{{ with or .Site.Params.gcs_engine_id .Site.Params.algolia_docsearch }}
<input type="search" class="form-control td-search-input" placeholder="&#xf002 {{ T "ui_search" }}" aria-label="{{ T "ui_search" }}" autocomplete="off">
{{ end }} \ No newline at end of file
diff --git a/themes/docsy/layouts/partials/section-index.html b/themes/docsy/layouts/partials/section-index.html
new file mode 100644
index 000000000..be3cbcd9c
--- /dev/null
+++ b/themes/docsy/layouts/partials/section-index.html
@@ -0,0 +1,29 @@
+<div class="section-index">
+ {{ $pages := (where .Site.Pages "Section" .Section).ByWeight }}
+ {{ $parent := .Page }}
+ {{ if $parent.Params.no_list }}
+ {{/* If no_list is true we don't show a list of subpages */}}
+ {{ else if $parent.Params.simple_list }}
+ {{/* If simple_list is true we show a bulleted list of subpages */}}
+ <ul>
+ {{ range $pages }}
+ {{ if eq .Parent $parent }}
+ <li><a href="{{ .RelPermalink }}">{{- .Title -}}</a></li>
+ {{ end }}
+ {{ end }}
+ </ul>
+ {{ else }}
+ {{/* Otherwise we show a nice formatted list of subpages with page descriptions */}}
+ <hr class="panel-line">
+ {{ range $pages }}
+ {{ if eq .Parent $parent }}
+ <div class="entry">
+ <h5>
+ <a href="{{ .RelPermalink }}">{{- .Title -}}</a>
+ </h5>
+ <p>{{ .Description | markdownify }}</p>
+ </div>
+ {{ end }}
+ {{ end }}
+ {{ end }}
+</div>