Skip to content

Commit

Permalink
fix: move data-layout and data-section attributes from .hb-main to <b…
Browse files Browse the repository at this point in the history
…ody> element (#184)
  • Loading branch information
razonyang committed Mar 4, 2024
1 parent 90e7557 commit f5a2ba5
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions hugo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ path = "github.com/gohugoio/hugo-mod-bootstrap-scss/v5"
[params.hugopress.modules.hb.attributes.document]
cacheable = true

[params.hugopress.modules.hb.attributes.body]

[params.hugopress.modules.hb.attributes.hb-main]

[params.hugopress.modules.hb.attributes.hb-alias-refresh-meta]
Expand Down
8 changes: 8 additions & 0 deletions layouts/partials/hugopress/modules/hb/attributes/body.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{{- $attrs := newScratch }}
{{- with .Page.Layout }}
{{- $attrs.Set "data-layout" . }}
{{- end }}
{{- with .Page.Section }}
{{- $attrs.Set "data-section" . }}
{{- end }}
{{- return $attrs.Values }}
6 changes: 0 additions & 6 deletions layouts/partials/hugopress/modules/hb/attributes/hb-main.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,4 @@
{{- end }}
{{- end }}
{{- $attrs.Set "class" (cond $fullWidth "hb-main container-fluid" "hb-main container") }}
{{- with .Page.Layout }}
{{- $attrs.Set "data-layout" . }}
{{- end }}
{{- with .Page.Section }}
{{- $attrs.Set "data-section" . }}
{{- end }}
{{- return $attrs.Values }}

0 comments on commit f5a2ba5

Please sign in to comment.