Skip to content

Powerful, pliable pixel perfection. An advanced Hugo theme.

License

Notifications You must be signed in to change notification settings

thehouseplant/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.

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 focus and delineate parts of the page. The implementation is flexible and extensible. It's a versatile canvas that serves most web needs.

Features

  • Accessibility
  • Analytics
  • Authors
  • Automatic switching between light and dark color schemes
  • Blog
  • Bootstrap
  • Categories
  • Code shortcode
  • Comments
  • Customizable
  • Dark color scheme
  • E-mail protection
  • Facebook sharing
  • Figure shortcode
  • Gallery shortcode
  • Header links
  • Icon shortcode
  • Image shortcode
  • Landing page
  • Languages
  • Light color scheme
  • Math typesetting
  • Menu
  • Minimal design
  • Quote shortcode
  • RSS with full content
  • Responsive
  • Right-to-left languages
  • SEO
  • Safari and Firefox Reader View support
  • Search
  • Sections
  • 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.

Please share your deployed sites by posting links.

Get started with Hugo

  1. Install Hugo (the extended version is required).

    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 Embedded Dart Sass.

    For Homebrew on Mac:

    $ brew install sass/sass/dart-sass-embedded

    For Chocolatey on Windows:

    $ choco install dart-sass-embedded

    For Snap on Linux:

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

    $ hugo new site yourproject
  4. Create a post:

    $ cd yourproject
    $ hugo new my-post.md

See Hugo's quick start guide for more information.

Install

Install:

$ cd yourproject
$ hugo mod init github.com/youraccount/yourproject
$ hugo mod get github.com/willfaught/paige

Update:

$ cd yourproject
$ hugo mod get -u

Example config.yaml:

module:
  imports:
  - path: "github.com/willfaught/paige"

Run

$ cd yourproject
$ hugo server -D

Configure

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

paige:
  analytics:
    chartbeat: # See https://chartbeat.com
      account_id: ""
      domain: ""
    disabled: false # Disable all analytics
    clicky: # See https://clicky.com
      account_id: ""
    fathom: # See https://usefathom.com
      account_id: ""
    finteza: # See https://finteza.com
      account_id: ""
      script_url: ""
    hotjar: # See https://hotjar.com
      account_id: ""
    matomo: # See https://matomo.org
      account_id: ""
      host_url: ""
    mixpanel: # See https://mixpanel.com
      token: ""
    plausible: # See https://plausible.io
      account_id: ""
    woopra: # See https://woopra.com
      domain: ""
    yandex: # See https://metrica.yandex.com
      account_id: ""
  color: "#0d6efd" # Bootstrap primary color; theme color for Safari and Windows
  comments:
    cactus: # See https://cactus.chat
      account_id: ""
    commento: # See https://commento.io
      script_url: ""
    disabled: false # Disable all comments
    hyvor: # See https://hyvor.com
      account_id: ""
    intensedebate: # See https://intensedebate.com
      account_id: ""
    isso: # See https://isso-comments.de
      script_url: ""
    remark42: # See https://remark42.com
      host_url: ""
      site_id: ""
    replybox: # See https://getreplybox.com
      account_id: ""
    utterances: # See https://utteranc.es
      github_repo: ""
  date:
    format: ":date_long" # Hugo date format
    source: "published" # Displayed date in single pages; must be "published" or "modified"
  git:
    commit_url_prefix: "" # Example is "https://github.com/willfaught/paige/commit/"
  math: false # Enable math typesetting
  menu:
    breakpoint: "sm" # Bootstrap breakpoint at which to display all menu items
    style: "pills" # Must be "links" or "pills"
  rss:
    hide_page: false
    managing_editor: ""
    web_master: ""
  search:
    hide_page: false
  style: "" # CSS included at the end of the stylesheet, before style-last.css

The assigned values shown are the default values.

Optional site parameters:

authors:
  will-faught:
    name: "Will Faught"
    default: false # Credit this author in pages that have no authors parameter

Optional page parameters:

authors:
- "will-faught" # Credit the corresponding author in the site parameters
- author: "will-faught" # Credit the corresponding author in the site parameters
- name: "Will Faught" # Credit this author
link: "https://youtu.be/dQw4w9WgXcQ" # The reference for an anchor around the title
paige:
  alert: "Alert!" # Markdown displayed before the page body (defaults to primary alert type)
  alert:
    message: "Alert!" # Markdown displayed before the page body
    type: "primary" # Bootstrap alert type
  pin: true # Display this page before the rest

Features

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

Example config.yaml:

languages:
  en:
    menu:
      main:
      - identifier: "home"
        name: "Home"
        url: "/"
        weight: 10
      - identifier: "blog"
        name: "Blog"
        url: "/blog/"
        weight: 20
      - identifier: "tags"
        name: "Tags"
        url: "/tags/"
        weight: 30
      - identifier: "search"
        name: "Search"
        url: "/search/"
        weight: 40
    weight: 10

Layouts

Cloud

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

Example content/tags/_index.md:

layout: "paige/cloud"

The assigned values shown are the default values.

Search

The paige/search layout provides a search page.

Example config.yaml:

outputs:
  home: ["html", "json", "rss"]

Example content/search.md:

layout: "paige/search"
title: "Search"

Shortcodes

Code

The paige/code shortcode provides a figure with code.

{{< paige/code lang="html" options="linenos=true" >}}
<!doctype html>
<html lang="en">
<body>
  <p>Test</p>
</body>
</html>
{{< /paige/code >}}

Inner content: Required. String. The code.

Parameters:

lang
Optional. Position 0. String. Chroma language code. Defaults to plaintext. See the codes.
options
Optional. String. Hugo highlight options. See the options.

Figure

The paige/figure shortcode provides a figure with content.

{{< paige/figure
    caption="My caption"
    float="left"
    height="10rem"
    horizontal="center"
    maxwidth="10rem"
    number=0
    numbered=false
    vertical="center"
    width="10rem"
>}}
My content
{{< /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 a figure with a collection of images.

{{< paige/gallery
    align="center"
    format="webp"
    height="10rem"
    images="*.jpg"
    justify="center"
    maxheight="10rem"
    maxwidth="10rem"
    method="resize"
    options="550x webp picture Lanczos"
    type="list"
    width="10rem"
/>}}

{{< paige/gallery >}}
{{< paige/image src="1.jpg" >}}
{{< paige/image src="2.jpg" >}}
{{< paige/image src="3.jpg" >}}
{{< /paige/gallery >}}

Inner content: Optional. String. HTML.

Parameters:

align
Optional. String. Cross axis alignment. Must be baseline, center, end, start, or stretch.
format
Optional. String. Image format. Must be bmp, gif, jpg, png, tiff, or webp. Must not be used with method or options.
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.
maxheight
Optional. String. CSS value. Maximum image height.
maxwidth
Optional. String. CSS value. Maximum image width.
method
Optional. String. Hugo image processing method. Must be crop, fill, fit, or resize. Default is resize. See the methods.
options
Optional. String. Hugo image processing options. Default is 550x webp picture Lanczos. See the options.
type
Optional. String. Type of layout. Grid and list layouts use the horizontal axis as the main axis, and the vertical axis as the cross axis. Must be grid or list. Default is list.
width
Optional. String. CSS value. Image width.

Hero

The paige/hero shortcode provides a hero section.

{{< paige/hero
    alt="My alt"
    format="webp"
    header="My header"
    height="10rem"
    image="https://github.com/willfaught/paige"
    imageclass="rounded-4 shadow"
    maxheight="10rem"
    maxwidth="10rem"
    title="My title"
    width="10rem"
>}}
My content
{{< /paige/hero >}}

Inner content: Optional. String. Markdown. The body.

Parameters:

alt
Optional. String. Plain text. Image alt.
format
Optional. String. Image format. Must be bmp, gif, jpg, png, tiff, or webp. Must not be used with method or options.
header
Optional. String. Markdown. The header.
height
Optional. String. CSS value. Image height.
image
Optional. String. URL. Image source.
imageclass
Optional. String. Class attribute value.
maxheight
Optional. String. CSS value. Image maximum height. Default is 20rem.
maxwidth
Optional. String. CSS value. Image maximum width.
stretch
Optional. Boolean. Whether to stretch the image fully horizontally.
title
Optional. String. Plain text. Image title.
width
Optional. String. CSS value. Image width.

Icon

The paige/icon shortcode provides a web font icon.

{{< paige/icon class="bi bi-github" name="GitHub" url="https://github.com/willfaught/paige" >}}

Inner content: None.

Parameters:

class
Required. Position 0. String. Class attribute value.
name
Optional. String. The screen reader description.
url
Optional. String. URL. E-mails in URLs with a mailto: scheme are protected from web crawlers.

Image

The paige/image shortcode provides a figure with an image.

{{< paige/image
    alt="My alt" >}}
    format="webp"
    height="10rem"
    link="https://github.com/willfaught/paige"
    maxheight="10rem"
    maxwidth="10rem"
    method="resize"
    options="550x webp picture Lanczos"
    src="me.jpg"
    title="My title"
    width="10rem"
>}}

Inner content: None.

Parameters:

alt
Optional. String. Plain text. Image alt.
format
Optional. String. Image format. Must be bmp, gif, jpg, png, tiff, or webp. Must not be used with method or options.
height
Optional. String. CSS value. Image height.
link
Optional. String. URL. Image link.
maxheight
Optional. String. CSS value. Image maximum height.
maxwidth
Optional. String. CSS value. Image maximum width.
method
Optional. String. Hugo image processing method. Must be crop, fill, fit, or resize. Must be specified with options. See the methods.
options
Optional. String. Hugo image processing options. Must be specified with method. See the options.
src
Required. Position 0. String. URL. Image source.
title
Optional. String. Plain text. Image title.
width
Optional. String. CSS value. Image width.

Quote

The paige/quote shortcode provides a figure with a quotation.

{{< paige/quote >}}
My content
{{< /paige/quote >}}

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

Parameters: None.

Vimeo

The paige/vimeo shortcode provides a responsive Vimeo video.

{{< paige/vimeo
    autopause=true
    autoplay=false
    background=false
    byline=true
    color="00adef"
    controls=true
    description="My description"
    dnt=false
    fullscreen=true
    height="10rem"
    keyboard=true
    loop=false
    maxheight="10rem"
    maxwidth="10rem"
    muted=false
    pip=false
    playsinline=true
    portrait=true
    quality="auto"
    speed=false
    texttrack=false
    time="1m2s"
    title=true
    transparent=true
    video="644036051"
    width="10rem"
>}}

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 responsive YouTube video.

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

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 in the site It is included at
layouts/partials/paige/body-first.html The beginning of the body tag
layouts/partials/paige/body-last.html The end of the body tag
layouts/partials/paige/footer-first.html The beginning of the footer tag
layouts/partials/paige/footer-last.html The end of the footer tag
layouts/partials/paige/head-first.html The beginning of the head tag
layouts/partials/paige/head-last.html The end of the head tag
layouts/partials/paige/header-first.html The beginning of the header tag
layouts/partials/paige/header-last.html The end of the header tag
layouts/partials/paige/main-first.html The beginning of the main tag
layouts/partials/paige/main-last.html The end of the main tag
layouts/partials/paige/style-first.css The beginning of the style tag
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-footer
The footer.
#paige-header
The header.
#paige-keywords
The keywords.
#paige-main
The main.
#paige-menu
The menu.
#paige-metadata
The metadata.
#paige-pages
The pages.
#paige-pages-header
The pages header.
#paige-pagination
The sub-page pagination 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-article
The article.
.paige-authors
The authors.
.paige-content
The content.
.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.
.paige-toc
The table of contents.

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-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 your layouts/partials/paige/style-first.css:

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

Design

The HTML author is the page authors.

The HTML description is the page description.

The HTML keywords is a union of the page keywords, tags, and categories.

The HTML title is the page title, followed by a middle dot, followed by the site title. If one is missing, the other is used without the middle dot. For the home page, the title is the page title, or the site title otherwise.

The HTML body has a header, a body, and a footer. The header has the menu. The body has the page article. The footer has the copyright notice and the theme link. The article has the page metadata, table of contents, and content. The metadata has the page title, description, terms, authors, date, and reading time.

The copyright notice, title, and description can be Markdown. Markup is stripped for HTML and RSS titles.

The page title is displayed in an h1 tag, so page content headers must start with h2.

The page date is the publish date.

Implementation

The following NPM packages are used:

Hugo names, HTML names, CSS names, and JavaScript names that begin with "paige" capitalized in any way, optionally prefixed with one or more underscores, are reserved.

Credits

Project

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

About

Powerful, pliable pixel perfection. An advanced Hugo theme.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 89.3%
  • CSS 10.6%
  • SCSS 0.1%