- {{ $pages := (where .Site.RegularPages "Section" "!=" "talks") }}
+ {{ $pages := (where (where .Site.RegularPages "Type" "!=" "about") "Section" "!=" "talks") }}
{{ $paginator := .Paginate ($pages.GroupByDate (.Site.Params.archiveGroupByDate | default "2006")) .Site.Params.archivePaginate }}
{{ range ($paginator).PageGroups }}
diff --git a/layouts/partials/head/scripts.html b/layouts/partials/head/scripts.html
index 2edd5ef..7d61a3e 100644
--- a/layouts/partials/head/scripts.html
+++ b/layouts/partials/head/scripts.html
@@ -107,7 +107,8 @@
tocElem.querySelectorAll('a').forEach(function (elem) {
elem.classList.remove('active');
});
- tocElem.querySelector('a[href="#' + id + '"]').classList.add('active');
+ tocElem.querySelector('a[href="#' + id + '"]') ?
+ tocElem.querySelector('a[href="#' + id + '"]').classList.add('active') : null;
tableOfContentsElem.querySelectorAll('ul > li').forEach(function (liElem) {
liElem.querySelectorAll('ul').forEach(function (ulElem) {
@@ -116,12 +117,13 @@
});
var curElem = tableOfContentsElem.querySelector(`[href="#${id}"]`);
- if (curElem.nextElementSibling) {
+ if (curElem && curElem.nextElementSibling) {
curElem.nextElementSibling.style.display = 'block';
}
+ getParents(curElem, 'ul') ?
getParents(curElem, 'ul').forEach(function (elem) {
elem.style.display = 'block';
- });
+ }) : null;
}
}
}) : null;
@@ -148,7 +150,8 @@
tocElem.querySelectorAll('a').forEach(function (elem) {
elem.classList.remove('active');
});
- tocElem.querySelector('a[href="#' + id + '"]').classList.add('active');
+ tocElem.querySelector('a[href="#' + id + '"]') ?
+ tocElem.querySelector('a[href="#' + id + '"]').classList.add('active') : null;
tableOfContentsElem.querySelectorAll('ul > li').forEach(function (liElem) {
liElem.querySelectorAll('ul').forEach(function (ulElem) {
@@ -157,12 +160,13 @@
});
var curElem = tableOfContentsElem.querySelector(`[href="#${id}"]`);
- if (curElem.nextElementSibling) {
+ if (curElem && curElem.nextElementSibling) {
curElem.nextElementSibling.style.display = 'block';
}
+ getParents(curElem, 'ul') ?
getParents(curElem, 'ul').forEach(function (elem) {
elem.style.display = 'block';
- });
+ }) : null;
}
}
}) : null;
@@ -338,28 +342,37 @@
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 }}
- var hasLangPostfix = location.pathname.includes("/{{.Site.Language.Lang}}");
- if (hasLangPostfix) {
- if (isSlug) {
- baseurl = location.origin + siteBaseURL.match(siteBaseChecker)[0] + "{{.Site.Language.Lang}}";
+ 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 {
- baseurl = location.origin + "/{{.Site.Language.Lang}}";
+ 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;
- }
+ }
}
- {{ else }}
- if (isSlug) {
- baseurl = location.origin + siteBaseURL.match(siteBaseChecker)[0];
- } else {
- baseurl = location.origin;
- }
{{ end }}
var searchResults = null;
diff --git a/layouts/partials/script/single-script.html b/layouts/partials/script/single-script.html
index 5a52796..7360ced 100644
--- a/layouts/partials/script/single-script.html
+++ b/layouts/partials/script/single-script.html
@@ -147,9 +147,10 @@
curElem.nextElementSibling.style.display = 'block';
}
if (curElem) {
+ getParents(curElem, 'ul') ?
getParents(curElem, 'ul').forEach(function (elem) {
elem.style.display = 'block';
- });
+ }) : null;
}
});
});
diff --git a/layouts/talks/list.html b/layouts/talks/list.html
index 6743692..5183025 100644
--- a/layouts/talks/list.html
+++ b/layouts/talks/list.html
@@ -17,25 +17,11 @@
{{ .Key }}
{{ range .Pages }}
- -
+
-
{{ .PublishDate.Format (i18n "talks-dateformat") }}
-
+ {{ .Title }}
{{ end }}