summaryrefslogtreecommitdiffhomepage
path: root/layouts/partials
diff options
context:
space:
mode:
Diffstat (limited to 'layouts/partials')
-rw-r--r--layouts/partials/footer.html39
-rw-r--r--layouts/partials/head.html27
-rw-r--r--layouts/partials/navbar.html27
-rw-r--r--layouts/partials/page-meta-links.html11
4 files changed, 104 insertions, 0 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
new file mode 100644
index 000000000..b7bbbbdcf
--- /dev/null
+++ b/layouts/partials/footer.html
@@ -0,0 +1,39 @@
+{{ $links := .Site.Params.links }}
+<footer class="bg-dark py-5 row d-print-none">
+ <div class="container-fluid mx-sm-5">
+ <div class="row">
+ <div class="col-6 col-sm-4 text-xs-center order-sm-2">
+ {{ with $links }}
+ {{ with index . "user"}}
+ {{ template "footer-links-block" . }}
+ {{ end }}
+ {{ end }}
+ </div>
+ <div class="col-6 col-sm-4 text-right text-xs-center order-sm-3">
+ {{ with $links }}
+ {{ with index . "developer"}}
+ {{ template "footer-links-block" . }}
+ {{ end }}
+ {{ end }}
+ </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 }}
+ {{ if not .Site.Params.ui.footer_about_disable }}
+ {{ with .Site.GetPage "about" }}<p class="mt-2"><a href="{{ .RelPermalink }}">{{ .Title }}</a></p>{{ end }}
+ {{ end }}
+ </div>
+ </div>
+ </div>
+</footer>
+{{ 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 }}">
+ <a class="text-white" target="_blank" rel="noopener" href="{{ .url }}">
+ <i class="{{ .icon }}"></i>
+ </a>
+ </li>
+ {{ end }}
+</ul>
+{{ end }}
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
new file mode 100644
index 000000000..8edfd47a5
--- /dev/null
+++ b/layouts/partials/head.html
@@ -0,0 +1,27 @@
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
+{{ .Hugo.Generator }}
+{{ if eq (getenv "HUGO_ENV") "production" }}
+<META NAME="ROBOTS" CONTENT="INDEX, FOLLOW">
+{{ else }}
+<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
+{{ end }}
+{{ range .AlternativeOutputFormats -}}
+<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
+{{ end -}}
+{{ partialCached "favicons.html" . }}
+<title>{{ if .IsHome }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }}</title>
+<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end }}">
+{{- template "_internal/opengraph.html" . -}}
+{{- template "_internal/google_news.html" . -}}
+{{- template "_internal/schema.html" . -}}
+{{- template "_internal/twitter_cards.html" . -}}
+{{ if eq (getenv "HUGO_ENV") "production" }}
+{{ template "_internal/google_analytics_async.html" . }}
+{{ end }}
+{{ partialCached "head-css.html" . "asdf" }}
+<script
+ src="https://code.jquery.com/jquery-3.3.1.min.js"
+ integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
+ crossorigin="anonymous"></script>
+{{ partial "hooks/head-end.html" . }}
diff --git a/layouts/partials/navbar.html b/layouts/partials/navbar.html
new file mode 100644
index 000000000..393684b8c
--- /dev/null
+++ b/layouts/partials/navbar.html
@@ -0,0 +1,27 @@
+<!-- Forked from main theme. Not uppercase. -->
+{{ $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="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">
+ {{ $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 }}
+ <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>
+ </li>
+ {{ end }}
+ {{ if (gt (len .Site.Home.Translations) 0) }}
+ <li class="nav-item dropdown d-none d-lg-block">
+ {{ partial "navbar-lang-selector.html" . }}
+ </li>
+ {{ end }}
+ </ul>
+ </div>
+ <div class="navbar-nav d-none d-lg-block">{{ partial "search-input.html" . }}</div>
+</nav>
diff --git a/layouts/partials/page-meta-links.html b/layouts/partials/page-meta-links.html
new file mode 100644
index 000000000..5889313a9
--- /dev/null
+++ b/layouts/partials/page-meta-links.html
@@ -0,0 +1,11 @@
+{{ if .Path }}
+{{ $gh_repo := ($.Param "github_repo") }}
+{{ if $gh_repo }}
+<div class="td-page-meta ml-2 pb-1 pt-2 mb-0">
+{{ $editURL := printf "%s/edit/master/content/%s/%s" $gh_repo ($.Site.Language.Lang) .Path }}
+{{ $issuesURL := printf "%s/issues/new?title=%s" $gh_repo (htmlEscape $.Title )}}
+<a href="{{ $editURL }}" target="_blank" rel="noopener"><i class="fa fa-edit fa-fw"></i> {{ T "post_edit_this" }}</a>
+<a href="{{ $issuesURL }}" target="_blank" rel="noopener"><i class="fab fa-github fa-fw"></i> {{ T "post_create_issue" }}</a>
+</div>
+{{ end }}
+{{ end }}