♻️ Let heti code follow option
This commit is contained in:
parent
6a227b136d
commit
e66910d64c
2 changed files with 9 additions and 0 deletions
|
@ -78,8 +78,10 @@ document.addEventListener("scroll", () => {
|
||||||
}).then((html_string) => {
|
}).then((html_string) => {
|
||||||
const parser = new DOMParser();
|
const parser = new DOMParser();
|
||||||
const next_page = parser.parseFromString(html_string, "text/html");
|
const next_page = parser.parseFromString(html_string, "text/html");
|
||||||
|
{{ if .Site.Params.heti }}
|
||||||
const heti = new Heti(next_page);
|
const heti = new Heti(next_page);
|
||||||
heti.autoSpacing();
|
heti.autoSpacing();
|
||||||
|
{{ end }}
|
||||||
const rows = next_page.querySelectorAll(".moment-row");
|
const rows = next_page.querySelectorAll(".moment-row");
|
||||||
const container = document.querySelector(".page > .container");
|
const container = document.querySelector(".page > .container");
|
||||||
rows.forEach((r) => {
|
rows.forEach((r) => {
|
||||||
|
@ -97,7 +99,10 @@ document.addEventListener("scroll", () => {
|
||||||
</script>
|
</script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
|
{{ if .Site.Params.heti }}
|
||||||
<script>
|
<script>
|
||||||
const heti = new Heti(document);
|
const heti = new Heti(document);
|
||||||
heti.autoSpacing();
|
heti.autoSpacing();
|
||||||
</script>
|
</script>
|
||||||
|
{{ end }}
|
||||||
|
|
|
@ -55,8 +55,12 @@
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pangu/4.0.7/pangu.min.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pangu/4.0.7/pangu.min.js"></script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
|
{{ if .Site.Params.heti }}
|
||||||
<link rel="stylesheet" href="/style/heti.min.css">
|
<link rel="stylesheet" href="/style/heti.min.css">
|
||||||
<script src="/scripts/heti-addon.min.js"></script>
|
<script src="/scripts/heti-addon.min.js"></script>
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
|
|
||||||
<!-- website title -->
|
<!-- website title -->
|
||||||
<title>{{ .Site.Params.title }}</title>
|
<title>{{ .Site.Params.title }}</title>
|
||||||
|
|
Loading…
Add table
Reference in a new issue