Skip to content

Commit

Permalink
feat: add the data-layout and data-section attributes for hb-main ele…
Browse files Browse the repository at this point in the history
…ment for styling purpose (#180)
  • Loading branch information
razonyang committed Feb 27, 2024
1 parent def7ff0 commit 6c8b086
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions layouts/partials/hugopress/modules/hb/attributes/hb-main.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- $attrs := newScratch }}
{{- $fullWidth := default (default false site.Params.hb.full_width) .Page.Params.full_width }}
{{- if reflect.IsSlice $fullWidth }}
{{- $fullWidth = in $fullWidth .Page.Section }}
Expand All @@ -7,6 +8,11 @@
{{- $fullWidth = default true .enable }}
{{- end }}
{{- end }}
{{- return dict
"class" (cond $fullWidth "hb-main container-fluid" "hb-main container")
}}
{{- $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 6c8b086

Please sign in to comment.