Skip to content

Commit

Permalink
theme(fix): add level option to headline partial
Browse files Browse the repository at this point in the history
closes #898

Signed-off-by: Patrick Kollitsch <[email protected]>
  • Loading branch information
davidsneighbour committed May 5, 2024
1 parent 2d18ee4 commit aeaf01b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions layouts/partials/content/components/headline.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- $post := . -}}
{{- $headerlevel := "2" -}}
{{- $post := .post -}}
{{- $headerlevel := .level | default "2" -}}
{{- fmt.Printf "<h%s class=\"post-title text-truncate text-truncate-2\">" $headerlevel | safe.HTML -}}
<a href="{{- $post.Permalink -}}" title="{{- $post.Title -}}">
{{- $post.Title | transform.Markdownify -}}
Expand Down
3 changes: 2 additions & 1 deletion layouts/partials/content/post-preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
{{- /* MARK: Headline
*/ -}}
{{- if ne $config.headline false -}}
{{- partials.Include "content/components/headline.html" $post -}}
{{- $options := dict "post" $post "level" "3" -}}
{{- partials.Include "content/components/headline.html" $options -}}
{{- end -}}

{{- /* MARK: Headline-Banner
Expand Down
3 changes: 2 additions & 1 deletion layouts/partials/content/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
{{- /* MARK: Headline
*/ -}}
{{- if ne $config.headline false -}}
{{- partials.Include "content/components/headline.html" $post -}}
{{- $options := dict "post" $post -}}
{{- partials.Include "content/components/headline.html" $options -}}
{{- end -}}

{{- /* MARK: Headline-banner
Expand Down

0 comments on commit aeaf01b

Please sign in to comment.