{{ .Summary }}
+ {{ if .Truncated }} + + {{ end }} + {{ end }} + {{ partial "footer.html" . }} +diff --git a/README.md b/README.md index 1a26da7..0ebda94 100644 --- a/README.md +++ b/README.md @@ -5,25 +5,20 @@ Hugo-Tufte is a minimalist blog-like theme for the [static site generator Hugo](https://gohugo.io) that attempts to be a faithful implementation of the [Tufte-css](https://github.com/edwardtufte/tufte-css) project. -It supports mathematical typesetting via [MathJax](https://www.mathjax.org). +It supports mathematical typesetting via [katex](https://katex.org/). By utilizing copious partial templates the theme is largely customizable. ## State of Project -This theme is largely unmaintained. If there is a particular fork -that should be considered the primary project please submit a PR -updating the README, thanks! +This is a fork of the original [hugo-tufte](https://github.com/shawnohare/hugo-tufte); ## Math -Mathjax renders LaTeX written inside of markdown files. LaTeX can be -written more or less as normal, but inline and display environments that -start with `\` must be escaped. Some examples: +[katex](https://katex.org/) renders LaTeX written inside of markdown files. LaTeX can be +written more or less as normal. Some examples: -- `This $\LaTeX$ will be rendered inline.` -- `This \\(\LaTeX\\) will be rendered inline.` -- `A simple displayed equation: $$f(x, y) := e^{x^2 - y^2}.$$` -- `A simple displayed equation: \\[f(x, y) := e^{x^2 - y^2}.\\]` +- This `\\( \frac{1}{2} \\)` will be rendered inline. +- A simple displayed equation: `$$f(x, y) := e^{x^2 - y^2}.$$` There currently seems to be some weirdness with other environments, such as the `align` environment. These environments will render provided @@ -78,9 +73,9 @@ support all the features present in the - **Usage**: Accepts the named parameters `cite` and `footer`. - **Example**: ```html - {{% blockquote cite="www.shawnohare.com" footer="Shawn" %}} + {{< blockquote cite="www.shawnohare.com" footer="Shawn" >}} There is nothing more beautiful than an elegant mathematical proof. - {{% /blockquote %}}` + {{< /blockquote >}} ``` - `div` @@ -103,17 +98,20 @@ support all the features present in the styled epigraph will be used if the `type` parameter is set to `compact`. - **Example**: ``` - {{% epigraph pre="Author Writer, " cite="Math is Fun" %}} + {{< epigraph pre="Author Writer, " cite="Math is Fun" >}} This is an example of an epigraph with some math \\( \mathbb N \subseteq \mathbb R \\) to start the beginning of a section. - {{% /epigraph %}} + {{< /epigraph >}} ``` - `marginnote` - **Description**: Wrap text to produce a numberless margin note. - - Usage: `{{% marginnote %}}...{{% /marginnote %}}` - - **Example**: `{{% marginnote %}}Some marginnote{{% /marginnote%}}` + - Usage: `{{< marginnote >}}...{{< /marginnote >}}` + - **Example**: + ```html + {{< marginnote >}}Some marginnote{{< /marginnote>}} + ``` - `section` - **Description**: This shortcode is provided as a work-around for wrapping @@ -130,11 +128,14 @@ support all the features present in the - `sidenote` - **Description**: Wrap text to produce an automatically numbered sidenote. - **Usage**: identical to `marginnote` - `{{% sidenote %}}...{{% /sidenote %}}` - - **Example**: `{{% sidenote %}}Some sidenote{{% /sidenote %}}` + `{{< sidenote >}}...{{< /sidenote >}}` + - **Example**: + ```html + {{< sidenote >}}Some sidenote{{< /sidenote >}} + ``` -## Templates -TODO -- [ ] Describe the role of each template file, as commenting within the files - themselves seems to break the templates. + +#### TODO +- [ ] Describe the role of each template file. Commenting in template files works. +- [ ] Fix the F**ing css diff --git a/archetypes/post.md b/archetypes/post.md index 2454f9f..6ffe550 100644 --- a/archetypes/post.md +++ b/archetypes/post.md @@ -3,7 +3,7 @@ math = false meta = true toc = true author = "AUTHOR NAME" - +type = "post" +++ diff --git a/exampleSite/config.toml b/exampleSite/config.toml index a1be4a1..d166384 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -1,9 +1,7 @@ -contentdir = "content" -layoutdir = "layouts" -publishdir = "public" -builddrafts = true +themesDir = "../../" + canonifyurls = true -baseurl = "https://github.com/shawnohare/hugo-tufte" +# baseurl = "https://github.com/shawnohare/hugo-tufte" theme = "hugo-tufte" title = "Hugo-tufte Theme Example Site" @@ -14,9 +12,11 @@ title = "Hugo-tufte Theme Example Site" tag = "tags" [params] + math = true subtitle = "Subtitle goes here." copyrightHolder = "Copyright Holder" showPoweredBy = true + hidedate = false # ----------------------------------------------------------------------- # Navigation menu @@ -55,3 +55,9 @@ title = "Hugo-tufte Theme Example Site" weight = -90 identifier = "twitter" url = "https://twitter.com" + + + +[markup] + [markup.goldmark] + unsafe = false \ No newline at end of file diff --git a/layouts/partials/opengraph.html b/exampleSite/content/_index.md similarity index 100% rename from layouts/partials/opengraph.html rename to exampleSite/content/_index.md diff --git a/exampleSite/content/post/tufte-features.md b/exampleSite/content/post/tufte-features.md index c467e2d..672bc6d 100644 --- a/exampleSite/content/post/tufte-features.md +++ b/exampleSite/content/post/tufte-features.md @@ -6,7 +6,7 @@ math = true title = "Hugo-Tufte Features" subtitle = "Fancy Subtitle" toc = true -categories = ["mathjax", "latex", "tufte-css"] +categories = ["katex", "latex", "tufte-css"] +++ @@ -16,23 +16,24 @@ of this theme. One of them is \\( \LaTeX \\) via MathJax. {{< section "begin" >}} ## A Bit About Mathematics -{{% epigraph pre="Shawn O'Hare, " cite="Math is Fun" %}} +{{< epigraph pre="Shawn O'Hare, " cite="Math is Fun" >}} This is an example of an epigraph with some math \\(\mathbb N \subseteq \mathbb R \\) to start the beginning of a section. -{{% /epigraph %}} +{{< /epigraph >}} ### Inline Some inline math: -{{% marginnote "mn-example" %}}This is a margin note.{{% /marginnote %}} -$e^{i \pi} = -1$ and \\(\sqrt{-1} = i \\) +{{< marginnote "mn-example" >}}This is a margin note.{{< /marginnote >}} +\\(e^{i \pi} = -1\\) + and \\(\sqrt{-1} = i \\) and \\( a_2 = 3 \\). ### Display And display math using escaped brackets `\\[`: -{{% sidenote "sn-example" %}}This is a sidenote!{{% /sidenote %}} +{{< sidenote "sn-example" >}}This is a sidenote!{{< /sidenote >}} \\[ -- \cdot_H -- \colon B(G,H) \times B(H, K) \to B(G, K), \quad ([X], [Y]) \mapsto [X \times_H Y]. \\] @@ -73,7 +74,7 @@ is produced from Some blockquotes. But first, we try to manually cite via This is between cite tags and has math: \\(e^x \\) -{{% blockquote cite="www.shawnohare.com" footer="Shawn O'Hare" %}} +{{< blockquote cite="www.shawnohare.com" footer="Shawn O'Hare" >}} This is a blockquote with two paragraphs, that employs the theme's `blockquote` shortcode. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. @@ -82,7 +83,7 @@ Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse id sem consectetuer libero luctus adipiscing. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. -{{% /blockquote %}} +{{< /blockquote >}} ### New thoughts diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..e5e69a3 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,13 @@ + + + {{- partial "header.html" . -}} + +
+ {{ block "main" . }}{{ end }} + + + + + \ No newline at end of file diff --git a/layouts/_default/home.html b/layouts/_default/home.html new file mode 100644 index 0000000..a52757e --- /dev/null +++ b/layouts/_default/home.html @@ -0,0 +1,23 @@ + + +{{ define "main" }} + + + +{{ .Summary }}
+ {{ if .Truncated }} + + {{ end }} + {{ end }} + {{ partial "footer.html" . }} +{{ .Summary }}
- {{ if .Truncated }} - - {{ end }} -{{ end }} -{{ partial "footer.html" . }} -{{ truncate 120 .Summary }}
+ {{/* {{ if .Truncated }} */}} + + {{/* {{ end }} */}} + + {{ end }} + {{ partial "footer.html" . }} +{{ .Params.subtitle }}
+ {{ end }} + {{ if or (eq .Type "post") (.Params.meta) }} + + {{ end }} {{ end }} - -{{ if .IsPage }} -{{ if .Params.subtitle }}{{ .Params.subtitle }}
{{ end }} -{{ if or (eq .Type "post") (.Params.meta) }} - -{{ end }} -{{ end }} -