Updating documentation

This commit is contained in:
2020-05-04 03:38:42 +01:00
parent d997eaf46d
commit e614a8ece9
2 changed files with 59 additions and 2 deletions

56
hugo.md
View File

@@ -1,7 +1,38 @@
# Hugo block
## Running server
You can use `hugo server -D` to run a server locally to view your site in real time.
The `-D` flag will include drafts - make sure to set the draft to false in any content before publishing.
## Initialising
### gitignore
TODO: Add this add a seperate Trilium link for resources.
Use <https://www.gitignore.io>.
Example for Hugo:
```text
# Created by https://www.gitignore.io/api/hugo
# Edit at https://www.gitignore.io/?templates=hugo
### Hugo ###
# Generated files by hugo
/public/
/resources/_gen/
# Executable may be added to repository
hugo.exe
hugo.darwin
hugo.linux
# End of https://www.gitignore.io/api/hugo
```
### Installation
<https://gohugo.io/getting-started/quick-start/>
@@ -42,10 +73,12 @@ In the `config.toml` you should configure the theme.
You should configure the menubar, taxonomies and the params of the homepage.
Example `config.toml` file: <https://git.panaetius.co.uk/hugo/blog/src/branch/master/blog/config.toml>.
#### Create a new Author
The author folder name should have `-` not `_`.
Based on <https://www.netlify.com/blog/2018/07/24/hugo-tips-how-to-create-author-pages/>.
Author is a taxomony, create a new author with (in the root of the hugo project):
@@ -54,7 +87,11 @@ Author is a taxomony, create a new author with (in the root of the hugo project)
Example file: <https://raw.githubusercontent.com/puresyntax71/hugo-theme-chunky-poster/master/exampleSite/content/authors/hugo-authors/_index.md>.
#### Create new page
Refer to the author in posts with the value in `name`.
#### Create new post
`hugo new post/post-title.md`
## Features
@@ -119,3 +156,18 @@ Aliases can be used to redirect people to another page.
For example, if you write a new blog post to replace an old one, you can add an alias to the old one in the new one. Then whenever someone visits the old page they will be redirected automatically to the new one.
<https://gohugo.io/content-management/urls/#aliases>.
### Shortcodes
<https://gohugo.io/content-management/shortcodes/#use-hugo-s-built-in-shortcodes>
Shortcodes are snippets provided by Hugo that allow quick linking to additional content. E.g you can refer to a youtube video in your markdown with: `{{< youtube ZJthWmvUzzc >}}`.
A really useful feature is the ability to quickly generate a link to another page in Hugo using its filename:
<https://gohugo.io/content-management/shortcodes/#use-hugo-s-built-in-shortcodes>
```markdown
[Neat]({{< ref "blog/neat.md" >}})
[Who]({{< relref "about.md#who" >}})
```