Skip to content

willfaught/paige

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Paige

Powerful, pliable pixel perfection. An advanced Hugo theme. Try it out.

Screenshot

Paige is designed to put your content front and center, avoiding the typical clutter. The look is seamless and smooth, scalable and readable, portable and efficient. The layout is minimal and responsive, using verticality and white space to delineate and highlight each part of the page. The implementation is flexible and extensible. It’s a versatile canvas that serves most web needs.

Features

  • Accessibility
  • Analytics
  • Atom feed
  • Authors
  • Blog
  • Bootstrap
  • Categories
  • Code shortcode
  • Comments
  • Customizable
  • Dark color scheme
  • Email shortcode
  • Facebook sharing
  • Figure shortcode
  • Gallery shortcode
  • Header links
  • Icon shortcode
  • Image pixel densities
  • Image shortcode
  • Image size breakpoints
  • Image thumbnails
  • Landing page
  • Languages
  • Light color scheme
  • Math typesetting
  • Menu
  • Minimal design
  • Quote shortcode
  • Responsive
  • Right-to-left languages
  • RSS feed
  • Safari and Firefox Reader View support
  • Search
  • Sections
  • SEO
  • Series
  • Single column
  • Social links
  • Table of contents
  • Tags
  • Twitter sharing
  • Validated with PageSpeed and Validator
  • Vimeo shortcode
  • YouTube shortcode

Community

Get started by starring and watching the project.

If you find a problem or have a suggestion, please share it by creating an issue.

If you have a fix or improvement, please share it by creating a pull request.

If you make a customization or alteration, please share it by posting code or screenshots.

If you deploy a site, please share it by posting a link.

Setup

  1. Install Hugo (the extended version, and at least 0.111.3).

    For Homebrew on Mac:

    $ brew install hugo

    For Chocolatey on Windows:

    $ choco install hugo-extended

    For Snap on Linux:

    $ sudo snap install hugo
  2. Install Dart Sass.

    For Homebrew on Mac:

    $ brew install sass/sass/sass

    For Chocolatey on Windows:

    $ choco install sass

    For Snap on Linux:

    $ sudo snap install dart-sass
  3. Create a site:

    $ hugo new site yourproject
  4. Create a post:

    $ cd yourproject
    $ hugo new yourpost.md
  5. Install the Paige module:

    $ cd yourproject
    $ hugo mod init github.com/youraccount/yourproject
    $ hugo mod get github.com/willfaught/paige@latest
  6. Import the Paige module:

    $ cd yourproject
    $ cat >>hugo.toml <<EOF
    [[module.imports]]
    path = "github.com/willfaught/paige"
    EOF
  7. Build and run the site:

    $ cd yourproject
    $ hugo server -D
  8. Update the Paige module:

    $ cd yourproject
    $ hugo mod get github.com/willfaught/paige@latest

See Hugo's installation, getting started, and module guides for more information.

See the minimal look, narrow look, narrow-and-wide look, and menu navigation only sections for common customizations.

Configure

Parameters

There is a single parameter object with sensible defaults that can be overridden in site or page parameters:

[paige]
color = "#0d6efd" # Bootstrap primary color and theme color for Safari and Windows
color_scheme = "auto" # Must be "auto", "dark", or "light"
date_format = ":date_long" # Hugo date format
external_link_new_tab = false # Open external links in new tabs
file_edit_url = "" # Example: "https://github.com/account/project/edit/master/content/%s"
keyword_style = "text" # Must be "text" or "pills"
math = false # Enable math typesetting
menu_style = "links" # Must be "links", "pills", "tabs", or "underline"
site_title = "" # Appears above the menu, above the site description, if set
site_description = "" # Appears above the menu, below the site title, if set
style = "" # CSS included at the end of the stylesheet, before style-last.css

[paige.analytics]
disable = false # Disable all analytics

[paige.analytics.beam] # See https://beamanalytics.io
token = ""

[paige.analytics.chartbeat] # See https://chartbeat.com
account_id = ""
domain = ""

[paige.analytics.clarity] # See https://clarity.microsoft.com
account_id = ""

[paige.analytics.clicky] # See https://clicky.com
account_id = ""

[paige.analytics.counter] # See https://counter.dev
account_id = ""
utc_offset = ""

[paige.analytics.fathom] # See https://usefathom.com
account_id = ""

[paige.analytics.finteza] # See https://finteza.com
account_id = ""
script_url = ""

[paige.analytics.hotjar] # See https://hotjar.com
account_id = ""

[paige.analytics.matomo] # See https://matomo.org
account_id = ""
host_url = ""

[paige.analytics.mixpanel] # See https://mixpanel.com
token = ""

[paige.analytics.pirsch] # See https://pirsch.io
identification_code = ""

[paige.analytics.plausible] # See https://plausible.io
account_id = ""

[paige.analytics.woopra] # See https://woopra.com
domain = ""

[paige.analytics.yandex] # See https://metrica.yandex.com
account_id = ""

[paige.comments]
disable = false # Disable all comments

[paige.comments.cactus] # See https://cactus.chat
account_id = ""

[paige.comments.commento] # See https://commento.io
script_url = ""

[paige.comments.graphcomment] # See https://graphcomment.com
account_id = ""

[paige.comments.hyvor] # See https://hyvor.com
account_id = ""

[paige.comments.intensedebate] # See https://intensedebate.com
account_id = ""

[paige.comments.isso] # See https://isso-comments.de
script_url = ""

[paige.comments.remark42] # See https://remark42.com
host_url = ""
site_id = ""

[paige.comments.replybox] # See https://getreplybox.com
account_id = ""

[paige.comments.utterances] # See https://utteranc.es
github_repo = ""

[paige.feed]
hide_page = false
link_to_page = false # Link to the page instead of the front matter link, if present
page_link = "⏎" # If a front matter link is present, and link_to_page is false, then link to the page with this text

[paige.feed.atom]
authors = []
# Example:
# [[paige.feed.atom.authors]]
# email = "example@example.com"
# name = "John Doe"
# url = "https://github.com/account/project"
icon = "" # Example: "/icon.webp"
logo = "" # Example: "/logo.webp"

[paige.feed.rss]
managing_editor = "" # Example: "example@example.com (John Doe)"
web_master = "" # Example: "example@example.com (John Doe)"

[paige.search]
hide_page = false

The assigned values shown are the default values.

The parameter object is accessed in site parameters as [params.paige], and in page parameters as [paige].

Parameters specific to pages:

link = "https://youtu.be/dQw4w9WgXcQ" # The reference for an anchor around the title

[paige]
pin = true # Order this page before the rest

[paige.alert]
message = "Alert!" # Markdown displayed before the page body
type = "primary" # Bootstrap alert class

Menu

An optional menu can be configured. The active menu item has a URL that is a prefix of the path of the current page. A menu item with the URL / only matches a / path.

Example configuration in yoursite/hugo.toml:

[languages.en]
weight = 10

[[languages.en.menu.main]]
identifier = "home"
name = "Home"
url = "/"
weight = 10

[[languages.en.menu.main]]
identifier = "blog"
name = "Blog"
url = "/blog/"
weight = 20

[[languages.en.menu.main]]
identifier = "life"
name = "Life"
parent = "blog"
url = "/blog/life/"
weight = 10

[[languages.en.menu.main]]
identifier = "work"
name = "Work"
parent = "blog"
url = "/blog/work/"
weight = 20

[languages.en.menu.main.params.paige]
divider_below = true

[[languages.en.menu.main]]
identifier = "interests"
name = "Interests"
parent = "blog"
url = "/blog/interests/"
weight = 30

[languages.en.menu.main.params.paige]
disabled = true

[[languages.en.menu.main]]
identifier = "tags"
name = "Tags"
url = "/tags/"
weight = 30

[[languages.en.menu.main]]
identifier = "search"
name = "Search"
url = "/search/"
weight = 40

If you intend for the menu to be sufficient for all navigation, see how to hide other navigation features.

Taxonomies

Support for authors, categories, series, and tags taxonomies is built in.

Set default to true in the front matter of an author term page for that author to be credited in regular pages that have no authors parameter. A default author must be referenced at least once explicitly in a regular page.

The email and url parameters in the front matter of an author term page are used in feeds if present.

Layouts

Cloud

The paige/cloud layout provides a link cloud for sub-pages.

Example configuration in yoursite/content/tags/_index.md:

layout = "paige/cloud"

Search

The paige/search layout provides a search page.

Example configuration in yoursite/hugo.toml:

[outputs]
home = ["atom", "html", "paige-search", "rss"]

Example configuration in yoursite/content/search.md:

layout = "paige/search"
title = "Search"

Shortcodes

Code

The paige/code shortcode provides highlighted code.

{{< paige/code
    lang=""
    options="" >}}

{{< /paige/code >}}

Inner content: Required. String. The code.

Parameters:

lang
Optional. Position 0. String. Chroma language code. Default is plaintext.
options
Optional. String. Hugo highlight options.

Email

The paige/email shortcode hides e-mail addresses from robots.

{{< paige/email
    address="" >}}

{{< /paige/email >}}

Inner content: Required. String. Markdown. The content.

Parameters:

address
Required. Position 0. String. The e-mail address.

Figure

The paige/figure shortcode provides a figure.

{{< paige/figure
    caption=""
    float=""
    height=""
    horizontal=""
    maxwidth=""
    number=0
    numbered=false
    vertical=""
    width="" >}}

{{< /paige/figure >}}

Inner content: Required. String. Markdown. The content.

Parameters:

caption
Optional. Position 0. String. Markdown. Descriptive text below the content.
float
Optional. String. Float to one side of its container. Must be start or end.
height
Optional. String. CSS value. Total height.
horizontal
Optional. String. Horizontal alignment. Must be start, center, or end. Default is center.
maxwidth
Optional. String. CSS value. Maximum total width.
number
Optional. Integer or string. Figure number. Displayed with the caption.
numbered
Optional. Boolean. Number the figure automatically. Displayed with the caption.
vertical
Optional. String. Vertical alignment. Must be start, center, or end. Default is center.
width
Optional. String. CSS value. Total width.

Gallery

The paige/gallery shortcode provides an arrangement of images.

{{< paige/gallery
    align=""
    breakpoints=false
    class=""
    densities=""
    fetchpriority=""
    height=""
    images=""
    justify=""
    linked=""
    loading=""
    maxheight=""
    maxwidth=""
    process=""
    style=""
    type=""
    width="" >}}

{{< /paige/gallery >}}

Inner content: Optional. String. HTML. The images.

Parameters:

align
Optional. String. Cross axis alignment. Must be baseline, center, end, start, or stretch.
breakpoints
Optional. Boolean. Whether to generate copies of the image sized to each Bootstrap breakpoint. Must not use with densities.
class
Optional. String. Image class. Merged with implementation.
densities
Optional. String. Float numbers suffixed with an "x", delimited by spaces. The pixel densities of the image to generate. There must be at least two. The largest density matches the original image. Examples are 1x 2x, 1x 1.5x 2x 2.5x 3x, and 0.5x 1.33x 6x 10x. Must not use with breakpoints.
fetchpriority
Optional. String. Must be high or low.
height
Optional. String. CSS value. Image height.
images
Optional. Position 0. String. Page, site, or remote images glob. Default is all image page resources.
justify
Optional. String. Main axis space distribution. Must be around, between, center, end, evenly, or start.
linked
Optional. String. Hugo image processing methods and options, mixed together, for the linked image. If no method is specified, resize is used. If no image dimensions are specified, the originals are used. If it is unprocessed, it is unprocessed. If it is default, the default options are used.
loading
Optional. String. Must be eager (default) or lazy.
maxheight
Optional. String. CSS value. Maximum image height.
maxwidth
Optional. String. CSS value. Maximum image width.
process
Optional. String. Hugo image processing methods and options, mixed together, for the displayed image. If no method is specified, resize is used. If no image dimensions are specified, the originals are used. If it is default, the default options are used.
style
Optional. String. CSS. Image style. Merged with implementation.
type
Optional. String. Type of layout. Must be grid or rows (default).
width
Optional. String. CSS value. Image width.

Icon

The paige/icon shortcode provides a web font icon.

{{< paige/icon
    class=""
    title=""
    url="" >}}

Inner content: None.

Parameters:

class
Required. Position 0. String. <i> class. Example: bi bi-github.
title
Optional. String. The screen reader description and anchor title. Example: GitHub.
url
Optional. String. URL. Example: https://github.com/account/project. E-mails in URLs with a mailto: scheme are protected from web crawlers.

Image

The paige/image shortcode provides an image.

{{< paige/image
    alt=""
    breakpoints=false
    class=""
    densities=""
    fetchpriority=""
    height=""
    link=""
    linked=""
    loading=""
    maxheight=""
    maxwidth=""
    process=""
    sizes=""
    src=""
    srcset=""
    style=""
    title=""
    width="" >}}

Inner content: None.

Parameters:

alt
Optional. String. Plain text. Image alt.
breakpoints
Optional. Boolean. Whether to generate copies of the image sized to each Bootstrap breakpoint. Must not use with densities, sizes, or srcset.
class
Optional. String. Class attribute value.
densities
Optional. String. Float numbers suffixed with an "x", delimited by spaces. The pixel densities of the image to generate. There must be at least two. The largest density matches the original image. Examples are 1x 2x, 1x 1.5x 2x 2.5x 3x, and 0.5x 1.33x 6x 10x. Must not use with breakpoints, sizes, or srcset.
fetchpriority
Optional. String. Must be high or low.
height
Optional. String. CSS value. Image height.
link
Optional. String. URL. Image link. Must not use with linked.
linked
Optional. String. Hugo image processing methods and options, mixed together, for the linked image. If no method is specified, resize is used. If no image dimensions are specified, the originals are used. If it is unprocessed, it is unprocessed. If it is default, the default options are used. Must not use with link.
loading
Optional. String. Must be eager (default) or lazy.
maxheight
Optional. String. CSS value. Image maximum height.
maxwidth
Optional. String. CSS value. Image maximum width.
process
Optional. String. Hugo image processing methods and options, mixed together, for the displayed image. If no method is specified, resize is used. If no image dimensions are specified, the originals are used. If it is default, the default options are used.
sizes
Optional. String. Image sizes. Must not be set with breakpoints or densities.
src
Required. Position 0. String. URL. Image source.
srcset
Optional. String. Image srcset. Must not be set with breakpoints or densities.
style
Optional. String. CSS. Image style. Merged with implementation.
title
Optional. String. Plain text. Image title.
width
Optional. String. CSS value. Image width.

Quote

The paige/quote shortcode provides a quotation.

{{< paige/quote
    cite="" >}}

{{< /paige/quote >}}

Inner content: Required. String. Markdown. The quotation.

Parameters:

cite
Optional. String. Plain text. Citation.

Vimeo

The paige/vimeo shortcode provides a Vimeo video.

{{< paige/vimeo
    autopause=false
    autoplay=false
    background=false
    byline=false
    color=""
    controls=false
    description=""
    dnt=false
    fullscreen=false
    height=""
    keyboard=false
    loop=false
    maxheight=""
    maxwidth=""
    muted=false
    pip=false
    playsinline=false
    portrait=false
    quality=""
    speed=false
    texttrack=false
    time=""
    title=false
    transparent=false
    video=""
    width="" >}}

Inner content: None.

Parameters:

autopause
Optional. Boolean. Enable playing more than one Vimeo video on the same page. Default is true.
autoplay
Optional. Boolean. Autoplay the video. Default is false.
background
Optional. Boolean. Autoplay the video. Hide the controls. Loop the video. Mute the video. Default is false.
byline
Optional. Boolean. Show the author. Default is configured per video.
color
Optional. String. Hex code. Control color. Default is 00adef.
controls
Optional. Boolean. Show the controls. Default is true.
description
Optional. String. Plain text. Screen reader content. Default is Vimeo video.
dnt
Optional. Boolean. Do not track session data. Default is false.
fullscreen
Optional. Boolean. Enable full screen. Default is true.
height
Optional. String. CSS value. Video height.
keyboard
Optional. Boolean. Enable keyboard input. Default is true.
loop
Optional. Boolean. Loop the video. Default is false.
maxheight
Optional. String. CSS value. Video maximum height.
maxwidth
Optional. String. CSS value. Video maximum width.
muted
Optional. Boolean. Mute the video. Default is false.
pip
Optional. Boolean. Show the picture-in-picture control. Default is false.
playsinline
Optional. Boolean. Play inline instead of full screen on mobile devices. Default is true.
portrait
Optional. Boolean. Show the author's profile image. Default is configured per video.
quality
Optional. String. The resolution. Must be auto, 240p, 360p, 540p, 720p, 1080p, 2k, or 4k. Default is auto.
speed
Optional. Boolean. Show the speed controls. Default is false.
texttrack
Optional. String. Language code and optionally a locale code (e.g. en, en-US). Use the corresponding subtitles. Default is false.
time
Optional. String. Duration (e.g. 0m, 1m2s). Start time. Default is 0m.
title
Optional. Boolean. Show the title. Default is configured per video.
transparent
Optional. Boolean. Use a transparent background instead of a black one. Default is true.
video
Optional. Position 0. String. Video ID.
width
Optional. String. CSS value. Video width.

See Vimeo documentation for more detail.

YouTube

The paige/youtube shortcode provides a YouTube video.

{{< paige/youtube
    autoplay=false
    controls=false
    description=""
    end=0
    fullscreen=false
    height=""
    list=""
    loop=false
    maxheight=""
    maxwidth=""
    mute=false
    start=0
    video=""
    width="" >}}

Inner content: None.

Parameters:

autoplay
Optional. Boolean. Automatically play the video.
controls
Optional. Boolean. Show video controls. Default is true.
description
Optional. String. Plain text. Screen reader content. Default is YouTube video.
end
Optional. Integer. Elapsed seconds. Stop the video here.
fullscreen
Optional. Boolean. Enable full screen. Default is true.
height
Optional. String. CSS value. Video height.
list
Optional. String. Playlist ID.
loop
Optional. Boolean. Loop the video.
maxheight
Optional. String. CSS value. Video maximum height.
maxwidth
Optional. String. CSS value. Video maximum width.
mute
Optional. Boolean. Mute the video.
start
Optional. Integer. Elapsed seconds. Start the video here.
video
Optional. Position 0. String. Video ID.
width
Optional. String. CSS value. Video width.

Customize

Include

If this file exists It is included at
yoursite/layouts/partials/paige/body-first.html The beginning of the body tag
yoursite/layouts/partials/paige/body-last.html The end of the body tag
yoursite/layouts/partials/paige/footer-first.html The beginning of the footer tag
yoursite/layouts/partials/paige/footer-last.html The end of the footer tag
yoursite/layouts/partials/paige/head-first.html The beginning of the head tag
yoursite/layouts/partials/paige/head-last.html The end of the head tag
yoursite/layouts/partials/paige/header-first.html The beginning of the header tag
yoursite/layouts/partials/paige/header-last.html The end of the header tag
yoursite/layouts/partials/paige/main-first.html The beginning of the main tag
yoursite/layouts/partials/paige/main-last.html The end of the main tag
yoursite/layouts/partials/paige/style-first.css The beginning of the style tag
yoursite/layouts/partials/paige/style-last.css The end of the style tag

Override

Most code is in partials that are included by the layouts. Elements can be added, changed, or removed easily by overriding the corresponding layout or partial.

For example, the layouts list.html, single.html, taxonomy.html, and term.html include the partial paige/article.html. paige/article.html includes the partials paige/metadata.html, paige/toc.html, and paige/content.html. To change the page title for those layouts, change paige/metadata.html. To change the page title for single.html, replace the use of paige/article.html in single.html with the use of paige/metadata.html, paige/toc.html, and paige/content.html, then replace that use of paige/metadata.html with your own design.

Extend

Use CSS selectors to extend the default styling.

Page identifiers:

#paige-article
The article.
#paige-authors
The authors.
#paige-breadcrumbs
The breadcrumbs.
#paige-collections
The collections.
#paige-collections-header
The collections header.
#paige-comments
The comments.
#paige-content
The content.
#paige-copyright
The copyright.
#paige-credit
The credit.
#paige-date
The date.
#paige-description
The description.
#paige-file
The file links.
#paige-file-edit
The file edit link.
#paige-file-history
The file history link.
#paige-footer
The footer.
#paige-header
The header.
#paige-keywords
The keywords.
#paige-main
The main.
#paige-menu
The menu.
#paige-metadata
The metadata.
#paige-next
The next page link.
#paige-pages
The pages.
#paige-pages-header
The pages header.
#paige-pagination
The sub-page pagination links.
#paige-prev
The previous page link.
#paige-prev-next
The container of the previous and next page links.
#paige-reading-time
The reading time.
#paige-root
The outermost element in the body.
#paige-sections
The sections.
#paige-sections-header
The sections header.
#paige-series
The series.
#paige-title
The title.
#paige-toc
The table of contents.

Page and sub-page classes:

.paige-authors
The authors.
.paige-date
The date.
.paige-date-header
The date headers.
.paige-description
The description.
.paige-keyword
A keyword.
.paige-keywords
The keywords.
.paige-metadata
The metadata.
.paige-page
A page.
.paige-reading-time
The reading time.
.paige-series
The series.
.paige-summary
The summary.
.paige-title
The title.

Kind classes:

.paige-home
The container element of pages with kind "home".
.paige-list
The container element of pages with kind "section".
.paige-single
The container element of pages with kind "page".
.paige-taxonomy
The container element of pages with kind "taxonomy".
.paige-term
The container element of pages with kind "term".

Status classes:

.paige-draft
The container element of draft pages.
.paige-expired
The container element of expired pages.
.paige-future
The container element of future pages.
.paige-modified
The container element of modified pages.
.paige-published
The container element of published pages.
.paige-unpublished
The container element of unpublished pages.

Shortcode classes:

.paige-code
The container element of paige/code shortcodes.
.paige-email
The container element of paige/email shortcodes.
.paige-figure
The container element of paige/figure shortcodes.
.paige-gallery
The container element of paige/gallery shortcodes.
.paige-icon
The container element of paige/icon shortcodes.
.paige-image
The container element of paige/image shortcodes.
.paige-quote
The container element of paige/quote shortcodes.
.paige-vimeo
The container element of paige/vimeo shortcodes.
.paige-youtube
The container element of paige/youtube shortcodes.

If you hide #paige-credit, please credit this project in a post to help others find it.

Minimal look

By default, everything is shown. If you want a more minimal look, try the following in yoursite/layouts/partials/paige/style-first.css:

#paige-authors,
#paige-collections,
#paige-credit,
#paige-keywords,
#paige-prev-next,
#paige-reading-time,
#paige-series,
#paige-toc,
.paige-authors,
.paige-date,
.paige-keywords,
.paige-reading-time,
.paige-series,
.paige-summary {
    display: none;
}

Narrow look

By default, the content expands to fill the whole window. This can result in very long lines, depending on the window width. To use the recommended line length of 66 characters (40rem), try the following in yoursite/hugo.toml:

[params.paige]
style = "#paige-content > * { margin-left: auto; margin-right: auto; max-width: 40rem; }"

Narrow-and-wide look

By default, the content expands to fill the whole window. This can result in very long lines, depending on the window width. To use the recommended line length of 66 characters (40rem) for all content except media, try the following in yoursite/hugo.toml:

[params.paige]
style = """
#paige-content > * { margin-left: auto; margin-right: auto; max-width: 40rem; }
#paige-content > img,
#paige-content > .paige-image,
#paige-content > .paige-vimeo,
#paige-content > .paige-youtube { max-width: 100%; }
"""

Menu navigation only

If you configure a menu, and intend for it to be sufficient for all navigation, you should hide the breadcrumbs on every page, and hide the collection, section, and page lists on the home page if you use the default home page layout.

To hide the breadcrumbs on every page, try the following in yoursite/hugo.toml:

[params.paige]
style = "#paige-breadcrumbs { display: none; }"

To hide the collection, section, and page lists on the home page, try the following in yoursite/content/_index.md:

[paige]
style = "#paige-collections, #paige-sections, #paige-pages { display: none; }"

Credits

Project

Created by Will Faught. Released under the MIT License. Hosted at https://github.com/willfaught/paige.