Improve README.md
This commit is contained in:
parent
f18b8c4e8e
commit
6e05d09971
55
README.md
55
README.md
|
@ -24,7 +24,8 @@ Add the following lines to your `config.toml`.
|
||||||
baseurl = "http://www.example.com" # Hostname (and path) to the root.
|
baseurl = "http://www.example.com" # Hostname (and path) to the root.
|
||||||
title = "johndoe" # Site title.
|
title = "johndoe" # Site title.
|
||||||
theme = "coder" # Set the theme.
|
theme = "coder" # Set the theme.
|
||||||
languagecode = "en" # The site’s language code.
|
languagecode = "en" # The site’s language code used to generate RSS.
|
||||||
|
defaultcontentlanguage = "en" # The default content language.
|
||||||
|
|
||||||
paginate = 20 # Default number of pages per page in pagination.
|
paginate = 20 # Default number of pages per page in pagination.
|
||||||
canonifyurls = true # Enable to turn relative URLs into absolute.
|
canonifyurls = true # Enable to turn relative URLs into absolute.
|
||||||
|
@ -33,7 +34,7 @@ pygmentsstyle = "b2" # Color-theme or style for syntax highlighting.
|
||||||
pygmentscodefences = true # Enable code fence background highlighting.
|
pygmentscodefences = true # Enable code fence background highlighting.
|
||||||
pygmentscodefencesguesssyntax = true # Enable syntax guessing for code fences without specified language.
|
pygmentscodefencesguesssyntax = true # Enable syntax guessing for code fences without specified language.
|
||||||
|
|
||||||
disqusShortname = "yourdiscussshortname" # Enable or disable Disqus
|
disqusShortname = "yourdiscussshortname" # Enable or disable Disqus.
|
||||||
|
|
||||||
[params] # theme parameters
|
[params] # theme parameters
|
||||||
author = "John Doe" # Author's name.
|
author = "John Doe" # Author's name.
|
||||||
|
@ -54,7 +55,7 @@ disqusShortname = "yourdiscussshortname" # Enable or disable Disqus
|
||||||
# RTL support
|
# RTL support
|
||||||
rtl = false
|
rtl = false
|
||||||
|
|
||||||
# Multilingualism
|
# Multilanguage mode
|
||||||
langseparator = "|" # Separates menus from language selectors when site is multilingual.
|
langseparator = "|" # Separates menus from language selectors when site is multilingual.
|
||||||
|
|
||||||
# Social links
|
# Social links
|
||||||
|
@ -82,28 +83,30 @@ disqusShortname = "yourdiscussshortname" # Enable or disable Disqus
|
||||||
url = "/about/"
|
url = "/about/"
|
||||||
```
|
```
|
||||||
|
|
||||||
To support multilingualism the configuration above needs to be extended by parameters for the specific languages.
|
You can look at full working [`config.toml`](https://github.com/luizdepra/hugo-coder/blob/master/exampleSite/config.toml) inside the [exampleSite](https://github.com/luizdepra/hugo-coder/tree/master/exampleSite) folder.
|
||||||
|
|
||||||
|
#### Multilingual mode
|
||||||
|
|
||||||
|
To use multilingual mode, the configuration above needs to be extended by parameters for the specific languages.
|
||||||
Each `language` section overrides default site's parameters when that language is chosen.
|
Each `language` section overrides default site's parameters when that language is chosen.
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
DefaultContentLanguage = "en" # needs to match one of the language sections, add this at the main section of the configuration
|
[params]
|
||||||
|
langseparator = "|" # separates menus from language selectors.
|
||||||
[params] # add this to theme params, do not duplicate tables
|
|
||||||
LangSeparator = "|" # separates menus from language selectors
|
|
||||||
|
|
||||||
|
|
||||||
[languages]
|
[languages]
|
||||||
|
|
||||||
[languages.en]
|
[languages.en]
|
||||||
languagename = "English"
|
languagename = "English" # The language name to be displayed in the selector.
|
||||||
|
title = "John Doe"
|
||||||
|
|
||||||
|
# You can configure the theme parameter for each language.
|
||||||
[languages.en.params]
|
[languages.en.params]
|
||||||
author = "John Doe" # Author's name.
|
author = "John Doe"
|
||||||
info = "Full Stack DevOps and Magician" # Author's job title or info.
|
info = "Full Stack DevOps and Magician"
|
||||||
description = "John Doe's personal website" # Site description.
|
description = "John Doe's personal website"
|
||||||
keywords = "blog,developer,personal" # Site keywords.
|
keywords = "blog,developer,personal"
|
||||||
|
|
||||||
[languages.en.menu]
|
[languages.en.menu] # It is possible to change the menu too.
|
||||||
|
|
||||||
[[languages.en.menu.main]]
|
[[languages.en.menu.main]]
|
||||||
name = "About"
|
name = "About"
|
||||||
|
@ -122,11 +125,9 @@ DefaultContentLanguage = "en" # needs to match one of the language sections, add
|
||||||
|
|
||||||
[languages.pl.params]
|
[languages.pl.params]
|
||||||
author = "John Doe"
|
author = "John Doe"
|
||||||
languagecode = "pl"
|
|
||||||
description = "Strona domowa John'a Doe"
|
description = "Strona domowa John'a Doe"
|
||||||
keywords = "blog,developer,strona domowa"
|
keywords = "blog,developer,strona domowa"
|
||||||
info = "Full Stack DevOps i Magik"
|
info = "Full Stack DevOps i Magik"
|
||||||
weight = 2.0
|
|
||||||
|
|
||||||
[languages.pl.menu]
|
[languages.pl.menu]
|
||||||
|
|
||||||
|
@ -140,12 +141,17 @@ DefaultContentLanguage = "en" # needs to match one of the language sections, add
|
||||||
weight = 2.0
|
weight = 2.0
|
||||||
url = "/pl/posts/"
|
url = "/pl/posts/"
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
You can look at full working [`config.toml`](https://github.com/luizdepra/hugo-coder/blob/master/exampleSite/config.toml) inside the [exampleSite](https://github.com/luizdepra/hugo-coder/tree/master/exampleSite) folder.
|
It is possible to force Hugo to render all default language content under the language code with `defaultContentLanguageInSubdir = true`.
|
||||||
|
In this case, remember to update your menus URLs (i.e. `/en/about/`).
|
||||||
|
|
||||||
### Build & Test
|
### Build & Test
|
||||||
|
|
||||||
|
It is necessary to have `less` and `uglifycss` installed to build and run the demo.
|
||||||
|
Assuming that already have NodeJS/NPM installed, run `npm install -g less uglifycss`.
|
||||||
|
|
||||||
To update or generate the minified CSS file:
|
To update or generate the minified CSS file:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -157,21 +163,20 @@ To build your site and test, run:
|
||||||
```
|
```
|
||||||
hugo server
|
hugo server
|
||||||
```
|
```
|
||||||
|
|
||||||
To preview the exampleSite, run
|
To preview the exampleSite, run
|
||||||
|
|
||||||
```
|
```
|
||||||
make demo
|
make demo
|
||||||
```
|
```
|
||||||
|
|
||||||
The above command copies current state of the theme to exampleSite/themes and starts hugo with hugo serve -D (Go does not support Symlink directories)
|
The above command copies current state of the theme to exampleSite/themes and starts hugo with hugo serve -D (Go does not support Symlink directories)
|
||||||
|
|
||||||
### Disqus
|
### Disqus
|
||||||
Add the following line to your config,
|
|
||||||
```disqusShortname = "yourdiscussshortname"``` When this is set, all posts are disqus enabled
|
|
||||||
You can disable comments for a post by adding the following to your page meta data.
|
|
||||||
```disable_comments: true```
|
|
||||||
|
|
||||||
|
Add the following line to your config, ```disqusShortname = "yourdiscussshortname"``` When this is set, all posts are disqus enabled
|
||||||
|
You can disable comments for a post by adding the following to your page meta data: ```disable_comments: true```.
|
||||||
|
|
||||||
## To Do
|
|
||||||
- Tags, Categories and Series
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue