init
This commit is contained in:
43
themes/godocs-4/layouts/partials/components/feedback.html
Normal file
43
themes/godocs-4/layouts/partials/components/feedback.html
Normal file
@@ -0,0 +1,43 @@
|
||||
<!-- feedback -->
|
||||
{{ if site.Params.feedback }}
|
||||
{{ with site.Params.feedback }}
|
||||
<div class="feedback row" id="feedback">
|
||||
<div class="col-md-8 col-lg-9">
|
||||
<h4 class="fw-bold">{{ .title | markdownify }}</h4>
|
||||
<p>{{ .content | markdownify }}</p>
|
||||
</div>
|
||||
<div class="col-md-4 col-lg-3 mt-2 mb-4 mb-md-0 text-md-end">
|
||||
<button class="feedback-btn collapsed positive" type="button" data-bs-toggle="collapse" data-bs-target="#positive"
|
||||
aria-expanded="true" aria-controls="positive">
|
||||
<i class="far fa-thumbs-up"></i>
|
||||
</button>
|
||||
<button class="feedback-btn collapsed negative" type="button" data-bs-toggle="collapse" data-bs-target="#negative"
|
||||
aria-expanded="false" aria-controls="negative">
|
||||
<i class="far fa-thumbs-down"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div id="positive" class="collapse" data-bs-parent="#feedback">
|
||||
<form name="feedback" method="POST" action="{{ site.Params.feedback_form_action }}">
|
||||
<input type="text" name="feedback" id="feedback" value="Positive" hidden>
|
||||
<input type="text" name="URL" id="URL" value="{{.Permalink}}" hidden>
|
||||
<textarea name="comments" id="comments" class="form-control mb-4"
|
||||
placeholder="{{ .positive_placeholder }}" required></textarea>
|
||||
<button type="submit" class="btn btn-primary">{{ i18n "send_feedback" }}</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="negative" class="collapse" data-bs-parent="#feedback">
|
||||
<form name="feedback" method="POST" action="{{ site.Params.feedback_form_action }}">
|
||||
<input type="text" name="feedback" id="feedback" value="Negative" hidden>
|
||||
<input type="text" name="URL" id="URL" value="{{.Permalink}}" hidden>
|
||||
<textarea name="comments" id="comments" class="form-control mb-4"
|
||||
placeholder="{{ .negative_placeholder }}" required></textarea>
|
||||
<button type="submit" class="btn btn-primary">{{ i18n "send_feedback" }}</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<!-- /feedback -->
|
||||
@@ -0,0 +1,93 @@
|
||||
<div class="modal search-modal" id="searchModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog search-modal-dialog">
|
||||
<div class="modal-content border-0"><div class="modal-header border-0" style="padding:1rem"><div class="input-group border-0">
|
||||
<span class="input-group-text bg-transparent text-dark border-end-0" id="Search">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16"><path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/></svg>
|
||||
</span>
|
||||
<input type="text" id="searchInput" class="form-control search-form-control shadow-none text-dark border-start-0 ps-0 ms-0 border-end-0" placeholder="{{i18n `search_placeholder`}}" aria-label="Search" aria-describedby="Search">
|
||||
<span class="input-group-text bg-transparent text-muted border-start-0" style="font-size:14px;">
|
||||
<span class="border border-muted rounded-1 px-1" bs-dismiss="modal" aria-label="Close">ESC</span>
|
||||
</span>
|
||||
</div></div>
|
||||
<div class="modal-body">
|
||||
<div id="search-result-body"></div>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const searchModal = document.getElementById('searchModal');
|
||||
const searchInput = document.getElementById('searchInput');
|
||||
const searchResult = document.getElementById("search-result-body");
|
||||
searchModal.addEventListener('shown.bs.modal', () => {searchInput.focus()});
|
||||
let jsonData = [];
|
||||
let indexJSON = {{"index.json" | relURL}};
|
||||
|
||||
const loadJsonData = async () => {
|
||||
try {
|
||||
const res = await fetch(indexJSON);
|
||||
jsonData = await res.json();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
};
|
||||
|
||||
searchInput.addEventListener("keyup", (e) => {
|
||||
const searchString = e.target.value.toLowerCase();
|
||||
|
||||
let filteredJSON = jsonData.reduce((prev, item) => [...new Set([...prev, item.section])], []).map((item) => {
|
||||
let filteredItems = jsonData.filter((i) => i.section === item);
|
||||
return {
|
||||
section: item,
|
||||
data: filteredItems,
|
||||
};
|
||||
});
|
||||
|
||||
let searchItem = filteredJSON.filter((item) => {
|
||||
if (searchString === "" ) {
|
||||
return "";
|
||||
}
|
||||
else if (item.data.find((el) => (el.title?.toLowerCase().includes(searchString)))) {
|
||||
return item
|
||||
}
|
||||
else if (item.data.find((el) => (el.description?.toLowerCase().includes(searchString)))) {
|
||||
return item
|
||||
}
|
||||
else if (item.data.find((el) => (el.searchKeyword?.toLowerCase().includes(searchString)))) {
|
||||
return item
|
||||
}
|
||||
else if (item.data.find((el) => (el.content?.toLowerCase().includes(searchString)))) {
|
||||
return item
|
||||
}
|
||||
});
|
||||
|
||||
displayResult(searchItem, searchString);
|
||||
});
|
||||
|
||||
const displayResult = (searchItems, searchString) => {
|
||||
const htmlString = searchItems.map((item) => {
|
||||
const contentValue = item.data.filter((d) => d.content?.toLowerCase().includes(searchString)).map((innerItem) => {
|
||||
const position = innerItem.content?.toLowerCase().indexOf(searchString.toLowerCase());
|
||||
let matches = innerItem.content?.substring(position, searchString.length + position);
|
||||
let matchesAfter = innerItem.content?.substring(searchString.length + position, searchString.length + position + 100);
|
||||
const highlighted = innerItem.content?.replace(innerItem.content, '<mark>' + matches + '</mark>' + matchesAfter);
|
||||
return highlighted;
|
||||
});
|
||||
|
||||
return`
|
||||
<div class="search-result-item">
|
||||
<p class="section">${item.section}</p>
|
||||
${item.data.filter((d) =>
|
||||
d.title?.toLowerCase().includes(searchString) ||
|
||||
d.description?.toLowerCase().includes(searchString) ||
|
||||
d.searchKeyword?.toLowerCase().includes(searchString) ||
|
||||
d.content?.toLowerCase().includes(searchString)).map((innerItem) =>
|
||||
`<a class="block" href="${innerItem.url}"><p class="text-dark mb-0 lh-base">${innerItem.title}</p><span></span><p class="small text-muted mt-1 mb-0 lh-base">${contentValue}</p></a>`
|
||||
).join("")}
|
||||
</div>`
|
||||
}).join("");
|
||||
searchResult.innerHTML = htmlString;
|
||||
};
|
||||
loadJsonData();
|
||||
|
||||
</script>
|
||||
118
themes/godocs-4/layouts/partials/default.html
Normal file
118
themes/godocs-4/layouts/partials/default.html
Normal file
@@ -0,0 +1,118 @@
|
||||
{{ "<!-- details page -->" | safeHTML }}
|
||||
<section class="pt-5">
|
||||
<div class="container shadow section-sm rounded">
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-md-4 d-none d-md-block">
|
||||
<ul class="sidenav">
|
||||
{{ $currentNode := . }}
|
||||
{{range .Site.Home.Sections.ByWeight}}
|
||||
<!-- not render any single page, like contact page. -->
|
||||
{{ $numberOfMainPages := len .Pages }}
|
||||
{{ if eq $numberOfMainPages 0 }}
|
||||
{{ else }}
|
||||
<!-- /not render any single page, like contact page. -->
|
||||
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode}}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="px-lg-5 px-sm-4">
|
||||
<h1 class="mb-4 fw-bold">{{ .Title }}</h1>
|
||||
{{ if .Content }}
|
||||
<div class="content">{{ partial "autotooltips.html" . }}</div>
|
||||
{{ else }}
|
||||
<ul class="list-styled text-start mb-4">
|
||||
{{ range .Data.Pages }}
|
||||
<li><a href="{{.Permalink}}">{{.Title}}</a></li>
|
||||
{{end}}
|
||||
</ul>
|
||||
{{ end }}
|
||||
<nav class="pagination">
|
||||
<!-- Next prev page -->
|
||||
{{- $currentNode := . -}}
|
||||
{{- template "menu-nextprev" dict "menu" site.Home "currentnode" $currentNode -}}
|
||||
{{- define "menu-nextprev" -}}
|
||||
{{- $currentNode := .currentnode -}}
|
||||
{{- if ne .menu.Params.hidden true -}}
|
||||
{{- if hasPrefix $currentNode.Permalink .menu.Permalink -}}
|
||||
{{- $currentNode.Scratch.Set "NextPageOK" "OK" -}}
|
||||
{{- $currentNode.Scratch.Set "prevPage" ($currentNode.Scratch.Get "prevPageTmp") -}}
|
||||
{{- else -}}
|
||||
{{- if eq ($currentNode.Scratch.Get "NextPageOK") "OK" -}}
|
||||
{{- $currentNode.Scratch.Set "NextPageOK" nil -}}
|
||||
{{- $currentNode.Scratch.Set "nextPage" .menu -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $currentNode.Scratch.Set "prevPageTmp" .menu -}}
|
||||
{{- $currentNode.Scratch.Set "pages" .menu.Pages -}}
|
||||
{{- if .menu.IsHome -}}
|
||||
{{- $currentNode.Scratch.Set "pages" .menu.Sections -}}
|
||||
{{- else if .menu.Sections -}}
|
||||
{{- $currentNode.Scratch.Set "pages" (.menu.Pages | union .menu.Sections) -}}
|
||||
{{- end -}}
|
||||
{{- $pages := ($currentNode.Scratch.Get "pages") -}}
|
||||
|
||||
{{- range $pages.ByWeight -}}
|
||||
{{- template "menu-nextprev" dict "menu" . "currentnode" $currentNode -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with ($.Scratch.Get "prevPage") -}}
|
||||
{{- if .Title -}}
|
||||
<a class="nav nav-prev" href="{{.RelPermalink }}"><i class="fas fa-chevron-left me-2"></i>
|
||||
<span class="d-none d-sm-block">{{.Title}}</span> <span class="d-block d-sm-none">Prev</span>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- with ($.Scratch.Get "nextPage") -}}
|
||||
{{- if .Title -}}
|
||||
<a class="nav nav-next" href="{{.RelPermalink }}">
|
||||
<span class="d-none d-sm-block">{{.Title}}</span> <span class="d-block d-sm-none">Next</span><i class="fas fa-chevron-right ms-2"></i>
|
||||
</a>
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
</nav>
|
||||
|
||||
{{ if .Params.Feedback }}
|
||||
{{ partial "components/feedback.html" . }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{ "<!-- /details page -->" | safeHTML }}
|
||||
|
||||
<!-- templates -->
|
||||
{{ define "section-tree-nav" }}
|
||||
{{ $showvisitedlinks := .showvisitedlinks }}
|
||||
{{ $currentNode := .currentnode }}
|
||||
{{with .sect}}
|
||||
{{safeHTML .Params.head}}
|
||||
{{ $fileUniqueID := "" }}
|
||||
{{ with .File }}{{ $fileUniqueID = .UniqueID }}{{ end }}
|
||||
{{ $currentNodeFileUniqueID := "" }}
|
||||
{{ with $currentNode.File }}{{ $currentNodeFileUniqueID = .UniqueID }}{{ end }}
|
||||
<li data-nav-id="{{.Permalink}}" title="{{.Title}}"
|
||||
class="sidelist {{if .IsAncestor $currentNode }}parent{{end}} {{if eq $fileUniqueID $currentNodeFileUniqueID}}active parent{{end}}">
|
||||
<a href="{{.Permalink}}">{{.Title }}</a>
|
||||
{{ $numberOfPages := (add (len .Pages) (len .Sections)) }}
|
||||
{{ if ne $numberOfPages 0 }}
|
||||
<ul>
|
||||
{{ $currentNode.Scratch.Set "pages" .Pages }}
|
||||
{{ if .Sections}}
|
||||
{{ $currentNode.Scratch.Set "pages" (.Pages | union .Sections) }}
|
||||
{{end}}
|
||||
{{ $pages := ($currentNode.Scratch.Get "pages") }}
|
||||
|
||||
{{ range $pages.ByWeight }}
|
||||
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode }}
|
||||
{{end}}
|
||||
</ul>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
34
themes/godocs-4/layouts/partials/essentials/footer.html
Normal file
34
themes/godocs-4/layouts/partials/essentials/footer.html
Normal file
@@ -0,0 +1,34 @@
|
||||
<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 href="{{ site.BaseURL | relLangURL }}">
|
||||
<!-- {{ partial "logo.html" }} -->
|
||||
</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 }}<br>
|
||||
{{ if site.Params.theme_copyright }}
|
||||
Made with 💙 by
|
||||
<a target="_blank" rel="noopener noreferrer" href="https://start-it.nl">StartIT</a>
|
||||
{{ end }}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
</footer>
|
||||
55
themes/godocs-4/layouts/partials/essentials/head.html
Normal file
55
themes/godocs-4/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" . }} -->
|
||||
<script defer data-domain="kennisbank.start-it.nl" src="https://stats.start-it.nl/js/script.file-downloads.outbound-links.js"></script>
|
||||
|
||||
<!-- Counter Analytics -->
|
||||
{{ partialCached "counter-analytics.html" . }}
|
||||
|
||||
|
||||
<!-- Crisp Chat -->
|
||||
{{ partialCached "crisp-chat.html" . }}
|
||||
58
themes/godocs-4/layouts/partials/essentials/header.html
Normal file
58
themes/godocs-4/layouts/partials/essentials/header.html
Normal file
@@ -0,0 +1,58 @@
|
||||
{{ "<!-- navigation -->" | safeHTML }}
|
||||
<header class="sticky-top navigation {{if .IsHome}}home-nav{{end}}">
|
||||
<div class="container">
|
||||
<!-- navbar -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-transparent justify-content-between">
|
||||
<div class="logo-wrapper order-1 mobile-view">
|
||||
{{ if site.Params.site_logo }}
|
||||
<a class="site-logo" target="_blank" href="{{site.Params.main_site_link | safeURL}}?ref=docs">
|
||||
{{ partial "logo.html" }}
|
||||
</a>
|
||||
{{ end }}
|
||||
<span class="logo-devider"></span>
|
||||
<a class="docs-logo" href="{{ .Site.BaseURL | relLangURL }}">
|
||||
{{ partial "image.html" (dict "Src" site.Params.docs_logo "Alt" (.Site.Title)) }}</a>
|
||||
</div>
|
||||
|
||||
<form class="form-inline search-wrapper order-3 order-lg-2 {{if not .IsHome}}d-block mt-3{{end}}" 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>
|
||||
|
||||
<div class="d-flex order-2 order-lg-3 mobile-view">
|
||||
<!-- Language List -->
|
||||
{{ if .IsTranslated }}
|
||||
<select class="language-selector bg-transparent" 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 value="{{ $translation.Permalink }}" selected>{{ .LanguageName }}</option>
|
||||
{{ else }}
|
||||
<option value="{{ $translation.Permalink }}">{{ .LanguageName }}</option>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</select>
|
||||
{{ end }}
|
||||
<!-- nav buttons -->
|
||||
{{ range $i, $e:= site.Params.nav_button }}
|
||||
<a href="{{ .link | absLangURL }}"
|
||||
class="btn btn-sm {{if eq .style `outline`}}btn-outline-primary{{else}}btn-primary{{end}} {{if and $i (gt $i 0)}}ms-3{{end}}">{{
|
||||
.label }}</a>
|
||||
{{ end }}
|
||||
</div>
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
{{ "<!-- /navigation -->" | safeHTML }}
|
||||
|
||||
{{ partial "components/search-modal" . }}
|
||||
59
themes/godocs-4/layouts/partials/essentials/script.html
Normal file
59
themes/godocs-4/layouts/partials/essentials/script.html
Normal file
@@ -0,0 +1,59 @@
|
||||
<!-- 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" . }}
|
||||
|
||||
{{ $tooltips := resources.Get "js/tooltips.js" | minify }}
|
||||
<script src="{{ $tooltips.RelPermalink }}" defer></script>
|
||||
42
themes/godocs-4/layouts/partials/essentials/style.html
Normal file
42
themes/godocs-4/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