From c073ce865a97a08c5348f9dcc5af91a3aa64c178 Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Thu, 11 Nov 2021 23:24:37 -0600 Subject: close #47: the example site has switched to config.yaml --- exampleSite/content/about.md | 57 +++++++++++++++++++++----------------------- 1 file 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 = "© [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 - - + - + ``` You can certainly enable highlight.js for syntax highlighting by yourself through `head_custom.html` and `foot_custom.html` if you want. -- cgit