From 79701f486b0eeb8f4de22733ad8548fdbc7eb02f Mon Sep 17 00:00:00 2001 From: zzossig Date: Mon, 25 Nov 2019 01:05:01 +0900 Subject: [PATCH] exampleSite update --- exampleSite/layouts/script/about-script.html | 10 ++++------ exampleSite/layouts/script/archive-script.html | 5 +---- exampleSite/layouts/script/gallery-script.html | 5 +---- exampleSite/layouts/script/home-script.html | 5 +---- exampleSite/layouts/script/list-script.html | 5 +---- exampleSite/layouts/script/single-script.html | 5 +---- exampleSite/layouts/script/taxo-script.html | 5 +---- layouts/index.webmanifest | 4 ++-- 8 files changed, 12 insertions(+), 32 deletions(-) diff --git a/exampleSite/layouts/script/about-script.html b/exampleSite/layouts/script/about-script.html index a5e1ba3..0010344 100644 --- a/exampleSite/layouts/script/about-script.html +++ b/exampleSite/layouts/script/about-script.html @@ -11,6 +11,7 @@ {{ $searchLanguages := .Site.Params.searchLanguages }} var searchLanguages = JSON.parse({{ $searchLanguages | jsonify }}); var baseurl = "{{ "/" | relLangURL }}"; + if (!searchLanguages) { searchLanguages = ['en']; } @@ -23,16 +24,13 @@ function endsWith(str, suffix) { return str.indexOf(suffix, str.length - suffix.length) !== -1; } - + function initLunr() { if (!endsWith(baseurl, "/")) { baseurl = baseurl + '/'; - } - if (baseurl.charAt(0) === '/') { - baseurl = baseurl.slice(1); - } + }; - $.getJSON(baseurl + "index.json") + $.getJSON("/theme/hugo-theme-zzo" + baseurl + "index.json") .done(function (index) { pagesIndex = index; lunrIndex = lunr(function () { diff --git a/exampleSite/layouts/script/archive-script.html b/exampleSite/layouts/script/archive-script.html index 407e7e1..5d0dcbd 100644 --- a/exampleSite/layouts/script/archive-script.html +++ b/exampleSite/layouts/script/archive-script.html @@ -29,11 +29,8 @@ if (!endsWith(baseurl, "/")) { baseurl = baseurl + '/'; }; - if (baseurl.charAt(0) === '/') { - baseurl = baseurl.slice(1); - } - $.getJSON(baseurl + "index.json") + $.getJSON("/theme/hugo-theme-zzo" + baseurl + "index.json") .done(function (index) { pagesIndex = index; lunrIndex = lunr(function () { diff --git a/exampleSite/layouts/script/gallery-script.html b/exampleSite/layouts/script/gallery-script.html index 4ab6b4a..d8cc833 100644 --- a/exampleSite/layouts/script/gallery-script.html +++ b/exampleSite/layouts/script/gallery-script.html @@ -137,11 +137,8 @@ if (!endsWith(baseurl, "/")) { baseurl = baseurl + '/'; }; - if (baseurl.charAt(0) === '/') { - baseurl = baseurl.slice(1); - } - $.getJSON(baseurl + "index.json") + $.getJSON("/theme/hugo-theme-zzo" + baseurl + "index.json") .done(function (index) { pagesIndex = index; lunrIndex = lunr(function () { diff --git a/exampleSite/layouts/script/home-script.html b/exampleSite/layouts/script/home-script.html index 50e7bb1..3ef9979 100644 --- a/exampleSite/layouts/script/home-script.html +++ b/exampleSite/layouts/script/home-script.html @@ -31,11 +31,8 @@ if (!endsWith(baseurl, "/")) { baseurl = baseurl + '/'; }; - if (baseurl.charAt(0) === '/') { - baseurl = baseurl.slice(1); - } - $.getJSON(baseurl + "index.json") + $.getJSON("/theme/hugo-theme-zzo" + baseurl + "index.json") .done(function (index) { pagesIndex = index; lunrIndex = lunr(function () { diff --git a/exampleSite/layouts/script/list-script.html b/exampleSite/layouts/script/list-script.html index 50e7bb1..3ef9979 100644 --- a/exampleSite/layouts/script/list-script.html +++ b/exampleSite/layouts/script/list-script.html @@ -31,11 +31,8 @@ if (!endsWith(baseurl, "/")) { baseurl = baseurl + '/'; }; - if (baseurl.charAt(0) === '/') { - baseurl = baseurl.slice(1); - } - $.getJSON(baseurl + "index.json") + $.getJSON("/theme/hugo-theme-zzo" + baseurl + "index.json") .done(function (index) { pagesIndex = index; lunrIndex = lunr(function () { diff --git a/exampleSite/layouts/script/single-script.html b/exampleSite/layouts/script/single-script.html index a7953d4..b12635d 100644 --- a/exampleSite/layouts/script/single-script.html +++ b/exampleSite/layouts/script/single-script.html @@ -103,11 +103,8 @@ if (!endsWith(baseurl, "/")) { baseurl = baseurl + '/'; }; - if (baseurl.charAt(0) === '/') { - baseurl = baseurl.slice(1); - } - $.getJSON(baseurl + "index.json") + $.getJSON("/theme/hugo-theme-zzo" + baseurl + "index.json") .done(function (index) { pagesIndex = index; lunrIndex = lunr(function () { diff --git a/exampleSite/layouts/script/taxo-script.html b/exampleSite/layouts/script/taxo-script.html index 407e7e1..5d0dcbd 100644 --- a/exampleSite/layouts/script/taxo-script.html +++ b/exampleSite/layouts/script/taxo-script.html @@ -29,11 +29,8 @@ if (!endsWith(baseurl, "/")) { baseurl = baseurl + '/'; }; - if (baseurl.charAt(0) === '/') { - baseurl = baseurl.slice(1); - } - $.getJSON(baseurl + "index.json") + $.getJSON("/theme/hugo-theme-zzo" + baseurl + "index.json") .done(function (index) { pagesIndex = index; lunrIndex = lunr(function () { diff --git a/layouts/index.webmanifest b/layouts/index.webmanifest index dd91dbf..1ff1499 100644 --- a/layouts/index.webmanifest +++ b/layouts/index.webmanifest @@ -5,11 +5,11 @@ "theme_color": "#FF6188", "background_color": "#2D2A2E", "icons": [{ - "src": "logo-192.png", + "src": "{{ "logo-192.png" | relURL }}", "sizes": "192x192", "type": "image/png" }, { - "src": "logo-512.png", + "src": "{{ "logo-512.png" | relURL }}", "sizes": "512x512", "type": "image/png" }],