Skip to content

Commit

Permalink
Merge pull request #3 from Laurenfrost/dev
Browse files Browse the repository at this point in the history
New release v0.3.2
  • Loading branch information
Laurenfrost authored Sep 11, 2023
2 parents b2dba4d + d515037 commit 8d701be
Show file tree
Hide file tree
Showing 11 changed files with 108 additions and 120 deletions.
33 changes: 23 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Tufte Hugo Theme
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg)](code_of_conduct.md)
[![build github pages](https://github.com/slashformotion/hugo-tufte/actions/workflows/build-site-ghpages.yml/badge.svg)](https://github.com/slashformotion/hugo-tufte/actions/workflows/build-site-ghpages.yml)
[![build github pages](https://github.com/Laurenfrost/hugo-tufte-cjk/actions/workflows/build-site-ghpages.yml/badge.svg)](https://github.com/Laurenfrost/hugo-tufte-cjk/actions/workflows/build-site-ghpages.yml)

***This theme isn't actively maintained, if you want a new feature please file a pull request.***

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 [katex](https://katex.org/) or [MathJax](https://www.mathjax.org).
By utilizing copious partial templates the theme is largely customizable.
> 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 [katex](https://katex.org/) or [MathJax](https://www.mathjax.org).
> By utilizing copious partial templates the theme is largely customizable.
>
> This is a fork of the original [hugo-tufte](https://github.com/shawnohare/hugo-tufte).
This is a fork of the original [hugo-tufte](https://github.com/shawnohare/hugo-tufte).
This is a fork of a modified version [hugo-tufte](https://github.com/slashformotion/hugo-tufte) of [slashformotion](https://github.com/slashformotion).

## Quickstart

Expand All @@ -33,12 +34,24 @@ cd <your-site-name>\themes\ # cd into the themes directory
git clone <this-git-repo> # HTTPS link @ the top of the page if you've never done this before
```

Add `theme = 'hugo-tufte'` to your `config.toml` to let your site know to actually use _this_ theme, specifically.
Add `theme = 'hugo-tufte-cjk'` to your `config.toml` to let your site know to actually use _this_ theme, specifically.

Then run `hugo server -D` and open up `localhost:1313/` or wherever it says in Firefox.

## Features

### <ruby><rb>Ruby</rb><rt>\<\/ruby\></rt></ruby> Annotation

Another very important feature is a `</ruby>` mark. It supports not only latin but also CJK character sets.

```html {linenos=table, linenostart=1}
<!-- Syntax -->
{{<ruby mark="Pronunciation">}}The Word{{</ruby>}}
<!-- Equal with following html expr -->
<ruby><rb>The Word</rb><rt>Pronunciation</rt></ruby>
```
<ruby><rb>中文</rb><rt>zhōng wén</rt></ruby>可以注音,日本語の文字に<ruby><rb>振り仮名</rb><rt>ふりがな</rt></ruby>をつけることも可能である。

### Math

[Katex](https://katex.org/) or [MathJax](https://www.mathjax.org) renders LaTeX written inside of markdown files. LaTeX can be written more or less as normal. Some examples:
Expand Down
8 changes: 3 additions & 5 deletions assets/scss/general.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,18 @@ article,
header,
footer,
.pure-g [class*="pure-u"] {
font-family: "et-book", -apple-system, "San Francisco", "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell",
"Open Sans", "Helvetica Neue", "Lucida Grand", "Noto Serif", sans-serif;
font-family: "et-book", "HuayingMincho", "Noto Serif", serif;
}

ruby > rt {
font-family: "et-book", "Noto Serif", sans-serif;
font-size: 0.9rem;
margin-top: -0.2rem;
margin-bottom: -0.3rem;
}

p {
text-align: justify;
// text-align: left;
// text-align: justify;
text-align: left;
}

code {
Expand Down
168 changes: 74 additions & 94 deletions assets/scss/vendor/tufte.scss
Original file line number Diff line number Diff line change
Expand Up @@ -54,89 +54,30 @@
font-style: normal;
}

/* noto-serif-sc-regular - chinese-simplified */
/* Lxgw */
@font-face {
font-family: 'Noto Serif';
font-family: "LxgwNeoZhiSong";
font-style: normal;
font-weight: normal;
src: url('noto-serif/noto-serif-sc-v21-chinese-simplified/noto-serif-sc-v21-chinese-simplified-regular.eot'); /* IE9 Compat Modes */
src: local(''),
url('noto-serif/noto-serif-sc-v21-chinese-simplified/noto-serif-sc-v21-chinese-simplified-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('noto-serif/noto-serif-sc-v21-chinese-simplified/noto-serif-sc-v21-chinese-simplified-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('noto-serif/noto-serif-sc-v21-chinese-simplified/noto-serif-sc-v21-chinese-simplified-regular.woff') format('woff'), /* Modern Browsers */
url('noto-serif/noto-serif-sc-v21-chinese-simplified/noto-serif-sc-v21-chinese-simplified-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('noto-serif/noto-serif-sc-v21-chinese-simplified/noto-serif-sc-v21-chinese-simplified-regular.svg#NotoSerifSC') format('svg'); /* Legacy iOS */
}

/* noto-serif-tc-regular - chinese-traditional */
src: url("https://github.com/lxgw/LxgwNeoZhiSong/releases/download/v0.112/LXGWNeoZhiSongCHS.ttf") format("truetype");
src: url("Lxgw/LxgwNeoZhiSong/LXGWNeoZhiSongCHS.ttf") format("truetype");
}

@font-face {
font-family: 'Noto Serif';
font-family: "LxgwWenKai";
font-style: normal;
font-weight: normal;
src: url('noto-serif/noto-serif-tc-v22-chinese-traditional/noto-serif-tc-v22-chinese-traditional-regular.eot'); /* IE9 Compat Modes */
src: local(''),
url('noto-serif/noto-serif-tc-v22-chinese-traditional/noto-serif-tc-v22-chinese-traditional-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('noto-serif/noto-serif-tc-v22-chinese-traditional/noto-serif-tc-v22-chinese-traditional-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('noto-serif/noto-serif-tc-v22-chinese-traditional/noto-serif-tc-v22-chinese-traditional-regular.woff') format('woff'), /* Modern Browsers */
url('noto-serif/noto-serif-tc-v22-chinese-traditional/noto-serif-tc-v22-chinese-traditional-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('noto-serif/noto-serif-tc-v22-chinese-traditional/noto-serif-tc-v22-chinese-traditional-regular.svg#NotoSerifTC') format('svg'); /* Legacy iOS */
}

/* noto-serif-jp-regular - japanese */
src: url("https://github.com/lxgw/LxgwWenKai/releases/download/v1.300/LXGWWenKai-Regular.ttf") format("truetype");
src: url("Lxgw/LxgwWenKai/LXGWWenKai-Regular.ttf") format("truetype");
}

@font-face {
font-family: 'Noto Serif';
font-family: "HuayingMincho";
font-style: normal;
font-weight: normal;
src: url('noto-serif/noto-serif-jp-v20-japanese/noto-serif-jp-v20-japanese-regular.eot'); /* IE9 Compat Modes */
src: local(''),
url('noto-serif/noto-serif-jp-v20-japanese/noto-serif-jp-v20-japanese-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('noto-serif/noto-serif-jp-v20-japanese/noto-serif-jp-v20-japanese-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('noto-serif/noto-serif-jp-v20-japanese/noto-serif-jp-v20-japanese-regular.woff') format('woff'), /* Modern Browsers */
url('noto-serif/noto-serif-jp-v20-japanese/noto-serif-jp-v20-japanese-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('noto-serif/noto-serif-jp-v20-japanese/noto-serif-jp-v20-japanese-regular.svg#NotoSerifJP') format('svg'); /* Legacy iOS */
}

/* noto-serif-sc-700 - chinese-simplified */
@font-face {
font-family: 'Noto Serif';
font-style: normal;
font-weight: bold;
src: url('noto-serif/noto-serif-sc-v21-chinese-simplified/noto-serif-sc-v21-chinese-simplified-700.eot'); /* IE9 Compat Modes */
src: local(''),
url('noto-serif/noto-serif-sc-v21-chinese-simplified/noto-serif-sc-v21-chinese-simplified-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('noto-serif/noto-serif-sc-v21-chinese-simplified/noto-serif-sc-v21-chinese-simplified-700.woff2') format('woff2'), /* Super Modern Browsers */
url('noto-serif/noto-serif-sc-v21-chinese-simplified/noto-serif-sc-v21-chinese-simplified-700.woff') format('woff'), /* Modern Browsers */
url('noto-serif/noto-serif-sc-v21-chinese-simplified/noto-serif-sc-v21-chinese-simplified-700.ttf') format('truetype'), /* Safari, Android, iOS */
url('noto-serif/noto-serif-sc-v21-chinese-simplified/noto-serif-sc-v21-chinese-simplified-700.svg#NotoSerifSC') format('svg'); /* Legacy iOS */
}

/* noto-serif-tc-700 - chinese-traditional */
@font-face {
font-family: 'Noto Serif';
font-style: normal;
font-weight: bold;
src: url('noto-serif/noto-serif-tc-v22-chinese-traditional/noto-serif-tc-v22-chinese-traditional-700.eot'); /* IE9 Compat Modes */
src: local(''),
url('noto-serif/noto-serif-tc-v22-chinese-traditional/noto-serif-tc-v22-chinese-traditional-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('noto-serif/noto-serif-tc-v22-chinese-traditional/noto-serif-tc-v22-chinese-traditional-700.woff2') format('woff2'), /* Super Modern Browsers */
url('noto-serif/noto-serif-tc-v22-chinese-traditional/noto-serif-tc-v22-chinese-traditional-700.woff') format('woff'), /* Modern Browsers */
url('noto-serif/noto-serif-tc-v22-chinese-traditional/noto-serif-tc-v22-chinese-traditional-700.ttf') format('truetype'), /* Safari, Android, iOS */
url('noto-serif/noto-serif-tc-v22-chinese-traditional/noto-serif-tc-v22-chinese-traditional-700.svg#NotoSerifTC') format('svg'); /* Legacy iOS */
}

/* noto-serif-jp-700 - japanese */
@font-face {
font-family: 'Noto Serif';
font-style: normal;
font-weight: bold;
src: url('noto-serif/noto-serif-jp-v20-japanese/noto-serif-jp-v20-japanese-700.eot'); /* IE9 Compat Modes */
src: local(''),
url('noto-serif/noto-serif-jp-v20-japanese/noto-serif-jp-v20-japanese-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('noto-serif/noto-serif-jp-v20-japanese/noto-serif-jp-v20-japanese-700.woff2') format('woff2'), /* Super Modern Browsers */
url('noto-serif/noto-serif-jp-v20-japanese/noto-serif-jp-v20-japanese-700.woff') format('woff'), /* Modern Browsers */
url('noto-serif/noto-serif-jp-v20-japanese/noto-serif-jp-v20-japanese-700.ttf') format('truetype'), /* Safari, Android, iOS */
url('noto-serif/noto-serif-jp-v20-japanese/noto-serif-jp-v20-japanese-700.svg#NotoSerifJP') format('svg'); /* Legacy iOS */
}
src: url("https://github.com/GuiWonder/HuayingMincho/releases/download/1.009/HuayingMincho.ttc") format("truetype");
src: url("Huaying/HuayingMincho.ttc") format("truetype");
}



Expand All @@ -150,7 +91,7 @@ body {
margin-left: auto;
margin-right: auto;
padding-left: 12.5%;
font-family: et-book, Palatino, "Palatino Linotype", "Palatino LT STD", "Book Antiqua", Georgia, serif;
font-family: "et-book", "HuayingMincho", "Noto Serif", serif;
background-color: #fffff8;
color: #111;
max-width: 1400px;
Expand All @@ -161,28 +102,57 @@ h1 {
font-weight: 400;
margin-top: 4rem;
margin-bottom: 1.5rem;
font-size: 2.4rem;
font-size: 2.8rem;
line-height: 1;
}

h1 > code {
font-style: italic;
font-size: 2.8rem;
}

h2 {
font-style: italic;
font-weight: 400;
margin-top: 2.1rem;
margin-top: 2.2rem;
margin-bottom: 0;
font-size: 2.0rem;
font-size: 2.2rem;
line-height: 1;
}

h2 > code {
font-style: italic;
font-size: 2.2rem;
}

h3 {
font-style: italic;
font-weight: 400;
font-size: 1.8rem;
font-size: 1.5rem;
margin-top: 2rem;
margin-bottom: 0;
line-height: 1;
}

h3 > code {
font-style: italic;
font-size: 1.5rem;
}

h4 {
font-style: italic;
font-weight: 400;
font-size: 1.3rem;
margin-top: 2rem;
margin-bottom: 0;
line-height: 1;
}

h4 > code {
font-style: italic;
font-size: 1.3rem;
}

hr {
text-align: left;
margin-left: 0;
Expand Down Expand Up @@ -233,6 +203,7 @@ p {

/* Chapter Epigraphs */
div.epigraph {
font-family: et-book, "LxgwWenKai";
margin: 5em 0;
}

Expand All @@ -243,6 +214,7 @@ div.epigraph > blockquote {

div.epigraph > blockquote,
div.epigraph > blockquote > p {
font-family: et-book, "LxgwWenKai";
font-style: italic;
}

Expand Down Expand Up @@ -281,6 +253,18 @@ li ul {
width: 100%;
}

li > .highlight,
li > p,
li > blockquote > p {
width: 100%;
}

li > ol,
blockquote > ol,
blockquote > ul {
width:fit-content;
}

li {
padding: 0.5rem 0;
}
Expand Down Expand Up @@ -501,24 +485,24 @@ label.sidenote-number {
display: inline;
}

// label.margin-toggle:not(.sidenote-number) {
// display: none;
// }

label.margin-toggle:not(.sidenote-number) {
display: inline;
display: none;
}

// label.margin-toggle-2:not(.sidenote-number) {
// display: inline;
// }

@media (max-width: 760px) {
// label.margin-toggle:not(.sidenote-number) {
// display: inline;
// }
label.margin-toggle:not(.sidenote-number) {
display: inline;
}
label.margin-toggle-2:not(.sidenote-number) {
display: inline;
}
.sidenote,
.marginnote {
display: none;
display: inline;
}
.margin-toggle:checked + .sidenote,
.margin-toggle:checked + .marginnote {
Expand All @@ -528,9 +512,7 @@ label.margin-toggle:not(.sidenote-number) {
clear: both;
width: 95%;
margin: 1rem 2.5%;
// Property is ignored due to the display. With 'display: block',
// vertical-align should not be used.scss(propertyIgnoredDueToDisplay)
// vertical-align: baseline;
vertical-align: baseline;
position: relative;
}
label {
Expand All @@ -549,9 +531,7 @@ label.margin-toggle:not(.sidenote-number) {
margin-bottom: 0.5rem;
margin-left: 1%;
margin-right: 1%;
// Property is ignored due to the display. With 'display: block',
// vertical-align should not be used.scss(propertyIgnoredDueToDisplay)
// vertical-align: baseline;
vertical-align: baseline;
position: relative;
}
div.table-wrapper,
Expand Down
2 changes: 1 addition & 1 deletion code_of_conduct.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ representative at an online or offline event.

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
slashformotion[at]protonmail[dot].com.
bellfahle[at]gmail[dot].com.
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
{{ if .Site.Params.showPoweredBy}}
<p>
Powered by <a href="https://gohugo.io">Hugo</a> and the
<a href="https://github.com/Laurenfrost/hugo-tufte">Tufte theme</a>,
<a href="https://github.com/Laurenfrost/hugo-tufte-cjk">Tufte theme</a>,
modified by <a href="https://github.com/Laurenfrost">Laurenfrost</a>
</p>
{{ end }}
Expand Down
4 changes: 3 additions & 1 deletion layouts/shortcodes/blockquote.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
<p>
{{ .Inner | markdownify }}
</p>
<footer>{{ .Get "footer" }}</footer>
{{ if .Get "link" }}<footer><a href={{ .Get "link" }}><u>{{ .Get "footer" }}</u></a></footer>
{{ else }}<footer>{{ .Get "footer" }}</footer>
{{ end }}
</blockquote>
4 changes: 2 additions & 2 deletions layouts/shortcodes/figure.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
{{ if .Get "link" }}</a>{{ end }}
{{ end }}
{{ end }}
{{ with .Get "title"}}<strong>{{ . }} </strong>{{ end}}
{{ with .Get "title"}}<strong>{{ . }}</strong>{{ end }}
{{ with .Get "caption"}}{{ . }}{{ end }}
{{ with .Get "attrlink"}}<a href="{{ .}}">{{ end }}
{{ with .Get "attrlink"}}by <a href="{{ .}}">{{ end }}
{{ with .Get "attr" }}{{ . }}{{ end }}
{{ if .Get "attrlink" }}</a>{{ end }}
{{ if eq $type "full" }}
Expand Down
7 changes: 1 addition & 6 deletions layouts/shortcodes/ruby.html
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
<ruby>
<rb>{{ .Inner | markdownify }}</rb>
<rp> (</rp>
{{ with .Get "mark" }}<rt>{{ . }}</rt>{{ end }}
<rp>) </rp>
</ruby>
<ruby><rb>{{ .Inner | markdownify }}</rb><rp> (</rp>{{ with .Get "mark" }}<rt>{{ . }}</rt>{{ end }}<rp>)</rp></ruby>
Binary file added static/css/Huaying/HuayingMincho.ttc
Binary file not shown.
Binary file not shown.
Binary file added static/css/Lxgw/LxgwWenKai/LXGWWenKai-Regular.ttf
Binary file not shown.

0 comments on commit 8d701be

Please sign in to comment.