aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYihui Xie <xie@yihui.name>2021-11-11 23:24:37 -0600
committerYihui Xie <xie@yihui.name>2021-11-11 23:24:37 -0600
commitc073ce865a97a08c5348f9dcc5af91a3aa64c178 (patch)
treed2b1596a800c582d9e3be4da7ba9ea26012c34bc
parent181e25cdef57ea2a03e6a10f65da9f0c03bd2f99 (diff)
downloadzk-theme-c073ce865a97a08c5348f9dcc5af91a3aa64c178.tar.gz
zk-theme-c073ce865a97a08c5348f9dcc5af91a3aa64c178.zip
close #47: the example site has switched to config.yaml
-rw-r--r--exampleSite/content/about.md57
1 files changed, 27 insertions, 30 deletions
diff --git a/exampleSite/content/about.md b/exampleSite/content/about.md
index 210bb35..804e82b 100644
--- a/exampleSite/content/about.md
+++ b/exampleSite/content/about.md
@@ -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 = "&copy; [Yihui Xie](https://yihui.org) 2017"
+params:
+ footer: "&copy; [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.