diff --git a/README.md b/README.md index bae81dd..ef204fe 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,20 @@ # github-style +## Init hugo site + +```bash +hugo new site mysite +cd mysite +``` + ## Install the theme ```bash -mkdir themes git submodule add git@github.com:MeiK2333/github-style.git themes/github-style ``` ## Update the theme - +If you just installed the theme, it is already in the lattest version. If not, you can update using the below commands ```bash cd themes/github-style git pull @@ -20,7 +26,7 @@ git pull hugo new about.md ``` -add `layout = "about"` to `content/about.md` +This creates content/about.md file. Then add `layout = "about"` to `content/about.md`, and remove the line `draft:true` ``` --- @@ -32,6 +38,25 @@ layout: "about" about me ``` +## Add new posts +Hugo will create a post with `draft: true`, change it to false in order for it to show in the website. +``` +hugo new posts/title_of_the_post.md +``` + +## Limit display content +Use `` to seperate content that will display in the posts page as abstraction and the rest of the content. +``` +--- +title: "title" +date: 2019-10-22T18:46:47+08:00 +draft: false +--- +abstraction show in the post page + +other content +``` + ## config.toml example ```toml @@ -55,3 +80,40 @@ copyright = "© 2019. Theme by {{ partial "extended_head.html" . }} - - {{ template "_internal/google_analytics_async.html" . }} + + {{ if eq (getenv "HUGO_ENV") "production"}} + {{ template "_internal/google_analytics_async.html" . }} + {{ end }} \ No newline at end of file