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".
|
||||
|
||||
# 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.
|
||||
|
||||
```
|
||||
[permalinks]
|
||||
post = "/post/:year/:month/:day/:slug/"
|
||||
note = "/note/:year/:month/:day/:slug/"
|
||||
```yaml
|
||||
permalinks:
|
||||
note: "/note/:year/:month/:day/:slug/"
|
||||
post: "/post/:year/:month/:day/:slug/"
|
||||
```
|
||||
|
||||
You can define the menu through `menu.main`, e.g.,
|
||||
|
||||
```
|
||||
[[menu.main]]
|
||||
name = "Home"
|
||||
url = "/"
|
||||
weight = 1
|
||||
[[menu.main]]
|
||||
name = "About"
|
||||
url = "/about/"
|
||||
weight = 2
|
||||
[[menu.main]]
|
||||
name = "Categories"
|
||||
url = "/categories/"
|
||||
weight = 3
|
||||
[[menu.main]]
|
||||
name = "Tags"
|
||||
url = "/tags/"
|
||||
weight = 4
|
||||
[[menu.main]]
|
||||
name = "Subscribe"
|
||||
url = "/index.xml"
|
||||
```yaml
|
||||
menu:
|
||||
main:
|
||||
- name: Home
|
||||
url: ""
|
||||
weight: 1
|
||||
- name: About
|
||||
url: "about/"
|
||||
weight: 2
|
||||
- name: Categories
|
||||
url: "categories/"
|
||||
weight: 3
|
||||
- name: Tags
|
||||
url: "tags/"
|
||||
weight: 4
|
||||
- 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.
|
||||
@ -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.,
|
||||
|
||||
```
|
||||
[params]
|
||||
footer = "© [Yihui Xie](https://yihui.org) 2017"
|
||||
params:
|
||||
footer: "© [Yihui Xie](https://yihui.org) 2017 -- 2021"
|
||||
```
|
||||
|
||||
# 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:
|
||||
|
||||
```html
|
||||
<script 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="//yihui.org/js/math-code.js"></script>
|
||||
<script defer src="//cdn.bootcss.com/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
|
||||
</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.
|
||||
|
Loading…
Reference in New Issue
Block a user