浏览代码

prepare exampleSite

zzossig 5 年之前
父节点
当前提交
3ffe6f5ac4

+ 1 - 1
README.md

@@ -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
 taxoPaginate = 13 # items per page
 taxoGroupByDate = "2006" # "2006-01": group by month, "2006": group by year
 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
 ## How to make doc

+ 1 - 1
exampleSite/config/_default/params.toml

@@ -21,7 +21,7 @@ paginateWindow = 1
 taxoPaginate = 13
 taxoPaginate = 13
 taxoGroupByDate = "2006" # "2006-01": group by month, "2006": group by year
 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
 # comment
 enableComment = true
 enableComment = true

+ 8 - 8
exampleSite/content/_index.md

@@ -13,18 +13,18 @@ titleColor:
 textColor:
 textColor:
 spaceBetweenTitleText: 25
 spaceBetweenTitleText: 25
 buttons:
 buttons:
-  - link: /about
+  - link: /docs/gettingstarted/quickstart
     text: GET STARTED
     text: GET STARTED
     color: primary
     color: primary
   - link: https://github.com/zzossig/hugo-theme-zdoc
   - link: https://github.com/zzossig/hugo-theme-zdoc
     text: DOWNLOAD
     text: DOWNLOAD
     color: default
     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
 ---
 ---
 
 

+ 4 - 4
exampleSite/static/manifest.json

@@ -1,11 +1,11 @@
 {
 {
   "manifest_version": 2,
   "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",
   "version": "1.0.0",
   "default_locale": "en",
   "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": [
   "icons": [
     {
     {
       "src": "favicon/android-icon-36x36.png",
       "src": "favicon/android-icon-36x36.png",

+ 1 - 1
layouts/partials/footer/footer.html

@@ -7,7 +7,7 @@
           {{ with $.Site.Copyright }}{{ replace . "{year}" now.Year | markdownify}}{{ end }}
           {{ with $.Site.Copyright }}{{ replace . "{year}" now.Year | markdownify}}{{ end }}
         </p>
         </p>
         {{ if $.Param "showPoweredBy" }}
         {{ 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 }}
         {{ end }}
       </div>
       </div>
     </div>
     </div>

+ 4 - 48
layouts/partials/head/scripts.html

@@ -12,6 +12,9 @@
 <script>
 <script>
   "use strict";
   "use strict";
 
 
+  {{ $permalink := .Permalink }}
+  var permalink = JSON.parse({{ $permalink | jsonify }});
+
   window.onload = function() {
   window.onload = function() {
     // ========================== expand ==========================
     // ========================== expand ==========================
     var expandBtn = document.querySelectorAll('.expand__button');
     var expandBtn = document.querySelectorAll('.expand__button');
@@ -302,44 +305,6 @@
 
 
 
 
   // ========================== search ==========================
   // ========================== 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 searchResults = null;
     var searchMenu = null;
     var searchMenu = null;
     var searchText = null;
     var searchText = null;
@@ -349,17 +314,8 @@
 
 
     var fuse = null;
     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();
       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.setRequestHeader('Content-Type', 'application/json; charset=utf-8');
       xhr.onload = function () {
       xhr.onload = function () {
         if (xhr.status === 200) {
         if (xhr.status === 200) {