diff options
author | zzossig <zzossig@gmail.com> | 2020-02-05 20:36:42 +0300 |
---|---|---|
committer | zzossig <zzossig@gmail.com> | 2020-02-05 20:36:42 +0300 |
commit | 3ffe6f5ac4c335d989b9782ea2a8c1e34aa66650 (patch) | |
tree | ae6fcc28d89b9a7baf7006d3c9b557596d508f5a | |
parent | 63f9b5be299e474ff44ff709eecca991e0aa9acc (diff) |
prepare exampleSite
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | exampleSite/config/_default/params.toml | 2 | ||||
-rw-r--r-- | exampleSite/content/_index.md | 16 | ||||
-rw-r--r-- | exampleSite/static/manifest.json | 8 | ||||
-rw-r--r-- | layouts/partials/footer/footer.html | 2 | ||||
-rw-r--r-- | layouts/partials/head/scripts.html | 52 |
6 files changed, 19 insertions, 63 deletions
@@ -188,7 +188,7 @@ paginateWindow = 1 # setting it to 1 gives 7 buttons, 2 gives 9, etc. If set 1: taxoPaginate = 13 # items per page taxoGroupByDate = "2006" # "2006-01": group by month, "2006": group by year -github = "https://github.com/zzossig/hugo-theme-zzo" +github = "https://github.com/zzossig/hugo-theme-zdoc" ``` ## How to make doc diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml index f4a978d..b27c023 100644 --- a/exampleSite/config/_default/params.toml +++ b/exampleSite/config/_default/params.toml @@ -21,7 +21,7 @@ paginateWindow = 1 taxoPaginate = 13 taxoGroupByDate = "2006" # "2006-01": group by month, "2006": group by year -github = "https://github.com/zzossig/hugo-theme-zzo" +github = "https://github.com/zzossig/hugo-theme-zdoc" # comment enableComment = true diff --git a/exampleSite/content/_index.md b/exampleSite/content/_index.md index 366a53e..dce15e1 100644 --- a/exampleSite/content/_index.md +++ b/exampleSite/content/_index.md @@ -13,18 +13,18 @@ titleColor: textColor: spaceBetweenTitleText: 25 buttons: - - link: /about + - link: /docs/gettingstarted/quickstart text: GET STARTED color: primary - link: https://github.com/zzossig/hugo-theme-zdoc text: DOWNLOAD color: default -shields: - - link: https://github.com/zzossig/hugo-theme-zdoc - image: https://img.shields.io/github/forks/zzossig/hugo-theme-zdoc?label=Fork&style=social - alt: Hugo ZDoc theme github forks - - link: https://github.com/zzossig/hugo-theme-zdoc - image: https://img.shields.io/github/stars/zzossig/hugo-theme-zdoc?label=Star&style=social - alt: Hugo ZDoc theme github stars +# shields: + # - link: https://github.com/zzossig/hugo-theme-zdoc + # image: https://img.shields.io/github/forks/zzossig/hugo-theme-zdoc?label=Fork&style=social + # alt: Hugo ZDoc theme github forks + # - link: https://github.com/zzossig/hugo-theme-zdoc + # image: https://img.shields.io/github/stars/zzossig/hugo-theme-zdoc?label=Star&style=social + # alt: Hugo ZDoc theme github stars --- diff --git a/exampleSite/static/manifest.json b/exampleSite/static/manifest.json index 5837d48..0a6c65a 100644 --- a/exampleSite/static/manifest.json +++ b/exampleSite/static/manifest.json @@ -1,11 +1,11 @@ { "manifest_version": 2, - "name": "Hugo Zzo theme", - "short_name": "Hugo Zzo theme", + "name": "Hugo Zdoc theme", + "short_name": "Hugo Zdoc theme", "version": "1.0.0", "default_locale": "en", - "description": "Hugo blog theme with rich features", - "start_url": "https://themes.gohugo.io/theme/hugo-theme-zzo/", + "description": "Hugo simple documentation theme", + "start_url": "https://themes.gohugo.io/theme/hugo-theme-zdoc/", "icons": [ { "src": "favicon/android-icon-36x36.png", diff --git a/layouts/partials/footer/footer.html b/layouts/partials/footer/footer.html index 9c886e0..1fe0e81 100644 --- a/layouts/partials/footer/footer.html +++ b/layouts/partials/footer/footer.html @@ -7,7 +7,7 @@ {{ with $.Site.Copyright }}{{ replace . "{year}" now.Year | markdownify}}{{ end }} </p> {{ if $.Param "showPoweredBy" }} - <p class="caption">Powered by <a href="https://gohugo.io/" rel="noreferrer">Hugo</a> and the <a href="https://github.com/zzossig/hugo-theme-zzo" rel="noreferrer">zDoc theme</a></p> + <p class="caption">Powered by <a href="https://gohugo.io/" rel="noreferrer">Hugo</a> and the <a href="https://github.com/zzossig/hugo-theme-zdoc" rel="noreferrer">zDoc theme</a></p> {{ end }} </div> </div> diff --git a/layouts/partials/head/scripts.html b/layouts/partials/head/scripts.html index 30d3bc8..acb8529 100644 --- a/layouts/partials/head/scripts.html +++ b/layouts/partials/head/scripts.html @@ -12,6 +12,9 @@ <script> "use strict"; + {{ $permalink := .Permalink }} + var permalink = JSON.parse({{ $permalink | jsonify }}); + window.onload = function() { // ========================== expand ========================== var expandBtn = document.querySelectorAll('.expand__button'); @@ -302,44 +305,6 @@ // ========================== search ========================== - var baseurl = null; - {{ $siteBaseURL:= .Site.BaseURL }} - var siteBaseURL = JSON.parse({{ $siteBaseURL | jsonify }}); - var siteBaseChecker = /\/\w+\//i; - var isSlug = siteBaseChecker.test(siteBaseURL); - var isThemeSite = location.origin.includes('themes.gohugo.io'); - - {{ if .Site.IsMultiLingual }} - if (isThemeSite) { - baseurl = "{{.Site.BaseURL}}{{.Site.LanguagePrefix}}"; - } else { - var hasLangPostfix = location.pathname.includes("/{{.Site.Language.Lang}}"); - if (hasLangPostfix) { - if (isSlug) { - baseurl = location.origin + siteBaseURL.match(siteBaseChecker)[0] + "{{.Site.Language.Lang}}"; - } else { - baseurl = location.origin + "/{{.Site.Language.Lang}}"; - } - } else { - if (isSlug) { - baseurl = location.origin + siteBaseURL.match(siteBaseChecker)[0]; - } else { - baseurl = location.origin; - } - } - } - {{ else }} - if (isThemeSite) { - baseurl = "{{.Site.BaseURL}}"; - } else { - if (isSlug) { - baseurl = location.origin + siteBaseURL.match(siteBaseChecker)[0]; - } else { - baseurl = location.origin; - } - } - {{ end }} - var searchResults = null; var searchMenu = null; var searchText = null; @@ -349,17 +314,8 @@ var fuse = null; - function endsWith(str, suffix) { - return str.indexOf(suffix, str.length - suffix.length) !== -1; - } - - function initFuse() { - if (!endsWith(baseurl, "/")) { - baseurl = baseurl + '/'; - }; - var xhr = new XMLHttpRequest(); - xhr.open('GET', baseurl + "index.json"); + xhr.open('GET', permalink + "index.json"); xhr.setRequestHeader('Content-Type', 'application/json; charset=utf-8'); xhr.onload = function () { if (xhr.status === 200) { |