♻️ Let heti code follow option

This commit is contained in:
zhbaor 2023-01-12 17:08:56 +08:00
parent 6a227b136d
commit e66910d64c
2 changed files with 9 additions and 0 deletions

View file

@ -78,8 +78,10 @@ document.addEventListener("scroll", () => {
}).then((html_string) => {
const parser = new DOMParser();
const next_page = parser.parseFromString(html_string, "text/html");
{{ if .Site.Params.heti }}
const heti = new Heti(next_page);
heti.autoSpacing();
{{ end }}
const rows = next_page.querySelectorAll(".moment-row");
const container = document.querySelector(".page > .container");
rows.forEach((r) => {
@ -97,7 +99,10 @@ document.addEventListener("scroll", () => {
</script>
{{ end }}
{{ if .Site.Params.heti }}
<script>
const heti = new Heti(document);
heti.autoSpacing();
</script>
{{ end }}

View file

@ -55,8 +55,12 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/pangu/4.0.7/pangu.min.js"></script>
{{ end }}
{{ if .Site.Params.heti }}
<link rel="stylesheet" href="/style/heti.min.css">
<script src="/scripts/heti-addon.min.js"></script>
{{ end }}
<!-- website title -->
<title>{{ .Site.Params.title }}</title>