Skip to content

Commit

Permalink
feat(giscus): add the giscus.lazyLoading parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
razonyang committed Jul 28, 2022
1 parent 2907d48 commit ccedd3a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions exampleSite/config/_default/params.toml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ viewer = true # Image Viewer
# reactions = false # Disable reactions.
# metadata = true # Emit discussion metadata.
# lang = "en" # Specify language, default to site language.
# lazyLoading = false # Default to true.

[search]
paginate = 5 # Pagination. Default to 10.
Expand Down
1 change: 1 addition & 0 deletions exampleSite/content/docs/widgets/comments/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ disqusShortname = "yourdiscussshortname"
| `giscus.reactions` | Boolean | `true` | Turn on/off the reactions.
| `giscus.metadata` | Boolean | `false` | Emit discussion metadata.
| `giscus.lang` | String | - | Specify language, default to site language.
| `giscus.lazyLoading` | Boolean | `true` | Enable lazy loading.

## Custom Comments Widget

Expand Down
1 change: 1 addition & 0 deletions exampleSite/content/docs/widgets/comments/index.zh-hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ disqusShortname = "yourdiscussshortname"
| `giscus.reactions` | Boolean | `true` | Turn on/off the reactions.
| `giscus.metadata` | Boolean | `false` | Emit discussion metadata.
| `giscus.lang` | String | - | Specify language, default to site language.
| `giscus.lazyLoading` | Boolean | `true` | Enable lazy loading.

## 自定义评论小部件

Expand Down
1 change: 1 addition & 0 deletions exampleSite/content/docs/widgets/comments/index.zh-hant.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ disqusShortname = "yourdiscussshortname"
| `giscus.reactions` | Boolean | `true` | Turn on/off the reactions.
| `giscus.metadata` | Boolean | `false` | Emit discussion metadata.
| `giscus.lang` | String | - | Specify language, default to site language.
| `giscus.lazyLoading` | Boolean | `true` | Enable lazy loading.

## 自定義評論小部件

Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/post/comments/giscus.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
data-input-position="{{ default "top" .inputPosition }}"
data-theme="{{ default "preferred_color_scheme" .theme }}"
data-lang="{{ $lang }}"
data-loading="lazy"
{{ with default true .lazyLoading }}data-loading="lazy"{{ end }}
crossorigin="anonymous"
async>
</script>
Expand Down

0 comments on commit ccedd3a

Please sign in to comment.