mirror of
https://github.com/yihui/hugo-xmin.git
synced 2024-11-22 08:29:19 +02:00
close #47: the example site has switched to config.yaml
This commit is contained in:
parent
181e25cdef
commit
c073ce865a
|
@ -7,38 +7,35 @@ author: Yihui Xie
|
||||||
|
|
||||||
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".
|
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".
|
||||||
|
|
||||||
# config.toml
|
# config.yaml
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
[permalinks]
|
permalinks:
|
||||||
post = "/post/:year/:month/:day/:slug/"
|
note: "/note/:year/:month/:day/:slug/"
|
||||||
note = "/note/:year/:month/:day/:slug/"
|
post: "/post/:year/:month/:day/:slug/"
|
||||||
```
|
```
|
||||||
|
|
||||||
You can define the menu through `menu.main`, e.g.,
|
You can define the menu through `menu.main`, e.g.,
|
||||||
|
|
||||||
```
|
```yaml
|
||||||
[[menu.main]]
|
menu:
|
||||||
name = "Home"
|
main:
|
||||||
url = "/"
|
- name: Home
|
||||||
weight = 1
|
url: ""
|
||||||
[[menu.main]]
|
weight: 1
|
||||||
name = "About"
|
- name: About
|
||||||
url = "/about/"
|
url: "about/"
|
||||||
weight = 2
|
weight: 2
|
||||||
[[menu.main]]
|
- name: Categories
|
||||||
name = "Categories"
|
url: "categories/"
|
||||||
url = "/categories/"
|
weight: 3
|
||||||
weight = 3
|
- name: Tags
|
||||||
[[menu.main]]
|
url: "tags/"
|
||||||
name = "Tags"
|
weight: 4
|
||||||
url = "/tags/"
|
- name: Subscribe
|
||||||
weight = 4
|
url: "index.xml"
|
||||||
[[menu.main]]
|
|
||||||
name = "Subscribe"
|
|
||||||
url = "/index.xml"
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Alternatively, you can add `menu: main` to the YAML metadata of any of your pages, so that these pages will appear in the menu.
|
Alternatively, you can add `menu: main` to the YAML metadata of any of your pages, so that these pages will appear in the menu.
|
||||||
|
@ -46,8 +43,8 @@ Alternatively, you can add `menu: main` to the YAML metadata of any of your page
|
||||||
The page footer can be defined in `.Params.footer`, and the text is treated as Markdown, e.g.,
|
The page footer can be defined in `.Params.footer`, and the text is treated as Markdown, e.g.,
|
||||||
|
|
||||||
```
|
```
|
||||||
[params]
|
params:
|
||||||
footer = "© [Yihui Xie](https://yihui.org) 2017"
|
footer: "© [Yihui Xie](https://yihui.org) 2017 -- 2021"
|
||||||
```
|
```
|
||||||
|
|
||||||
# Custom layouts
|
# Custom layouts
|
||||||
|
@ -55,11 +52,11 @@ The page footer can be defined in `.Params.footer`, and the text is treated as M
|
||||||
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:
|
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:
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<script src="//yihui.org/js/math-code.js"></script>
|
<script defer src="//yihui.org/js/math-code.js"></script>
|
||||||
<script async src="//cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
|
<script defer src="//cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script async src="//yihui.org/js/center-img.js"></script>
|
<script defer src="//yihui.org/js/center-img.js"></script>
|
||||||
```
|
```
|
||||||
|
|
||||||
You can certainly enable highlight.js for syntax highlighting by yourself through `head_custom.html` and `foot_custom.html` if you want.
|
You can certainly enable highlight.js for syntax highlighting by yourself through `head_custom.html` and `foot_custom.html` if you want.
|
||||||
|
|
Loading…
Reference in New Issue