Skip to content

Commit e806f4a

Browse files
authored
Merge branch 'master' into feature/disqus
2 parents 2b4c7dc + 50fc665 commit e806f4a

File tree

8 files changed

+44
-45
lines changed

8 files changed

+44
-45
lines changed

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2017 Yihui Xie
3+
Copyright (c) 2017-2021 Yihui Xie
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of
66
this software and associated documentation files (the "Software"), to deal in

exampleSite/config.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,27 @@ permalinks:
1414
menu:
1515
main:
1616
- name: Home
17-
url: /
17+
url: ""
1818
weight: 1
1919
- name: About
20-
url: /about/
20+
url: "about/"
2121
weight: 2
2222
- name: Categories
23-
url: /categories/
23+
url: "categories/"
2424
weight: 3
2525
- name: Tags
26-
url: /tags/
26+
url: "tags/"
2727
weight: 4
2828
- name: Subscribe
29-
url: /index.xml
29+
url: "index.xml"
3030

3131
params:
3232
description: "A website built through Hugo and blogdown."
33-
footer: "© [Yihui Xie](https://yihui.org) 2017 -- 2020 | [Github](https://github.com/yihui) | [Twitter](https://twitter.com/xieyihui)"
33+
footer: "© [Yihui Xie](https://yihui.org) 2017 -- {Year} | [Github](https://github.com/yihui) | [Twitter](https://twitter.com/xieyihui)"
3434

3535
markup:
36+
highlight:
37+
codeFences: false
3638
goldmark:
3739
renderer:
3840
unsafe: true

exampleSite/content/_index.Rmarkdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ title: Home
1010

1111
**XMin** is a Hugo theme written by [Yihui Xie](https://yihui.org) in about four hours: half an hour was spent on the Hugo templates, and 3.5 hours were spent on styling. The main motivation for writing this theme was to provide a really minimal example to beginners of Hugo templates. This XMin theme contains about 130 lines of code in total, including the code in HTML templates and CSS (also counting empty lines).
1212

13-
```{bash, comment='', echo=3, eval=Sys.which('bash') != ''}
13+
```{bash, comment='', echo=3, eval=Sys.which('bash') != '', message=FALSE}
1414
cd ../..;
1515
if [ ! -f 'theme.toml' ]; then exit 0; fi # only run find below within the theme example site
1616
find . -not -path '*/exampleSite/*' \( -name '*.html' -o -name '*.css' \) | xargs wc -l

exampleSite/content/about.md

Lines changed: 27 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,59 +7,56 @@ author: Yihui Xie
77

88
The theme name "XMin" can be interpreted as "**X**ie's **Min**imal theme" (Xie is my last name) or "e**X**tremely **Min**imal theme".
99

10-
# config.toml
10+
# config.yaml
1111

1212
For this example site, I defined permalinks for two sections, `post` and `note`, so that the links to pages under these directories will contain the date info, e.g., `https://xmin.yihui.org/post/2016/02/14/a-plain-markdown-post/`. This is optional, and it is up to your personal taste of URLs.
1313

14-
```
15-
[permalinks]
16-
post = "/post/:year/:month/:day/:slug/"
17-
note = "/note/:year/:month/:day/:slug/"
14+
```yaml
15+
permalinks:
16+
note: "/note/:year/:month/:day/:slug/"
17+
post: "/post/:year/:month/:day/:slug/"
1818
```
1919
2020
You can define the menu through `menu.main`, e.g.,
2121

22-
```
23-
[[menu.main]]
24-
name = "Home"
25-
url = "/"
26-
weight = 1
27-
[[menu.main]]
28-
name = "About"
29-
url = "/about/"
30-
weight = 2
31-
[[menu.main]]
32-
name = "Categories"
33-
url = "/categories/"
34-
weight = 3
35-
[[menu.main]]
36-
name = "Tags"
37-
url = "/tags/"
38-
weight = 4
39-
[[menu.main]]
40-
name = "Subscribe"
41-
url = "/index.xml"
22+
```yaml
23+
menu:
24+
main:
25+
- name: Home
26+
url: ""
27+
weight: 1
28+
- name: About
29+
url: "about/"
30+
weight: 2
31+
- name: Categories
32+
url: "categories/"
33+
weight: 3
34+
- name: Tags
35+
url: "tags/"
36+
weight: 4
37+
- name: Subscribe
38+
url: "index.xml"
4239
```
4340

4441
Alternatively, you can add `menu: main` to the YAML metadata of any of your pages, so that these pages will appear in the menu.
4542

4643
The page footer can be defined in `.Params.footer`, and the text is treated as Markdown, e.g.,
4744

4845
```
49-
[params]
50-
footer = "© [Yihui Xie](https://yihui.org) 2017"
46+
params:
47+
footer: "© [Yihui Xie](https://yihui.org) 2017 -- 2021"
5148
```
5249
5350
# Custom layouts
5451
5552
There are two layout files under `layouts/partials/` that you may want to override: `head_custom.html` and `foot_custom.html`. This is how you inject arbitrary HTML code to the head and foot areas. For example, this site has a file `layouts/partials/foot_custom.html` to support LaTeX math via MathJax and center images automatically:
5653
5754
```html
58-
<script src="//yihui.org/js/math-code.js"></script>
59-
<script async src="//cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
55+
<script defer src="//yihui.org/js/math-code.js"></script>
56+
<script defer src="//cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
6057
</script>
6158
62-
<script async src="//yihui.org/js/center-img.js"></script>
59+
<script defer src="//yihui.org/js/center-img.js"></script>
6360
```
6461

6562
You can certainly enable highlight.js for syntax highlighting by yourself through `head_custom.html` and `foot_custom.html` if you want.

exampleSite/content/note/2017-06-14-another-note.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ tags:
99
slug: another-note
1010
---
1111

12-
I just discovered [an awesome tutorial](https://apreshill.rbind.io/post/up-and-running-with-blogdown/) on **blogdown** written by Alison. I have to admit this is _the_ best **blogdown** tutorial I have seen so far.
12+
I just discovered [an awesome tutorial](https://www.apreshill.com/blog/2020-12-new-year-new-blogdown/) on **blogdown** written by Alison. I have to admit this is _the_ best **blogdown** tutorial I have seen so far.
1313

14-
![](https://apreshill.rbind.io/img/posts/2017-06-12-up-and-running-with-blogdown/blogdown-signpost-4.png)
14+
![Alison's blogdown tutorial](https://www.apreshill.com/blog/2020-12-new-year-new-blogdown/03-blogdown-2021.png)
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<script src="//yihui.org/js/math-code.js"></script>
2-
<script async src="//mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>
1+
<script defer src="//yihui.org/js/math-code.js"></script>
2+
<script defer src="//mathjax.rstudio.com/latest/MathJax.js?config=TeX-MML-AM_CHTML"></script>
33

4-
<script async src="//yihui.org/js/center-img.js"></script>
4+
<script defer src="//yihui.org/js/center-img.js"></script>
55

66
{{ template "_internal/disqus.html" . }}

layouts/partials/footer.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{{ partial "foot_custom.html" . }}
33
{{ with .Site.Params.footer }}
44
<hr/>
5-
{{ . | markdownify }}
5+
{{ replace . "{Year}" now.Year | markdownify}}
66
{{ end }}
77
</footer>
88
</body>

static/css/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ body {
22
max-width: 800px;
33
margin: auto;
44
padding: 1em;
5-
line-height: 1.5em;
5+
line-height: 1.5;
66
}
77

88
/* header and footer areas */

0 commit comments

Comments
 (0)