Add page kind classes
This commit is contained in:
10
README.md
10
README.md
@@ -852,6 +852,8 @@ These optional CSS names can be defined how you want:
|
||||
<dd>Applied to the title of expired pages in the list and term layouts.</dd>
|
||||
<dt><code>.paige-future</code></dt>
|
||||
<dd>Applied to the title of future pages in the list and term layouts.</dd>
|
||||
<dt><code>.paige-home</code></dt>
|
||||
<dd>Appears with <code>.paige-article</code> for a page with kind "home".</dd>
|
||||
<dt><code>.paige-metadata</code></dt>
|
||||
<dd>The page metadata section.</dd>
|
||||
<dt><code>.paige-modified</code></dt>
|
||||
@@ -860,10 +862,18 @@ These optional CSS names can be defined how you want:
|
||||
<dd>A page in the pages in the list and term layouts.</dd>
|
||||
<dt><code>.paige-published</code></dt>
|
||||
<dd>Applied to the title of published pages in the list and term layouts.</dd>
|
||||
<dt><code>.paige-section</code></dt>
|
||||
<dd>Appears with <code>.paige-article</code> for a page with kind "section".</dd>
|
||||
<dt><code>.paige-single</code></dt>
|
||||
<dd>Appears with <code>.paige-article</code> for a page with kind "page".</dd>
|
||||
<dt><code>.paige-summary</code></dt>
|
||||
<dd>The page summary.</dd>
|
||||
<dt><code>.paige-reading-time</code></dt>
|
||||
<dd>The page reading time.</dd>
|
||||
<dt><code>.paige-taxonomy</code></dt>
|
||||
<dd>Appears with <code>.paige-article</code> for a page with kind "taxonomy".</dd>
|
||||
<dt><code>.paige-term</code></dt>
|
||||
<dd>Appears with <code>.paige-article</code> for a page with kind "term".</dd>
|
||||
<dt><code>.paige-terms-inner</code></dt>
|
||||
<dd>The page terms.</dd>
|
||||
<dt><code>.paige-terms-outer</code></dt>
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
{{ $stretch := $page.Params.paige.home.image.stretch }}
|
||||
|
||||
<article class="paige-article">
|
||||
<article class="paige-article paige-home">
|
||||
<div class="align-items-center d-flex flex-column mb-0">
|
||||
{{ partial "paige/metadata.html" $page }}
|
||||
|
||||
|
@@ -36,6 +36,20 @@
|
||||
{{ $class = $class | append "paige-published" }}
|
||||
{{ end }}
|
||||
|
||||
{{ with $page.Kind }}
|
||||
{{ if eq . "home" }}
|
||||
{{ $class = $class | append "paige-home" }}
|
||||
{{ else if eq . "section" }}
|
||||
{{ $class = $class | append "paige-section" }}
|
||||
{{ else if eq . "page" }}
|
||||
{{ $class = $class | append "paige-single" }}
|
||||
{{ else if eq . "taxonomy" }}
|
||||
{{ $class = $class | append "paige-taxonomy" }}
|
||||
{{ else if eq . "term" }}
|
||||
{{ $class = $class | append "paige-term" }}
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $class = delimit ($class | uniq) " " }}
|
||||
|
||||
<article class="{{ $class }}">
|
||||
|
Reference in New Issue
Block a user