Disqus support, exampleSite preview through make commando (#16)

* Added disqus support

* reformatted README

* Updated example config

* Added a make demo command to easy run the exampleSite.
Also good for developing new features but don`t want to setup a
different project for it

* Updated readme

* Working on my .md skillsw
This commit is contained in:
Maikel 2018-05-01 20:59:02 +02:00 committed by Luiz F. A. de Prá
parent 0f2bd0c0a6
commit 826fa2ee18
5 changed files with 41 additions and 4 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
**/themes/

View File

@ -3,7 +3,7 @@ LESS_FILE = style.less
CSS_DIR = ./static/css CSS_DIR = ./static/css
CSS_FILE = style.min.css CSS_FILE = style.min.css
CSS_TMP_FILE = tmp.css CSS_TMP_FILE = tmp.css
current_dir = $(shell pwd)
.PHONY: clean build .PHONY: clean build
@ -12,5 +12,19 @@ build: clean
uglifycss $(CSS_DIR)/$(CSS_TMP_FILE) > $(CSS_DIR)/$(CSS_FILE) uglifycss $(CSS_DIR)/$(CSS_TMP_FILE) > $(CSS_DIR)/$(CSS_FILE)
rm -f $(CSS_DIR)/$(CSS_TMP_FILE) rm -f $(CSS_DIR)/$(CSS_TMP_FILE)
demo: build
mkdir -p exampleSite/themes/coder
mkdir -p exampleSite/themes/coder/archetypes
mkdir -p exampleSite/themes/coder/images
mkdir -p exampleSite/themes/coder/layouts
mkdir -p exampleSite/themes/coder/static
cp -r $(current_dir)/archetypes/* exampleSite/themes/coder/archetypes/
cp -r $(current_dir)/images/* exampleSite/themes/coder/images
cp -r $(current_dir)/layouts/* exampleSite/themes/coder/layouts
cp -r $(current_dir)/static/* exampleSite/themes/coder/static
cp -r $(current_dir)/theme.toml exampleSite/themes/coder/theme.toml
cd examplesite && hugo serve -D
clean: clean:
rm -f $(CSS_DIR)/*.css rm -f $(CSS_DIR)/*.css
rm -rf exampleSite/themes/coder

View File

@ -54,6 +54,9 @@ theme = "coder" # set the theme
url = "/about/" url = "/about/"
``` ```
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. 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.
### Build & Test ### Build & Test
@ -69,10 +72,20 @@ To build your site and test, run:
``` ```
hugo server hugo server
``` ```
To preview the exampleSite, run
```
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)
### Disqus
dd 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 ## To Do
- Comments (probably not Disqus, sorry)
- Tags, Categories and Series - Tags, Categories and Series
## License ## License

View File

@ -12,6 +12,8 @@ pygmentsstyle = "b2"
pygmentscodefences = true pygmentscodefences = true
pygmentscodefencesguesssyntax = true pygmentscodefencesguesssyntax = true
disqusShortname = "yourdiscussshortname"
[params] [params]
author = "John Doe" author = "John Doe"
description = "John Doe's personal website" description = "John Doe's personal website"

View File

@ -32,4 +32,11 @@
{{ .Content }} {{ .Content }}
</article> </article>
<br/>
{{ if and (not (eq .Site.DisqusShortname "" )) (eq (.Params.disable_comments | default false) false)}}
{{ template "_internal/disqus.html" . }}
{{ end }}
</section> </section>