init
This commit is contained in:
0
themes/godocs-3/layouts/404.html
Normal file
0
themes/godocs-3/layouts/404.html
Normal file
46
themes/godocs-3/layouts/_default/baseof.html
Normal file
46
themes/godocs-3/layouts/_default/baseof.html
Normal file
@@ -0,0 +1,46 @@
|
||||
<!DOCTYPE html>
|
||||
<html
|
||||
lang="{{ site.LanguageCode | default `en-US` }}"
|
||||
itemscope
|
||||
itemtype="http://schema.org/WebPage">
|
||||
<head>
|
||||
<!-- head (don't cache it) -->
|
||||
{{ partial "essentials/head.html" . }}
|
||||
|
||||
|
||||
<!-- cache partial only in production -->
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ partialCached "essentials/style.html" . }}
|
||||
{{ else }}
|
||||
{{ partial "essentials/style.html" . }}
|
||||
{{ end }}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- cache partial only in production -->
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ partialCached "preloader.html" . }}
|
||||
{{ partialCached "gtm-noscript.html" . }}
|
||||
{{ else }}
|
||||
{{ partial "preloader.html" . }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
<!-- header (don't cache it) -->
|
||||
{{ partial "essentials/header.html" . }}
|
||||
|
||||
|
||||
<main>
|
||||
{{ block "main" . }}{{ end }}
|
||||
</main>
|
||||
|
||||
<!-- cache partial only in production -->
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ partialCached "essentials/footer.html" . }}
|
||||
{{ partialCached "essentials/script.html" . }}
|
||||
{{ else }}
|
||||
{{ partial "essentials/footer.html" . }}
|
||||
{{ partial "essentials/script.html" . }}
|
||||
{{ end }}
|
||||
</body>
|
||||
</html>
|
||||
17
themes/godocs-3/layouts/_default/changelog.html
Normal file
17
themes/godocs-3/layouts/_default/changelog.html
Normal file
@@ -0,0 +1,17 @@
|
||||
{{ define "main" }}
|
||||
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-10 mx-auto">
|
||||
<div class="p-5 shadow rounded content">
|
||||
<h1 class="mb-4 fw-bold">{{ .Title }}</h1>
|
||||
<p>{{.Params.Description}}</p>
|
||||
<div class="mt-5">{{ .Content }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{{ end }}
|
||||
46
themes/godocs-3/layouts/_default/contact.html
Normal file
46
themes/godocs-3/layouts/_default/contact.html
Normal file
@@ -0,0 +1,46 @@
|
||||
{{ define "main" }}
|
||||
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
<div class="p-4 p-sm-5 shadow rounded content">
|
||||
<h2 class="section-title">{{ .Title }}</h2>
|
||||
<form method="POST" class="row gy-4" action="{{ .Site.Params.contact_form_action }}">
|
||||
<div class="form-group col-md-6">
|
||||
<label for="fname">{{ i18n "first_name" }}</label>
|
||||
<input type="text" class="form-control" id="fname" name="fname" placeholder="Your First Name" required>
|
||||
</div>
|
||||
<div class="form-group col-md-6">
|
||||
<label for="lname">{{ i18n "last_name" }}</label>
|
||||
<input type="text" class="form-control" id="lname" name="lname" placeholder="Your Last Name">
|
||||
</div>
|
||||
<div class="form-group col-12">
|
||||
<label for="email">{{ i18n "email" }}</label>
|
||||
<input type="email" class="form-control" id="email" name="email" placeholder="Your Email Address"
|
||||
required>
|
||||
</div>
|
||||
<div class="form-group col-12">
|
||||
<label for="reason">{{ i18n "contact_reason" }}</label>
|
||||
<select id="reason" class="form-select rounded-0 px-0" name="reason" required>
|
||||
<option selected disabled>Choose Your Reason</option>
|
||||
<option value="business">Business</option>
|
||||
<option value="ticket">Ticket</option>
|
||||
<option value="project">Project</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group col-12">
|
||||
<label for="message">{{ i18n "write_message" }}</label>
|
||||
<textarea name="message" id="message" class="form-control" placeholder="Your Text here ..."></textarea>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<button type="submit" class="btn btn-primary">{{ i18n "send" }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{{ end }}
|
||||
12
themes/godocs-3/layouts/_default/faq.html
Normal file
12
themes/godocs-3/layouts/_default/faq.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{{ define "main" }}
|
||||
|
||||
<section class="section pb-0">
|
||||
<div class="container">
|
||||
<h2 class="section-title fw-bold">{{ .Title }}</h2>
|
||||
<div class="row masonry-wrapper">
|
||||
{{ .Content }}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{{ end }}
|
||||
36
themes/godocs-3/layouts/_default/index.json
Normal file
36
themes/godocs-3/layouts/_default/index.json
Normal file
@@ -0,0 +1,36 @@
|
||||
{{- $len := sub (len (.Pages.GroupBy "Section")) 1 -}}
|
||||
[{{- range $item, $el := .Pages.GroupBy "Section" -}}
|
||||
{{- range $i, $e := .Pages -}}
|
||||
{{- if and (not .Params.ignoreSearch) (ne $e.Type "json") -}}
|
||||
{
|
||||
"section": "",
|
||||
"url": "{{ $e.Permalink }}",
|
||||
"title": "{{ with $e.Params.bannertext }}{{htmlEscape .}}{{else}}{{htmlEscape $e.Title}}{{end}}",
|
||||
"description": "{{ htmlEscape .Description}}",
|
||||
"searchKeyword": "{{ htmlEscape .Params.searchKeyword}}",
|
||||
"content": {{$e.Plain | jsonify}}
|
||||
},
|
||||
{{- end -}}
|
||||
|
||||
{{- if .Section -}}
|
||||
{{- $section := (where site.Pages "Section" .Section) | intersect (where site.Pages ".Title" "!=" .Title) -}}
|
||||
{{- $sectionLen := len (where site.Pages "Section" .Section) -}}
|
||||
{{- $sectionLenTotal := sub $sectionLen 2 -}}
|
||||
|
||||
{{- range $index, $page := $section -}}
|
||||
{{- if and (not .Params.ignoreSearch) (ne $page.Type "json") -}}
|
||||
{
|
||||
"section": "{{$page.Section | humanize}}",
|
||||
"url": "{{ $page.Permalink }}",
|
||||
"title": "{{ with $page.Params.bannertext }}{{htmlEscape .}}{{else}}{{htmlEscape $page.Title}}{{end}}",
|
||||
"description": "{{ htmlEscape .Description}}",
|
||||
"searchKeyword": "{{ htmlEscape .Params.searchKeyword}}",
|
||||
"content": {{$page.Plain | jsonify}}
|
||||
}{{- if eq $item $len -}}{{- if ne $index $sectionLenTotal -}},{{- end -}}{{- else -}},{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
|
||||
{{- end -}}
|
||||
{{- end -}}]
|
||||
5
themes/godocs-3/layouts/_default/list.html
Normal file
5
themes/godocs-3/layouts/_default/list.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{ define "main" }}
|
||||
|
||||
{{ partial "default.html" . }}
|
||||
|
||||
{{ end }}
|
||||
29
themes/godocs-3/layouts/_default/search.html
Normal file
29
themes/godocs-3/layouts/_default/search.html
Normal file
@@ -0,0 +1,29 @@
|
||||
{{ define "main" }}
|
||||
|
||||
<section class="mt-5 py-4">
|
||||
<div class="container-fluid">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
<h2 class="mb-5 fw-medium">Search result for
|
||||
<span class="text-primary">
|
||||
<script>
|
||||
var str = (window.location.search).substr(3);
|
||||
var result = str.replaceAll("+", " ");
|
||||
document.write(decodeURI(result));
|
||||
</script>
|
||||
</span>
|
||||
</h2>
|
||||
<div class="p-5 shadow rounded">
|
||||
<div id="search-results"></div>
|
||||
<script id="search-result-template" type="text/x-js-template">
|
||||
<div class="py-4 search-item" id="summary-${key}">
|
||||
<a class="h4 mb-0" href="${link}">${title}</a>
|
||||
</div>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
{{ end }}
|
||||
5
themes/godocs-3/layouts/_default/single.html
Normal file
5
themes/godocs-3/layouts/_default/single.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{ define "main" }}
|
||||
|
||||
{{ partial "default.html" . }}
|
||||
|
||||
{{ end }}
|
||||
5
themes/godocs-3/layouts/index.html
Normal file
5
themes/godocs-3/layouts/index.html
Normal file
@@ -0,0 +1,5 @@
|
||||
{{ define "main" }}
|
||||
|
||||
{{ partial "default.html" . }}
|
||||
|
||||
{{ end }}
|
||||
@@ -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" data-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>
|
||||
142
themes/godocs-3/layouts/partials/default.html
Normal file
142
themes/godocs-3/layouts/partials/default.html
Normal file
@@ -0,0 +1,142 @@
|
||||
{{ "<!-- details page -->" | safeHTML }}
|
||||
<section>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-xl-2 col-lg-3 col-md-4 d-none d-md-block">
|
||||
<ul class="{{ if gt .WordCount 100 }}vh-100{{ end }} sidenav pt-4 pe-4 ps-0 border-end border-default">
|
||||
{{ $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-xl-8 col-lg-9 col-md-8">
|
||||
<div class="px-lg-5 px-sm-4 pt-5">
|
||||
<h2 class="mb-4 fw-bold">{{ .Title }}</h2>
|
||||
{{ if .Content }}
|
||||
<div class="content" data-bs-spy="scroll" data-bs-target="#TableOfContents" data-bs-offset="20">{{.Content}}
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="page-list">
|
||||
{{ template "section-tree-nav" dict "sect" . "currentnode" $currentNode }}
|
||||
</div>
|
||||
{{ 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") -}}
|
||||
<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 -}}
|
||||
{{- with ($.Scratch.Get "nextPage") -}}
|
||||
<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 }}
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
{{ if .Site.Params.table_of_content }}
|
||||
{{ if gt .WordCount 200 }}
|
||||
<div class="col-lg-2 d-none d-xl-block">
|
||||
{{ .TableOfContents }}
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</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 }}
|
||||
|
||||
|
||||
<!-- call to action -->
|
||||
{{ if .Site.Params.call_to_action.enable }}
|
||||
{{ with .Site.Params.call_to_action }}
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<div class="row align-items-center">
|
||||
<div class="col-lg-4 text-center d-lg-block d-none">
|
||||
{{ partial "image.html" (dict "Src" .image) }}
|
||||
</div>
|
||||
<div class="col-lg-8 text-lg-left">
|
||||
<h2 class="mb-3 fw-bold">{{ .title | markdownify }}</h2>
|
||||
<p>{{ .content | markdownify }}</p>
|
||||
{{ if .button.enable }}
|
||||
{{ with .button }}
|
||||
<a href="{{ .link | absLangURL }}" class="btn btn-primary">{{ .label }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<!-- /call to action -->
|
||||
34
themes/godocs-3/layouts/partials/essentials/footer.html
Normal file
34
themes/godocs-3/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 class="navbar-brand" 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 }}
|
||||
{{ 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-3/layouts/partials/essentials/head.html
Normal file
55
themes/godocs-3/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-3/layouts/partials/essentials/header.html
Normal file
100
themes/godocs-3/layouts/partials/essentials/header.html
Normal file
@@ -0,0 +1,100 @@
|
||||
{{ "<!-- navigation -->" | safeHTML }}
|
||||
<header class="sticky-top navigation">
|
||||
<div class="container-fluid">
|
||||
<!-- navbar -->
|
||||
<nav class="navbar navbar-expand-lg navbar-light bg-transparent">
|
||||
<a class="navbar-brand" href="{{ .Site.BaseURL | relLangURL }}">
|
||||
{{ partial "logo.html" }}
|
||||
</a>
|
||||
|
||||
<!-- for mobile -->
|
||||
<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>
|
||||
<!-- /for mobile -->
|
||||
|
||||
<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 me-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>
|
||||
|
||||
<!-- for desktop -->
|
||||
<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>
|
||||
|
||||
<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-3/layouts/partials/essentials/script.html
Normal file
56
themes/godocs-3/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-3/layouts/partials/essentials/style.html
Normal file
42
themes/godocs-3/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>
|
||||
6
themes/godocs-3/layouts/shortcodes/changelog.html
Normal file
6
themes/godocs-3/layouts/shortcodes/changelog.html
Normal file
@@ -0,0 +1,6 @@
|
||||
{{ $_hugo_config := `{ "version": 1 }` }}
|
||||
|
||||
<div class="mt-4">
|
||||
<div class="badge {{ .Get 0 | lower}}">{{ .Get 0 | title }}</div>
|
||||
{{ .Inner | markdownify }}
|
||||
</div>
|
||||
10
themes/godocs-3/layouts/shortcodes/faq.html
Normal file
10
themes/godocs-3/layouts/shortcodes/faq.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{{ $_hugo_config := `{ "version": 1 }` }}
|
||||
|
||||
<div class="col-md-6 mb-4">
|
||||
<div class="card card-lg shadow border-0 rounded">
|
||||
<div class="card-body">
|
||||
<h3 class="card-title h5 mb-3">{{ .Get 0 | markdownify }}</h3>
|
||||
<p class="card-text content fw-light">{{ .Inner | markdownify }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user