init
This commit is contained in:
43
themes/godocs-2/layouts/partials/essentials/footer.html
Normal file
43
themes/godocs-2/layouts/partials/essentials/footer.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<footer>
|
||||
<div class="container">
|
||||
<div class="row align-items-center border-bottom py-5">
|
||||
<div class="col-lg-4">
|
||||
<ul class="list-inline footer-menu text-center text-lg-start">
|
||||
{{ range .Site.Menus.footer }}
|
||||
<li class="list-inline-item"><a href="{{ .URL | absLangURL }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-lg-4 text-center mb-4 mb-lg-0">
|
||||
<a class="navbar-brand" href="{{ .Site.BaseURL | relLangURL }}/">
|
||||
{{ if .Site.Params.logo }}
|
||||
{{ partial "logo.html" }}
|
||||
{{ else }}
|
||||
{{ .Site.Title }}
|
||||
{{ end }}</a>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<ul class="list-inline social-icons text-lg-end text-center">
|
||||
{{ range .Site.Params.social }}
|
||||
<li class="list-inline-item"><a href="{{ .link | safeURL }}"><i class="{{ .icon }}"></i></a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="py-4 text-center">
|
||||
<small class="text-light">
|
||||
{{ site.Params.copyright | markdownify }}
|
||||
{{ if site.Params.theme_copyright }}
|
||||
| Theme by
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
href="https://gethugothemes.com/"
|
||||
>GetHugoThemes</a
|
||||
>
|
||||
{{ end }}
|
||||
</small>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
55
themes/godocs-2/layouts/partials/essentials/head.html
Normal file
55
themes/godocs-2/layouts/partials/essentials/head.html
Normal file
@@ -0,0 +1,55 @@
|
||||
<meta charset="utf-8" />
|
||||
<title>{{ .Title | default site.Title }}</title>
|
||||
|
||||
<!-- responsive meta -->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5" />
|
||||
|
||||
<!-- theme meta -->
|
||||
<meta name="theme-name" content="godocs-hugo" />
|
||||
|
||||
<!-- favicon -->
|
||||
{{ partialCached "favicon" . }}
|
||||
|
||||
|
||||
<!-- manifest -->
|
||||
{{ partialCached "manifest" . }}
|
||||
|
||||
|
||||
<!-- site verifications -->
|
||||
{{ partialCached "site-verifications.html" . }}
|
||||
|
||||
|
||||
<!-- opengraph and twitter card -->
|
||||
{{ partial "basic-seo.html" . }}
|
||||
|
||||
|
||||
<!-- custom script -->
|
||||
{{ partialCached "custom-script.html" . }}
|
||||
|
||||
|
||||
<!-- google analytics -->
|
||||
{{ template "_internal/google_analytics.html" . }}
|
||||
|
||||
|
||||
<!-- google tag manager -->
|
||||
{{ partialCached "gtm.html" . }}
|
||||
|
||||
|
||||
<!-- matomo analytics -->
|
||||
{{ partialCached "matomo-analytics.html" . }}
|
||||
|
||||
|
||||
<!-- Baidu analytics -->
|
||||
{{ partialCached "baidu-analytics.html" . }}
|
||||
|
||||
|
||||
<!-- Plausible Analytics -->
|
||||
{{ partialCached "plausible-analytics.html" . }}
|
||||
|
||||
|
||||
<!-- Counter Analytics -->
|
||||
{{ partialCached "counter-analytics.html" . }}
|
||||
|
||||
|
||||
<!-- Crisp Chat -->
|
||||
{{ partialCached "crisp-chat.html" . }}
|
||||
100
themes/godocs-2/layouts/partials/essentials/header.html
Normal file
100
themes/godocs-2/layouts/partials/essentials/header.html
Normal file
@@ -0,0 +1,100 @@
|
||||
{{ "<!-- navigation -->" | safeHTML }}
|
||||
<header class="sticky-top navigation">
|
||||
<div class="container">
|
||||
<!-- navbar -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-transparent">
|
||||
<a class="navbar-brand" href="{{ .Site.BaseURL | relLangURL }}">
|
||||
{{ partial "logo.html" }}
|
||||
</a>
|
||||
|
||||
<form class="form-inline search-wrapper my-3 d-block d-lg-none" name="search-form" class="search-wrapper"
|
||||
data-bs-toggle="modal" data-bs-target="#searchModal">
|
||||
<input id="search-by" name="s" type="search" class="form-control text-dark d-none d-lg-block"
|
||||
placeholder="{{ i18n `search_placeholder`}}" readonly>
|
||||
<button class="border-0 bg-white pe-none" type="submit"><i class="fas fa-search"></i></button>
|
||||
</form>
|
||||
|
||||
<button class="navbar-toggler border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navigation">
|
||||
<i class="fa-solid fa-bars"></i>
|
||||
<i class="fa-solid fa-xmark"></i>
|
||||
</button>
|
||||
|
||||
<div class="collapse navbar-collapse text-center" id="navigation">
|
||||
<ul class="navbar-nav mx-auto align-items-center">
|
||||
{{ range .Site.Menus.main }}
|
||||
{{ if .HasChildren }}
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
|
||||
{{ .Name }}
|
||||
</a>
|
||||
<div class="dropdown-menu">
|
||||
{{ range .Children }}
|
||||
<a class="dropdown-item" href="{{ .URL | absLangURL }}">{{ .Name }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</li>
|
||||
{{ else }}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ .URL | absLangURL }}">{{ .Name }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<li class="nav-link">
|
||||
<!-- Language List -->
|
||||
{{ if .IsTranslated }}
|
||||
<select class="nav-item" id="select-language" onchange="location = this.value;">
|
||||
{{ $siteLanguages := .Site.Languages}}
|
||||
{{ $pageLang := .Page.Lang}}
|
||||
{{ range .Page.AllTranslations }}
|
||||
{{ $translation := .}}
|
||||
{{ range $siteLanguages }}
|
||||
{{ if eq $translation.Lang .Lang }}
|
||||
{{ $selected := false }}
|
||||
{{ if eq $pageLang .Lang}}
|
||||
<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}" selected>{{ .LanguageName }}
|
||||
</option>
|
||||
{{ else }}
|
||||
<option id="{{ $translation.Language }}" value="{{ $translation.Permalink }}">{{ .LanguageName }}</option>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</select>
|
||||
{{ end }}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- for mobile -->
|
||||
<div class="d-lg-none d-block">
|
||||
{{ range site.Params.nav_button }}
|
||||
<a href="{{ .link | absLangURL }}"
|
||||
class="btn btn-sm {{if eq .style `outline`}}btn-outline-primary{{else}}btn-primary{{end}} ms-lg-4">{{ .label
|
||||
}}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
<!-- /for mobile -->
|
||||
</div>
|
||||
|
||||
<form class="form-inline search-wrapper my-3 d-none d-lg-block" data-bs-toggle="modal"
|
||||
data-bs-target="#searchModal">
|
||||
<i class="search-icon fas fa-search"></i>
|
||||
<input class="form-control form-control-sm" placeholder="{{ i18n `search`}}" readonly>
|
||||
<button type="button" class="search-button" style="font-size:12px" data-search-toggler>{{ i18n "search"
|
||||
}}</button>
|
||||
</form>
|
||||
|
||||
<!-- for desktop -->
|
||||
<div class="d-lg-flex d-none">
|
||||
{{ range site.Params.nav_button }}
|
||||
<a href="{{ .link | absLangURL }}"
|
||||
class="btn btn-sm {{if eq .style `outline`}}btn-outline-primary{{else}}btn-primary{{end}} ms-lg-4">{{ .label
|
||||
}}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
<!-- /for desktop -->
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
{{ "<!-- /navigation -->" | safeHTML }}
|
||||
|
||||
{{ partial "components/search-modal" . }}
|
||||
56
themes/godocs-2/layouts/partials/essentials/script.html
Normal file
56
themes/godocs-2/layouts/partials/essentials/script.html
Normal file
@@ -0,0 +1,56 @@
|
||||
<!-- Bootstrap scripts -->
|
||||
{{ $bootstrap := resources.Get "js/bootstrap.js" }}
|
||||
{{ $params := dict }}
|
||||
{{ $sourceMap := cond hugo.IsProduction "" "inline" }}
|
||||
{{ $opts := dict "sourceMap" $sourceMap "target" "es2018" "params" $params }}
|
||||
{{ $bootstrap = $bootstrap | js.Build $opts }}
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $bootstrap = $bootstrap | fingerprint "sha512" }}
|
||||
{{ end }}
|
||||
<script crossorigin="anonymous" defer {{ if hugo.IsProduction }}integrity="{{ $bootstrap.Data.Integrity }}"{{end}} type="application/javascript">{{$bootstrap.Content | safeJS}}</script>
|
||||
|
||||
<!-- JS Plugins + Main script -->
|
||||
{{ $scripts := slice }}
|
||||
{{ range site.Params.plugins.js }}
|
||||
{{ if findRE "^http" .link }}
|
||||
<script
|
||||
src="{{ .link | relURL }}"
|
||||
type="application/javascript"
|
||||
{{ .attributes | safeHTMLAttr }}></script>
|
||||
{{ else }}
|
||||
{{ $scripts = $scripts | append (resources.Get .link) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
<!-- main script -->
|
||||
{{ $scripts = $scripts | append (resources.Get "js/script.js") }}
|
||||
{{ $scripts = $scripts | resources.Concat "js/scripts.js" }}
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ $scripts = $scripts | fingerprint "sha512" }}
|
||||
{{ end }}
|
||||
<script crossorigin="anonymous" defer {{ if hugo.IsProduction }}integrity="{{ $scripts.Data.Integrity }}"{{end}} type="application/javascript">{{$scripts.Content | safeJS}}</script>
|
||||
|
||||
<!-- font family -->
|
||||
{{ $pf:= site.Params.variables.font_primary }}
|
||||
{{ $sf:= site.Params.variables.font_secondary }}
|
||||
<script type="application/javascript">
|
||||
WebFont.load({
|
||||
google: {
|
||||
api: 'https://fonts.googleapis.com/css2',
|
||||
families: ['{{$pf | default `Lato:wght@400`}}{{if not $sf}}&display=swap{{end}}'{{with $sf}},'{{. | default `Lato:wght@400`}}&display=swap'{{end}}],
|
||||
version: 2
|
||||
},
|
||||
active: () => {sessionStorage.fontsLoaded = true}
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- progressive web app -->
|
||||
{{ partialCached "pwa.html" . }}
|
||||
|
||||
|
||||
<!-- cookie consent -->
|
||||
{{ partialCached "cookie-consent.html" . }}
|
||||
|
||||
|
||||
<!-- google adsense -->
|
||||
{{ partialCached "adsense-script.html" . }}
|
||||
42
themes/godocs-2/layouts/partials/essentials/style.html
Normal file
42
themes/godocs-2/layouts/partials/essentials/style.html
Normal file
@@ -0,0 +1,42 @@
|
||||
<!-- DNS preconnect -->
|
||||
<meta http-equiv="x-dns-prefetch-control" content="on" />
|
||||
<link rel="preconnect" href="//ajax.googleapis.com" />
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin="anonymous" />
|
||||
<link rel="preconnect" href="https://use.fontawesome.com" crossorigin />
|
||||
<link rel="preconnect" href="//cdnjs.cloudflare.com" />
|
||||
<link rel="preconnect" href="//www.googletagmanager.com" />
|
||||
<link rel="preconnect" href="//www.google-analytics.com" />
|
||||
<link rel="dns-prefetch" href="https://fonts.gstatic.com" />
|
||||
<link rel="dns-prefetch" href="https://use.fontawesome.com" />
|
||||
<link rel="dns-prefetch" href="//ajax.googleapis.com" />
|
||||
<link rel="dns-prefetch" href="//cdnjs.cloudflare.com" />
|
||||
<link rel="dns-prefetch" href="//www.googletagmanager.com" />
|
||||
<link rel="dns-prefetch" href="//www.google-analytics.com" />
|
||||
<link rel="dns-prefetch" href="//fonts.googleapis.com" />
|
||||
<link rel="dns-prefetch" href="//connect.facebook.net" />
|
||||
<link rel="dns-prefetch" href="//platform.linkedin.com" />
|
||||
<link rel="dns-prefetch" href="//platform.twitter.com" />
|
||||
|
||||
<!-- plugins + stylesheet -->
|
||||
{{ $styles := slice }}
|
||||
{{ range site.Params.plugins.css }}
|
||||
{{ if findRE "^http" .link }}
|
||||
<link crossorigin="anonymous" media="all" rel="stylesheet" href="{{ .link | relURL }}" {{ .attributes | safeHTMLAttr }} />
|
||||
{{ else }}
|
||||
{{ $styles = $styles | append (resources.Get .link) }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ $styles := $styles | append (resources.Get "scss/style.scss" | resources.ExecuteAsTemplate "style.scss" . | toCSS) }}
|
||||
{{ $styles := $styles | resources.Concat "/css/style.css" }}
|
||||
|
||||
|
||||
<!-- Purge CSS in Production -->
|
||||
{{ if and hugo.IsProduction site.Params.purge_css }}
|
||||
{{ $styles = $styles | css.PostCSS | fingerprint "sha256" }}
|
||||
{{ $styles = $styles | resources.PostProcess }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<!-- <link rel="stylesheet" href="{{ $styles.RelPermalink }}" /> -->
|
||||
|
||||
<style type="text/css">{{$styles.Content | safeCSS}}</style>
|
||||
Reference in New Issue
Block a user