20 KiB
Paige
A simple Hugo theme. Try it out.
Screenshots

Home page:

List page:

Single page:

Taxonomy page:

Term page:

404 page:

Search page:

Features
- Accessibility
- Analytics
- Automatic switching between light and dark color schemes
- Blog
- Bootstrap
- Comments
- Customizable
- Dark color scheme
- E-mail protection
- Facebook sharing
- Header links
- Landing page
- Light color scheme
- Math typesetting
- Menu
- Minimal design
- Multiple authors
- Multiple languages
- RSS with full content
- Responsive
- Right-to-left languages
- SEO
- Safari and Firefox Reader View support
- Search
- Sections
- Single column
- Social links
- Table of contents
- Twitter sharing
Get started with Hugo
-
For Homebrew on Mac:
$ brew install hugo
-
Create a site:
$ hugo new site yourproject
-
Create a post:
$ cd yourproject $ hugo new my-post.md
See Hugo's quick start guide for more information.
Install
Option 1: Use a Hugo module
Example config.yaml
:
module:
imports:
- path: "github.com/willfaught/paige"
Install:
$ cd yourproject
$ hugo mod init github.com/youraccount/yourproject
$ hugo mod get github.com/willfaught/paige
Update:
$ cd yourproject
$ hugo mod get -u
Option 2: Use a Git subtree
Example config.yaml
:
theme: "paige"
Install:
$ cd yourproject
$ git subtree add --prefix themes/paige --squash https://github.com/willfaught/paige master
Update:
$ cd yourproject
$ git subtree pull --prefix themes/paige --squash https://github.com/willfaught/paige master
Option 3: Use a Git submodule
Example config.yaml
:
theme: "paige"
Install:
$ cd yourproject
$ git submodule add https://github.com/willfaught/paige themes/paige
$ git submodule update --init --recursive --remote
Update:
$ cd yourproject
$ git submodule update --recursive --remote
Option 4: Use a copy
Example config.yaml
:
theme: "paige"
Install:
$ cd yourproject
$ git clone https://github.com/willfaught/paige themes/paige
$ rm -rf themes/paige/.git
Update:
$ cd yourproject
$ rm -rf themes/paige
$ git clone https://github.com/willfaught/paige themes/paige
$ rm -rf themes/paige/.git
Run
$ cd yourproject
$ hugo server -D
Configure
All configuration settings have sensible defaults. No manual configuration is required.
Optional site parameters:
authors:
michael_bluth:
name: "Michael Bluth"
default: true # Credit this author in pages that have no authors parameter
george_bluth:
name: "George Bluth"
paige:
analytics:
chartbeat: # chartbeat.com
account_id: "123456"
domain: "example.com"
clicky: # clicky.com
account_id: "123456"
fathom: # usefathom.com
account_id: "123456"
finteza: # finteza.com
account_id: "123456"
script_url: "https://example.com/script.js"
hotjar: # hotjar.com
account_id: "123456"
matomo: # matomo.org
account_id: "123456"
host_url: "https://example.com"
mixpanel:
token: "123456"
plausible: # plausible.io
account_id: "123456"
woopra: # woopra.com
domain: "example.com"
yandex: # metrica.yandex.com
account_id: "123456"
bootstrap:
icons:
link_href: "https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.2/font/bootstrap-icons.css" # Local or remote file
link_integrity: "sha384-b6lVK+yci+bfDmaY1u0zE8YYJt0TZxLEAFyYSLHId4xoVvsrQu3INevFKo+Xir8e" # File integrity hash
script:
script_integrity: "sha384-OERcA2EqjJCMA+/3y+gxIOqMEjwtxJY7qPCqsdltbNJuaOe923+mo//f6V8Qbsw3" # File integrity hash
script_src: "https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/js/bootstrap.bundle.min.js" # Local or remote file
style:
link_href: "https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" # Local or remote file
link_integrity: "sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" # File integrity hash
color: "#123456" # Theme color for Safari and Windows
color_scheme: "light" # Use the "light" or "dark" color scheme without automatic switching
content_max_width: "66ch" # Page table of contents and content max width
comments:
cactus: # cactus.chat
account_id: "123456"
commento: # commento.io
script_url: "https://example.com/script.js"
hyvor: # hyvor.com
account_id: "123456"
intensedebate: # intensedebate.com
account_id: "123456"
isso: # isso-comments.de
script_url: "https://example.com/script.js"
remark42: # remark42.com
host_url: "https://example.com"
site_id: "123456"
replybox: # getreplybox.com
account_id: "123456"
utterances: # utteranc.es
github_repo: "example/foo"
date_format: "2006 January 2" # Hugo date format for page dates
gallery: # Inherited by the paige/gallery and paige/gallery/item shortcodes
display: "list" # Display images in a grid or list; values are "grid", "list"; default is "grid"
method: "resize" # Hugo image processing method; values are "crop", "fill", "fit", "resize"; default is "resize"
options: "550x webp picture Lanczos" # Hugo image processing options; default is "550x webp picture Lanczos"
hide_theme_comment: true # Don't put a link to this project in a code comment
hide_theme_link: true # Don't put a link to this project in the footer
math:
autorender:
script_integrity: "sha384-+VBxd3r6XgURycqtZ117nYw44OOcIax56Z4dCRWbxyPt0Koah1uHoK0o4+/RRE05" # File integrity hash
script_src: "https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/contrib/auto-render.min.js" # Local or remote file
script:
script_integrity: "sha384-97gW6UIJxnlKemYavrqDHSX3SiygeOwIZhwyOKRfSaf0JWKRVj9hLASHgFTzT+0O" # File integrity hash
script_src: "https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.js" # Local or remote file
style:
link_href: "https://cdn.jsdelivr.net/npm/katex@0.16.3/dist/katex.min.css" # Local or remote file
link_integrity: "sha384-Juol1FqnotbkyZUT5Z7gUPjQ9gzlwCENvUZTpQBAPxtusdwFLRy382PSDx5UUJ4/" # File integrity hash
menu_style: "links" # Menu is link list for "links", tab list for "tabs", or pill list if unset
metadata_max_width: "100ch" # Page metadata max width
rss:
managing_editor: "Michael Bluth"
web_master: "Michael Bluth"
social: # Social links on the home page
examplesite:
icon: example-icon # Bootstrap icon name
link: https://example.com/username
name: Example Site # Used for screen readers
If you set hide_theme_comment
or hide_theme_link
, please credit this project in a post to help others find it.
Optional page parameters:
authors: [
"michael_bluth", # Credit the corresponding author name in the site parameters
{"author": "michael_bluth"}, # Credit the corresponding author name in the site parameters
{"name": "Lucille Bluth"} # Credit this author name
]
link: "https://youtu.be/dQw4w9WgXcQ" # The reference for an anchor around the title
paige:
gallery: # Inherited by the paige/gallery and paige/gallery/item shortcodes
display: "list" # Display images in a grid or list; values are "grid", "list"; default is "grid"
method: "resize" # Hugo image processing method; values are "crop", "fill", "fit", "resize"; default is "resize"
options: "550x webp picture Lanczos" # Hugo image processing options; default is "550x webp picture Lanczos"
math: true # Enable math typesetting with KaTeX
toc: true # Show a table of contents if there are any headers
Additional optional home page parameters:
blurb: "There's a new daddy in town." # Displayed below the greeting
greeting: "You know best" # Displayed below the image
image_raw: true # Do not copy or process the image
image_stretch: true # Stretch the image fully horizontally if true; center the image otherwise
image_url: "me.jpg" # A page, site, or remote resource glob
Additional optional list page parameters:
paige:
show_full_pages: true # Show full pages, not just page titles and descriptions
Additional optional single page parameters:
paige:
hide_rss: true # Don't include this page in RSS feeds
hide_search: true # Don't include this page in search results
Example config.yaml
:
baseurl: https://example.com
copyright: © Michael Bluth
enablerobotstxt: true
languagecode: en-us
languages:
en:
menu:
main:
- identifier: home
name: Home
url: /
weight: 10
- identifier: about
name: About
url: /about/
weight: 20
- identifier: blog
name: Blog
url: /blog/
weight: 30
- identifier: categories
name: Categories
url: /categories/
weight: 40
- identifier: tags
name: Tags
url: /tags/
weight: 50
- identifier: search
name: Search
url: /search/
weight: 60
title: No Borders, No Limits
weight: 10
markup:
goldmark:
renderer:
unsafe: true
tableofcontents:
endlevel: 6
ordered: true
startlevel: 2
module:
imports:
- path: github.com/willfaught/paige
outputs:
home:
- html
- json
- rss
paginate: 50
params:
paige:
social:
discord:
icon: discord
link: https://discord.com/users/username
name: Discord
dribbble:
icon: dribbble
link: https://dribbble.com/username
name: Dribbble
email:
icon: envelope
link: mailto:username@example.com
name: E-mail
facebook:
icon: facebook
link: https://facebook.com/username
name: Facebook
github:
icon: github
link: https://github.com/username
name: GitHub
instagram:
icon: instagram
link: https://instagram.com/username
name: Instagram
linkedin:
icon: linkedin
link: https://linkedin.com/in/username
name: LinkedIn
medium:
icon: medium
link: https://medium.com/@username
name: Medium
pinterest:
icon: pinterest
link: https://pinterest.com/username
name: Pinterest
quora:
icon: quora
link: https://quora.com/profile/username
name: Quora
reddit:
icon: reddit
link: https://reddit.com/u/username
name: Reddit
spotify:
icon: spotify
link: https://open.spotify.com/user/username
name: Spotify
stackoverflow:
icon: stack-overflow
link: https://stackoverflow.com/users/username
name: Stack Overflow
strava:
icon: strava
link: https://strava.com/athletes/username
name: Strava
twitch:
icon: twitch
link: https://twitch.tv/username
name: Twitch
twitter:
icon: twitter
link: https://twitter.com/username
name: Twitter
vimeo:
icon: vimeo
link: https://vimeo.com/username
name: Vimeo
wordpress:
icon: wordpress
link: https://username.wordpress.com
name: Wordpress
yelp:
icon: yelp
link: https://yelp.com/user_details?userid=username
name: Yelp
youtube:
icon: youtube
link: https://youtube.com/user/username
name: YouTube
permalinks:
blog: /blog/:year/:month/:day/:title/
social:
twitter: username
timezone: America/Los_Angeles
titlecasestyle: Go
Layouts
The paige/search
layout provides full site search.
Example config.yaml
:
outputs:
home: ["html", "json", "rss"]
Example content/search.md
:
---
layout: paige/search
title: Search
---
Shortcodes
Figure
The paige/figure
shortcode provides a figure with centered content.
{{< paige/figure caption="My caption" >}}
My content
{{< /paige/figure >}}
Parameters:
caption
- Optional. Unnamed argument. Descriptive text that appears centered below the content. Markdown.
Quote
The paige/quote
shortcode provides a figure with a centered quotation.
{{< paige/quote align="center" caption="My caption" cite="My citation" >}}
My content
{{< /paige/quote >}}
Parameters:
align
- Optional. Aligns text horizontally. Must be
start
,center
, orend
. caption
- Optional. Descriptive text that appears centered below the quotation. Markdown. Must not be used with
cite
. cite
- Optional. Unnamed argument. Markdown. Must not be used with
caption
.
Code
The paige/code
shortcode provides a figure with centered code.
{{< paige/code caption="My caption" lang="html" options="linenos=true" >}}
<!doctype html>
<html lang="en">
<body>
<p>Test</p>
</body>
</html>
{{< /paige/code >}}
Parameters:
caption
- Optional. Descriptive text that appears centered below the code. Markdown.
lang
- Required. Unnamed argument. Chroma language code. See available codes.
options
- Optional. Hugo highlight options.
Image
The paige/image
shortcode provides a figure with a centered image.
{{< paige/image
alt="My alt" >}}
caption="My caption"
link="https://xkcd.com/149"
src="https://imgs.xkcd.com/comics/sandwich.png"
title="My title"
Parameters:
alt
- Optional. Plain text. Image alt.
caption
- Optional. Descriptive text that appears centered below the image. Markdown.
link
- Optional. URL. Image link.
title
- Optional. Plain text. Image title.
src
- Required. Unnamed argument. URL. Image URL.
{{< paige/image height=500 width=500 >}}
Gallery
The paige/gallery
shortcode provides a figure with a centered list of images.
{{< paige/gallery
align="center"
caption="My caption"
height="10rem"
images="*.jpg"
justify="center"
method="resize"
options="550x jpg picture Lanczos"
type="list"
width="10rem"
/>}}
{{< paige/gallery >}}
{{< paige/gallery
image="me.jpg"
caption="My caption"
>}}
{{< /paige/gallery >}}
Parameters:
align
- Optional. Flexbox cross axis alignment. Must be
start
,center
,end
, etc. Seealign-items
. caption
- Optional. Descriptive text that appears centered below the images. Markdown.
height
- Optional. Height of the image or images.
image
- Optional. Page, site, or remote image glob. Only used in the inner content of this shortcode.
images
- Optional. Unnamed argument. Page, site, or remote images glob. Defaults to all image page resources.
justify
- Optional. Flexbox main axis space distribution. Must be
start
,center
,end
, etc. Seejustify-content
. method
- Optional. Hugo image processing method. Must be
crop
,fill
,fit
, orresize
. Default isresize
. See Image Processing Methods. options
- Optional. Hugo image processing options. Default is
550x webp picture Lanczos
. See Image Processing Options. type
- Optional. Type of layout. Must be
grid
orlist
. Default islist
. width
- Optional. Width of the image or images.
Customization
If partials/paige/head-last.html
exists in the site, it is included at the end of the head tag.
If partials/paige/body-last.html
exists in the site, it is included at the end of the body tag.
Most code is in partial templates that are included by the default layouts. Elements can be added, changed, or removed easily by overriding the corresponding default layout or partial template.
For example, the default layouts
home.html
, list.html
, single.html
, taxonomy.html
, and term.html
include the partial template paige/article.html
.
paige/article.html
includes the partial templates paige/metadata.html
, paige/toc.html
, and paige/content.html
.
paige/metadata.html
includes the partial templates paige/title.html
, paige/description.html
, and paige/other.html
.
To change the page title for those default layouts, change paige/title.html
.
To change the page title for single.html
,
replace the use of paige/article.html
in single.html
with the use of
paige/title.html
, paige/description.html
, paige/other.html
, paige/toc.html
, and paige/content.html
,
then replace that use of paige/title.html
with your own design.
Design
The HTML author is the page authors, if any.
The HTML description is the page description, if any.
The HTML keywords is a union of the page keywords, tags, and categories, if any.
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, if any, or the site title otherwise.
The HTML body can have a header, a body, and a footer. The header has the menu, if any; the page title, if any; the page description, if any; and the page date, if any. The body has the page content, if any. The footer has the copyright notice, if any, and the theme link, if any.
The page 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, if any.
Bootstrap 5.3.0-alpha1 CSS and JavaScript and Bootstrap Icons 1.10.3 are used unless overridden. Bootstrap CSS and Bootstrap Icons are loaded from the Bootstrap CDN for every page.
Hugo names, CSS names, and JavaScript names that begin with "paige" capitalized in any way are reserved.
Community
Get started by starring and following the project.
If you find a problem or have a suggestion, please share it by creating an issue. Feedback is encouraged and appreciated.
If you have a fix or improvement, please share it by creating a pull request.
Credits
Photo by Sergey Pesterev.
Project
Created by Will Faught. Released under the Apache License 2.0. Hosted at https://github.com/willfaught/paige.