Skip to content

Commit

Permalink
activepages need a little bit control (#1089)
Browse files Browse the repository at this point in the history
* parametrization for instant.page's feature

Now we may enabling or disabling instant.page :)

* Update baseof.html

* Update index.en.md

* Update index.zh-cn.md

* Update index.en.md

* Update index.zh-cn.md
  • Loading branch information
sabinich authored Nov 15, 2023
1 parent 686aa5b commit ff6c0fb
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,11 @@ Please open the code block below to view the complete sample configuration :(far
Trello = false
Mix = false
Mastodon = false

# instant.page config
[params.page.instantpage]
enable = false

# {{< version 0.2.0 changed >}} Comment config
[params.page.comment]
enable = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,11 @@ hugo
Trello = false
Mix = false
Mastodon = false

# instant.page 设置
[params.page.instantpage]
enable = false

# {{< version 0.2.0 changed >}} 评论系统设置
[params.page.comment]
enable = true
Expand Down
8 changes: 6 additions & 2 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@
{{- partial "head/meta.html" . -}}
{{- partial "head/link.html" . -}}
{{- partial "head/seo.html" . -}}


{{- $instantpage := .Scratch.Get "instantpage" | default dict -}}
{{- if $instantpage.enable -}}
<script src="//instant.page/5.2.0" defer type="module" integrity="sha384-jnZyxPjiipYXnSU0ygqeac2q7CVYMbh84q0uHVRRxEtvFPiQYbXWUorga2aqZJ0z"></script>
{{- end -}}

</head>

<body header-desktop="{{ .Site.Params.header.desktopMode }}" header-mobile="{{ .Site.Params.header.mobileMode }}">
Expand Down Expand Up @@ -60,4 +64,4 @@
{{- partial "assets.html" . -}}
</body>

</html>
</html>

1 comment on commit ff6c0fb

@vercel
Copy link

@vercel vercel bot commented on ff6c0fb Nov 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.