hugo-coder-fork/README.md

213 lines
6.3 KiB
Markdown
Raw Normal View History

2018-05-28 00:43:13 +00:00
![Hugo Coder Logotype](https://github.com/luizdepra/hugo-coder/blob/master/images/logos/logotype-a.png)
2018-03-01 01:38:59 +00:00
A simple and clean blog theme for Hugo.
![](https://github.com/luizdepra/hugo-coder/blob/master/images/screenshot.png)
2018-09-09 22:56:56 +00:00
**HugoCoder uses Asset Pipeline now!**
2018-08-21 19:32:17 +00:00
To use this theme you need Hugo Extended Version, v0.43 or later. But, if you still want to use the old version, you can clone the [v1.0](https://github.com/luizdepra/hugo-coder/releases/tag/v1.0) release.
2018-03-01 01:38:59 +00:00
## How to use this theme
To use `hugo-coder` go through the following steps.
### Download
Clone this repository into your Hugo project.
```
git clone https://github.com/luizdepra/hugo-coder.git themes/coder
```
### Configuration
Add the following lines to your `config.toml`.
```toml
baseurl = "http://www.example.com" # Hostname (and path) to the root.
title = "johndoe" # Site title.
2018-09-09 22:56:56 +00:00
theme = "hugo-coder" # Set the theme.
2018-07-09 00:20:50 +00:00
languagecode = "en" # The sites language code used to generate RSS.
defaultcontentlanguage = "en" # The default content language.
paginate = 20 # Default number of pages per page in pagination.
canonifyurls = true # Enable to turn relative URLs into absolute.
pygmentsstyle = "b2" # Color-theme or style for syntax highlighting.
pygmentscodefences = true # Enable code fence background highlighting.
pygmentscodefencesguesssyntax = true # Enable syntax guessing for code fences without specified language.
2018-03-01 01:38:59 +00:00
2018-07-09 00:20:50 +00:00
disqusShortname = "yourdiscussshortname" # Enable or disable Disqus.
2018-03-01 01:38:59 +00:00
[params] # theme parameters
author = "John Doe" # Author's name.
info = "Full Stack DevOps and Magician" # Author's job title or info.
description = "John Doe's personal website" # Site description.
keywords = "blog,developer,personal" # Site keywords.
avatarurl = "images/avatar.jpg" # Contain the path of the optionnal avatar in the static folder.
footercontent = "Enter a text here." # Add footer content
# Whether you want to hide copyright and credits in the footer.
hideCredits = false
hideCopyright = false
# to switch bewteen LTR and RTL layout
rtl = false
# Custom CSS
2018-06-18 17:55:42 +00:00
custom_css = []
2018-03-01 01:38:59 +00:00
# Social links
[[params.social]]
name = "Github"
2018-08-22 11:36:14 +00:00
icon = "fab fa-github fa-2x"
2018-03-01 01:38:59 +00:00
weight = 1
url = "https://github.com/johndoe/"
[[params.social]]
2018-08-22 11:36:14 +00:00
name = "Gitlab"
icon = "fab fa-gitlab fa-2x"
2018-03-01 01:38:59 +00:00
weight = 2
2018-08-22 11:36:14 +00:00
url = "https://gitlab.com/johndoe/"
2018-03-01 01:38:59 +00:00
[[params.social]]
2018-08-22 11:36:14 +00:00
name = "Twitter"
icon = "fab fa-twitter fa-2x"
2018-03-01 01:38:59 +00:00
weight = 3
2018-08-22 11:36:14 +00:00
url = "https://twitter.com/johndoe/"
2018-03-01 01:38:59 +00:00
# Menu links
[[menu.main]]
name = "Blog"
weight = 1
url = "/posts/"
[[menu.main]]
name = "About"
weight = 2
url = "/about/"
```
2018-07-09 00:20:50 +00:00
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.
2018-07-08 23:12:36 +00:00
2018-07-09 00:20:50 +00:00
#### Multilingual mode
2018-07-08 23:12:36 +00:00
2018-07-09 00:20:50 +00:00
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.
2018-07-08 23:12:36 +00:00
2018-07-09 00:20:50 +00:00
```toml
[params]
author = "John Doe"
2018-07-08 23:12:36 +00:00
[languages]
[languages.en]
2018-07-09 00:20:50 +00:00
languagename = "English" # The language name to be displayed in the selector.
title = "John Doe"
2018-07-08 23:12:36 +00:00
2018-07-09 00:20:50 +00:00
# You can configure the theme parameter for each language.
2018-07-08 23:12:36 +00:00
[languages.en.params]
2018-07-09 00:20:50 +00:00
info = "Full Stack DevOps and Magician"
description = "John Doe's personal website"
keywords = "blog,developer,personal"
2018-07-08 23:12:36 +00:00
2018-07-09 00:20:50 +00:00
[languages.en.menu] # It is possible to change the menu too.
2018-07-08 23:12:36 +00:00
[[languages.en.menu.main]]
name = "About"
weight = 1.0
url = "/about/"
2018-07-08 23:12:36 +00:00
[[languages.en.menu.main]]
name = "Blog"
weight = 2.0
url = "/posts/"
[languages.pl]
languagename = "Polski"
title = "John Doe po polsku"
[languages.pl.params]
2018-07-09 00:20:50 +00:00
description = "Strona domowa John'a Doe"
keywords = "blog,developer,strona domowa"
info = "Full Stack DevOps i Magik"
2018-07-08 23:12:36 +00:00
[languages.pl.menu]
[[languages.pl.menu.main]]
name = "O mnie"
weight = 1.0
url = "/pl/about/"
[[languages.pl.menu.main]]
name = "Blog"
weight = 2.0
url = "/pl/posts/"
2018-07-09 00:20:50 +00:00
2018-07-08 23:12:36 +00:00
```
2018-07-09 00:20:50 +00:00
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/`).
2018-03-01 01:38:59 +00:00
### Build & Test
2018-07-09 00:20:50 +00:00
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`.
2018-03-23 19:49:06 +00:00
To update or generate the minified CSS file:
```
make build
```
2018-03-01 01:38:59 +00:00
To build your site and test, run:
```
hugo server
```
2018-07-09 00:20:50 +00:00
To preview the exampleSite, run
2018-07-09 00:20:50 +00:00
```
make demo
```
2018-07-09 00:20:50 +00:00
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)
2018-03-01 01:38:59 +00:00
### Disqus
2018-03-01 01:38:59 +00:00
2018-07-09 00:20:50 +00:00
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```.
2018-03-01 01:38:59 +00:00
## License
Coder is licensed under the [MIT license](https://github.com/luizdepra/hugo-coder/blob/master/LICENSE.md).
## Author
2018-05-28 12:28:38 +00:00
[Luiz de Prá](https://github.com/luizdepra)
## Contributors
- [Gabor Nagy](https://github.com/Aigeruth)
- [Ihor Dvoretskyi](https://github.com/idvoretskyi)
- [Jan Baudisch](https://github.com/flyingP0tat0)
- [Jiri Hubacek](https://github.com/qeef)
- [Khosrow Moossavi](https://github.com/khos2ow)
- [Maikel](https://github.com/mbollemeijer)
- [peterrus](https://github.com/peterrus)
- [Ralf Junghanns](https://github.com/rabbl)
- [tobaloidee](https://github.com/Tobaloidee)
- [Vlad Ionescu](https://github.com/Vlaaaaaaad)
- [Niels Reijn](https://github.com/reijnn)
- [Harry Khanna](https://github.com/hkhanna)
- [rdhox](https://rdhox.io)
- [Chip Senkbeil](https://github.com/chipsenkbeil)
2018-07-08 23:12:36 +00:00
- [Tomasz Wąsiński](https://github.com/wasinski)
2018-03-01 01:38:59 +00:00
## Special Thanks
- Gleen McComb, for his great [article](https://glennmccomb.com/articles/how-to-build-custom-hugo-pagination/) about custom pagination.
2018-03-23 19:49:06 +00:00
- All contributors, for every PR and Issue reported.