diff --git a/README.md b/README.md index 18c3b4c4..70b0327d 100644 --- a/README.md +++ b/README.md @@ -775,16 +775,60 @@ then replace that use of `paige/metadata.html` with your own design. These optional CSS classes can be defined how you want:
+
#paige-container
+
The outermost element in the body.
+
#paige-copyright
+
The copyright in the footer, if any.
+
#paige-credit
+
The credit in the footer, if any.
+
#paige-footer
+
The footer element in the container, if any.
+
#paige-header
+
The header element in the container, if any.
+
#paige-main
+
The main element in the container.
+
#paige-pages
+
The pages in the list and term layouts, if any.
+
#paige-pagination
+
The pagination links in the list and term layouts, if any.
+
.paige-article
+
The page article.
+
.paige-authors
+
The page authors, if any.
+
.paige-content
+
The page content, if any.
+
.paige-date
+
The page date, if any.
+
.paige-date-header
+
Date headers in list and term layouts.
+
.paige-description
+
The page description, if any.
.paige-draft
-
Applied to the title of draft pages in the list and term default layouts.
+
Applied to the title of draft pages in the list and term layouts.
.paige-expired
-
Applied to the title of expired pages in the list and term default layouts.
+
Applied to the title of expired pages in the list and term layouts.
.paige-future
-
Applied to the title of future pages in the list and term default layouts.
+
Applied to the title of future pages in the list and term layouts.
+
.paige-metadata
+
The page metadata section.
.paige-modified
-
Applied to the title of modified pages in the list and term default layouts.
+
Applied to the title of modified pages in the list and term layouts.
+
.paige-page
+
A page in the pages in the list and term layouts, if any.
.paige-published
-
Applied to the title of published pages in the list and term default layouts.
+
Applied to the title of published pages in the list and term layouts.
+
.paige-summary
+
The page summary, if any.
+
.paige-reading-time
+
The page reading time, if any.
+
.paige-terms-inner
+
The page terms, if any.
+
.paige-terms-outer
+
The container of the page terms, if any.
+
.paige-title
+
The page title, if any.
+
.paige-toc
+
The page table of contents, if any.
.paige-unpublished
Applied to the title of unpublished (draft, expired, future) pages in the list and term default layouts.
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index a67c5a48..350a7c73 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -13,12 +13,12 @@ {{ partial "paige/body-first.html" $page }} {{ end }} -
+
{{ partial "paige/header.html" $page }} -
+
{{ if templates.Exists "partials/paige/main-first.html" }} {{ partial "paige/main-first.html" $page }} {{ end }} diff --git a/layouts/partials/paige/article.html b/layouts/partials/paige/article.html index e3dd7ba3..54a3ad97 100644 --- a/layouts/partials/paige/article.html +++ b/layouts/partials/paige/article.html @@ -1,6 +1,34 @@ {{ $page := . }} -
+{{ $class := slice "paige-article" }} +{{ $draft := $page.Draft }} +{{ $expired := and $page.ExpiryDate (lt $page.ExpiryDate now) }} +{{ $future := and $page.PublishDate (gt $page.PublishDate now) }} +{{ $modified := and $page.PublishDate $page.Lastmod (lt $page.PublishDate $page.Lastmod) }} + +{{ if $draft }} + {{ $class = $class | append "paige-draft" "paige-unpublished" }} +{{ end }} + +{{ if $expired }} + {{ $class = $class | append "paige-expired" "paige-unpublished" }} +{{ end }} + +{{ if $future }} + {{ $class = $class | append "paige-future" "paige-unpublished" }} +{{ end }} + +{{ if $modified }} + {{ $class = $class | append "paige-modified" }} +{{ end }} + +{{ if not (or $draft $expired $future) }} + {{ $class = $class | append "paige-published" }} +{{ end }} + +{{ $class = delimit ($class | uniq) " " }} + +
{{ partial "paige/metadata.html" $page }} {{ partial "paige/toc.html" $page }} diff --git a/layouts/partials/paige/footer.html b/layouts/partials/paige/footer.html index 122c414e..8399ba5b 100644 --- a/layouts/partials/paige/footer.html +++ b/layouts/partials/paige/footer.html @@ -6,17 +6,17 @@ {{ $last := templates.Exists "partials/paige/footer-last.html" }} {{ if or $copyright $credit $first $last }} -