Private fork of the hugo-tufte theme.
Find a file
2023-04-29 05:17:50 +01:00
.github chore(.github): fix typos in bug report template 2022-01-29 08:34:13 +01:00
archetypes update archetypes 2023-04-25 14:42:15 +01:00
assets add css for dl; minor adjustments to book layouts 2023-04-25 18:43:08 +01:00
exampleSite remove redundant layout, add showSummary switch 2023-04-25 15:45:22 +01:00
images Update example site and include images. 2016-02-20 13:09:11 -08:00
layouts add lang option for side/marginnote 2023-04-29 05:17:50 +01:00
static adjust meta styles; add tufte-css.md 2023-04-17 17:20:14 +01:00
.gitignore Merge branch 'main' into master 2023-04-14 16:39:58 +00:00
CHANGELOG.md 🔖 chores 2021-11-03 23:10:50 +01:00
code_of_conduct.md update code of conduct 2021-07-25 10:09:53 +02:00
config.toml dump hugo minimal working version to 0.83 2021-08-01 11:36:11 +02:00
CONTRIBUTING.md chores 2021-07-25 10:05:22 +02:00
go.mod Create go.mod 2022-01-30 20:01:17 +01:00
LICENSE.md 🔖 chores 2021-11-03 23:10:50 +01:00
Makefile ♻️ Fixing the normalize.scss issue (#39) 2021-11-03 21:54:46 +01:00
README.md update example site 2023-04-25 14:44:03 +01:00
theme.toml Update theme.toml 2021-12-17 18:15:56 +01:00

Tufte Hugo Theme

Contributor Covenant

History of this project

Hugo-Tufte is a minimalist blog-like theme for the static site generator Hugo that attempts to be a faithful implementation of the Tufte-css project. The current version supports mathematical typesetting via KaTeX.

Quickstart

Prerequisite: Hugo Extended

You'll need to install Hugo Extended for this theme to test it locally, since this theme uses SCSS.

  • On Windows:
    • Using Chocolatey:
      choco install hugo-extended # remember, you might need admin privs
      
  • On macOS:

Check out the example site

git clone https://github.com/loikein/hugo-tufte.git
cd hugo-tufte/exampleSite
hugo server --buildDrafts --disableFastRender

Then open localhost:1313 or wherever it says in browser.

The showcase posts are:

  • The big old test page
  • Tufte CSS

For a new site

hugo new site <your-site-name>
cd <your-site-name>/themes/
git clone https://github.com/loikein/hugo-tufte.git

Add theme: 'hugo-tufte' to your config.yaml to let your site know to actually use this theme, specifically.

Then run hugo server --buildDrafts --disableFastRender and open localhost:1313 or wherever it says in browser.

Features

Math

In this version, I use Yihui Xie's method to support (almost) seamless LaTeX rendering with KaTeX.

For usage and examples, refer to ./exampleSite/content/post/tufte-features.md .

Downside: LaTeX in post title is no longer supported.

Site Parameters

params for this theme are:

  • subtitle string: If set, displayed under the main title.
  • showPoweredBy boolean: If true, display a shoutout to Hugo and this theme.
  • copyrightHolder string: Inserts the value in the default copyright notice.
  • copyright string: Custom copyright notice.
  • math boolean: Site wide kill switch for Latex support
  • codeBlocksDark boolean: If true, code blocks will use a dark theme.
  • marginNoteInd string: (NEW) Custom indicator for margin notes, with suggestions in comment. (Only displayed on mobile devices or inside cols shortcode.)

Socials

(The followings have not been tested for this repo, use at your own risk.)

You can add links to your social media profile by using thoses parameters:

  • github: string
  • gitlab: string
  • twitter: string
  • patreon: string
  • youtube: string
  • medium: string
  • reddit: string
  • stackoverflow: string
  • instagram: string
  • mastodon: string
  • orcid: string
  • google_scholar: string

Please see exampleSite/config.yaml to see the full implementation with exemples.

Page Parameters

  • math boolean: If true, try to render the page's LaTeX code using KaTeX.
  • meta boolean: If true, display page metadata such as author, date, categories.
    • hideDate boolean: If true, do not display a page date in metadata.
    • hideReadTime boolean: if true, do not display the page's reading time estimate in metadata.
  • toc boolean: if true, display the table of contents for the page.
  • Layout parameters: (NEW)
    • For more information, see Hugo's Lookup Order | Hugo.
    • type string: If set to book, layout files in ./layouts/book/ will be prioritised.
    • layout string: If set, layout files with the name of this field's value will be prioritised.

Shortcodes

This theme provides the following shortcodes in an attempt to completely support all the features present in the Tufte-css project.

For usage and examples, refer to ./exampleSite/content/post/tufte-features.md .

  • blockquote
  • div
  • epigraph
  • marginnote
  • sidenote