Use minimum header sizes
This commit is contained in:
@@ -56,7 +56,7 @@ disable_sections = true
|
||||
|
||||
{{< paige/image alt="Landscape" breakpoints=true class="mt-3 object-fit-cover rounded-4 shadow" fetchpriority="high" height="20rem" loading="eager" process="webp" src="https://images.unsplash.com/photo-1490604001847-b712b0c2f967?w=1296" width="100%" >}}
|
||||
|
||||
<h1 class="fw-bold text-center" style="margin-top: 2rem">An advanced Hugo theme</h1>
|
||||
<h1 class="fw-bold h1 text-center" style="margin-top: 2rem">An advanced Hugo theme</h1>
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="justify-content-center row">
|
||||
|
@@ -107,7 +107,7 @@
|
||||
{{ range $subpage := $subpages }}
|
||||
{{ if not (.Param "paige.exclude_feeds") }}
|
||||
<entry>
|
||||
{{ $content := partial "paige/func-minify.html" (dict "content" .Content) }}
|
||||
{{ $content := partial "paige/func-content.html" $subpage }}
|
||||
{{ $external := and .Params.link (not (.Param "paige.feeds.disable_link")) | not | not }}
|
||||
{{ $id := printf "tag:%s,%s:%s" (urls.Parse site.BaseURL).Host (.PublishDate.Format "2006-01-02") .RelPermalink }}
|
||||
{{ $lastmod := .Lastmod.Format $date }}
|
||||
@@ -117,6 +117,8 @@
|
||||
|
||||
{{ $link := cond $external .Params.link .Permalink }}
|
||||
|
||||
{{ $content = partial "paige/func-minify.html" (dict "content" $content) }}
|
||||
|
||||
{{ if and $content $external }}
|
||||
{{ $text := or (.Param "paige.feeds.page_link" | markdownify) "⏎" }}
|
||||
|
||||
|
@@ -97,7 +97,7 @@
|
||||
<item>
|
||||
{{ $author := "" }}
|
||||
{{ $authors := partial "paige/func-authors.html" . }}
|
||||
{{ $description := partial "paige/func-minify.html" (dict "content" .Content) }}
|
||||
{{ $description := partial "paige/func-content.html" $subpage }}
|
||||
{{ $external := and .Params.link (not (.Param "paige.feeds.disable_link")) | not | not }}
|
||||
{{ $guid := printf "tag:%s,%s:%s" (urls.Parse site.BaseURL).Host (.PublishDate.Format "2006-01-02") (cond (.Params.id | not) .RelPermalink .Params.id) }}
|
||||
{{ $published := .PublishDate.Format $date }}
|
||||
@@ -105,6 +105,8 @@
|
||||
|
||||
{{ $link := cond $external .Params.link .Permalink }}
|
||||
|
||||
{{ $description = partial "paige/func-minify.html" (dict "content" $description) }}
|
||||
|
||||
{{ with $authors }}
|
||||
{{ $primary := index . 0 }}
|
||||
|
||||
|
31
layouts/partials/paige/func-content.html
Normal file
31
layouts/partials/paige/func-content.html
Normal file
@@ -0,0 +1,31 @@
|
||||
{{ $page := . }}
|
||||
|
||||
{{ $result := $page.Content }}
|
||||
|
||||
{{ $matches := findRESubmatch "<h([1-6])[ >]" $result }}
|
||||
|
||||
{{ with $matches }}
|
||||
{{ $max := 0 }}
|
||||
|
||||
{{ range . }}
|
||||
{{ $level := index . 1 | int }}
|
||||
|
||||
{{ if gt $level $max }}
|
||||
{{ $max = $level }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if and $max (lt $max 6) }}
|
||||
{{ $shift := sub 6 $max }}
|
||||
|
||||
{{ range seq $max | collections.Reverse }}
|
||||
{{ $old := . }}
|
||||
{{ $new := add $old $shift }}
|
||||
|
||||
{{ $result = replaceRE (printf "<h%d([ >])" $old) (printf "<h%d$1" $new) $result }}
|
||||
{{ $result = replaceRE (printf "</h%d>" $old) (printf "</h%d>" $new) $result }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ return $result }}
|
@@ -1,7 +1,7 @@
|
||||
{{ $page := . }}
|
||||
|
||||
{{ $class := slice }}
|
||||
{{ $content := $page.Content }}
|
||||
{{ $content := partial "paige/func-content.html" $page }}
|
||||
{{ $draft := $page.Draft }}
|
||||
{{ $expired := and $page.ExpiryDate (lt $page.ExpiryDate now) }}
|
||||
{{ $future := and $page.PublishDate (gt $page.PublishDate now) }}
|
||||
|
Reference in New Issue
Block a user