Skip to content
Permalink
Browse files

Merge branch 'master' into master

  • Loading branch information...
halogenica committed Sep 21, 2019
2 parents b85a463 + d4edb6a commit 7e66822ba0cc6b20d01b9864579524a6ae0c46a0
@@ -61,19 +61,24 @@ To use this feature, uncomment and fill out the `disqusShortname` parameter in `

### Staticman support

Add *staticman* configuration section in `config.toml` or `config.yaml`
Add *Staticman* configuration section in `config.toml` or `config.yaml`

Sample `config.yaml` configuration
Sample `config.toml` configuration

```
staticman:
api: https://api.staticman.net/v2/entry/<USERNAME>/<REPOSITORY-BLOGNAME>/master/comments
pulls: https://github.com/<USERNAME>/<REPOSITORY-BLOGNAME>/pulls
recaptcha:
[Params.staticman]
api = "https://<API-ENDPOINT>/v3/entry/{GIT-HOST}/<USERNAME>/<REPOSITORY-BLOGNAME>/master/comments"
[Params.staticman.recaptcha]
sitekey: "6LeGeTgUAAAAAAqVrfTwox1kJQFdWl-mLzKasV0v"
secret: "hsGjWtWHR4HK4pT7cUsWTArJdZDxxE2pkdg/ArwCguqYQrhuubjj3RS9C5qa8xu4cx/Y9EwHwAMEeXPCZbLR9eW1K9LshissvNcYFfC/b8KKb4deH4V1+oqJEk/JcoK6jp6Rr2nZV4rjDP9M7nunC3WR5UGwMIYb8kKhur9pAic="
```

Note: The public `API-ENDPOINT` https://staticman.net is currently hitting its API limit, so one may use other API instances to provide Staticman comment service.

The section `[Params.staticman.recaptcha]` is *optional*. To add reCAPTCHA to your site, you have to replace the default values with your own ones (to be obtained from Google.) The site `secret` has to be encrypted with

https://<API-ENDPOINT>/v3/encrypt/<SITE-SECRET>

You must also configure the `staticman.yml` in you blog website.

```
@@ -99,28 +104,23 @@ comments:
secret: "hsGjWtWHR4HK4pT7cUsWTArJdZDxxE2pkdg/ArwCguqYQrhuubjj3RS9C5qa8xu4cx/Y9EwHwAMEeXPCZbLR9eW1K9LshissvNcYFfC/b8KKb4deH4V1+oqJEk/JcoK6jp6Rr2nZV4rjDP9M7nunC3WR5UGwMIYb8kKhur9pAic="
```


If you *don't* have the section `[Params.staticman]` in `config.toml`, you *won't* need the section `reCaptcha` in `staticman.yml`

### Google Analytics

To add Google Analytics, simply sign up to [Google Analytics](https://www.google.com/analytics/) to obtain your Google Tracking ID, and add this tracking ID to the `googleAnalytics` parameter in `config.toml`.

### Commit SHA on the footer

If the source of your site is in a Git repo, the SHA corresponding to the commit the site is built from can be shown on the footer. To do so, two environment variables have to be set (`GIT_COMMIT_SHA` and `GIT_COMMIT_SHA_SHORT`) and parameter `commit` has to be defined in the config file:
If the source of your site is in a Git repo, the SHA corresponding to the commit the site is built from can be shown on the footer. To do so, two site parameters `commit` has to be defined in the config file `config.toml`:

```
enableGitInfo = true
[Params]
commit = "https://github.com/<username>/<siterepo>/tree/"
```

This can be achieved by running the next command prior to calling Hugo:

```
GIT_COMMIT_SHA=`git rev-parse --verify HEAD` GIT_COMMIT_SHA_SHORT=`git rev-parse --short HEAD`
```

See at [xor-gate/xor-gate.org](https://github.com/xor-gate/xor-gate.org) an example of how to add it to a continuous integration system.
See at [vincenttam/vincenttam.gitlab.io](https://gitlab.com/vincenttam/vincenttam.gitlab.io) for an example of how to add it to a continuous integration system.

### Extra shortcodes

@@ -10,12 +10,6 @@ url = "https://www.facebook.com/%s"
title = "Facebook"
icon = "fab fa-facebook"

[[social_icons]]
id = "googleplus"
url = "https://plus.google.com/%s"
title = "Google+"
icon = "fab fa-google-plus"

[[social_icons]]
id = "github"
url = "https://github.com/%s"
@@ -40,6 +34,12 @@ url = "https://twitter.com/%s"
title = "Twitter"
icon = "fab fa-twitter"

[[social_icons]]
id = "slack"
url = "https://%s.slack.com/"
title = "Slack"
icon = "fab fa-slack"

[[social_icons]]
id = "reddit"
url = "https://reddit.com/u/%s"
@@ -110,7 +110,7 @@ icon = "fas fa-gamepad"
id = "keybase"
url = "https://keybase.io/%s"
title = "Keybase"
icon = "fas fa-key"
icon = "fab fa-keybase"

[[social_icons]]
id = "vk"
@@ -141,3 +141,21 @@ id = "codepen"
url = "https://codepen.io/%s"
title = "CodePen"
icon = "fab fa-codepen"

[[social_icons]]
id = "kaggle"
url = "https://www.kaggle.com/%s"
title = "kaggle"
icon = "fab fa-kaggle"

[[social_icons]]
id = "mastodon"
url = "https://%s"
title = "Mastodon"
icon = "fab fa-mastodon"

[[social_icons]]
id = "weibo"
url = "https://weibo.com/%s"
title = "Weibo"
icon = "fab fa-weibo"
@@ -16,6 +16,7 @@ pygmentsCodefencesGuessSyntax = true
[Params]
# homeTitle = "Beautiful Hugo Theme" # Set a different text for the header on the home page
subtitle = "Build a beautiful and simple website in minutes"
mainSections = ["post","posts"]
logo = "img/avatar-icon.png" # Expecting square dimensions
favicon = "img/favicon.ico"
dateFormat = "January 2, 2006"
@@ -28,6 +29,7 @@ pygmentsCodefencesGuessSyntax = true
socialShare = true
delayDisqus = true
showRelatedPosts = true
# hideAuthor = true
# gcse = "012345678901234567890:abcdefghijk" # Get your code from google.com/cse. Make sure to go to "Look and Feel" and change Layout to "Full Width" and Theme to "Classic"

#[[Params.bigimg]]
@@ -47,7 +49,6 @@ pygmentsCodefencesGuessSyntax = true
website = "yourwebsite.com"
email = "youremail@domain.com"
facebook = "username"
googleplus = "+username" # or xxxxxxxxxxxxxxxxxxxxx
github = "username"
gitlab = "username"
bitbucket = "username"
@@ -68,6 +69,10 @@ pygmentsCodefencesGuessSyntax = true
telegram = "username"
500px = "username"
codepen = "username"
mastodon = "url"
kaggle = "username"
weibo = "username"
slack = "username"

[[menu.main]]
name = "Blog"
@@ -5,7 +5,7 @@ date: 2015-02-20
tags: ["example", "markdown"]
---

You can write regular [markdown](http://markdowntutorial.com/) here and Jekyll will automatically convert it to a nice webpage. I strongly encourage you to [take 5 minutes to learn how to write in markdown](http://markdowntutorial.com/) - it'll teach you how to transform regular text into bold/italics/headings/tables/etc.
You can write regular [markdown](http://markdowntutorial.com/) here and [Hugo](https://gohugo.io) will automatically convert it to a nice webpage. I strongly encourage you to [take 5 minutes to learn how to write in markdown](http://markdowntutorial.com/) - it'll teach you how to transform regular text into bold/italics/headings/tables/etc.

**Here is some bold text**

@@ -33,7 +33,7 @@

# Footer
- id: poweredBy # Accepts HTML
translation: '<a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a> powered &nbsp;&bull;&nbsp; Tema por <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adaptado para <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'
translation: '<a href="http://gohugo.io">Hugo v{{ .Site.Hugo.Version }}</a> powered &nbsp;&bull;&nbsp; Tema por <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adaptado para <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'

# Navigation
- id: toggleNavigation
@@ -33,7 +33,7 @@

# Footer
- id: poweredBy # Accepts HTML
translation: '<a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a> powered &nbsp;&bull;&nbsp; Theme by <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adapted to <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'
translation: '<a href="http://gohugo.io">Hugo v{{ .Site.Hugo.Version }}</a> powered &nbsp;&bull;&nbsp; Theme by <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adapted to <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'

# Navigation
- id: toggleNavigation
@@ -33,7 +33,7 @@

# Footer
- id: poweredBy # Accepts HTML
translation: '<a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a> powered &nbsp;&bull;&nbsp; Theme by <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adapted to <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'
translation: '<a href="http://gohugo.io">Hugo v{{ .Site.Hugo.Version }}</a> powered &nbsp;&bull;&nbsp; Theme by <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adapted to <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'

# Navigation
- id: toggleNavigation
@@ -33,7 +33,7 @@

# Footer
- id: poweredBy # Accepts HTML
translation: '<a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a>-povigita &nbsp;&bull;&nbsp; Haŭto de <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adaptiĝis al <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'
translation: '<a href="http://gohugo.io">Hugo v{{ .Site.Hugo.Version }}</a>-povigita &nbsp;&bull;&nbsp; Haŭto de <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adaptiĝis al <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'

# Navigation
- id: toggleNavigation
@@ -33,7 +33,7 @@

# Footer
- id: poweredBy # Accepts HTML
translation: '<a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a> powered &nbsp;&bull;&nbsp; Theme by <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adapted to <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'
translation: '<a href="http://gohugo.io">Hugo v{{ .Site.Hugo.Version }}</a> powered &nbsp;&bull;&nbsp; Theme by <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adapted to <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'

# Navigation
- id: toggleNavigation
@@ -33,7 +33,7 @@

# Footer
- id: poweredBy # Accepts HTML
translation: 'Carbure avec <a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a>&nbsp;&bull;&nbsp; Avec le Theme <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adapté en <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'
translation: 'Carbure avec <a href="http://gohugo.io">Hugo v{{ .Site.Hugo.Version }}</a>&nbsp;&bull;&nbsp; Avec le Theme <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adapté en <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'

# Navigation
- id: toggleNavigation
@@ -33,7 +33,7 @@

# Footer
- id: poweredBy # Accepts HTML
translation: '<a href="http://gohugo.io">Sviluppato con Hugo v{{ .Hugo.Version }}</a> &nbsp;&bull;&nbsp; Tema: <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adattato a <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'
translation: '<a href="http://gohugo.io">Sviluppato con Hugo v{{ .Site.Hugo.Version }}</a> &nbsp;&bull;&nbsp; Tema: <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adattato a <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'

# Navigation
- id: toggleNavigation
@@ -33,7 +33,7 @@

# Footer
- id: poweredBy # Accepts HTML
translation: '起動力に<a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a> &nbsp;&bull;&nbsp; テーマに<a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a>に基づいている<a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'
translation: '起動力に<a href="http://gohugo.io">Hugo v{{ .Site.Hugo.Version }}</a> &nbsp;&bull;&nbsp; テーマに<a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a>に基づいている<a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'

# Navigation
- id: toggleNavigation
@@ -33,7 +33,7 @@

# Footer
- id: poweredBy # Accepts HTML
translation: 'Kjører på <a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a>&nbsp;&bull;&nbsp; Tema fra <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> tilpasset til <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'
translation: 'Kjører på <a href="http://gohugo.io">Hugo v{{ .Site.Hugo.Version }}</a>&nbsp;&bull;&nbsp; Tema fra <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> tilpasset til <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'

# Navigation
- id: toggleNavigation
@@ -33,7 +33,7 @@

# Footer
- id: poweredBy # Accepts HTML
translation: '<a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a>-aangedreven &nbsp;&bull;&nbsp; Thema door <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> aangepast voor <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'
translation: '<a href="http://gohugo.io">Hugo v{{ .Site.Hugo.Version }}</a>-aangedreven &nbsp;&bull;&nbsp; Thema door <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> aangepast voor <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'

# Navigation
- id: toggleNavigation
@@ -33,7 +33,7 @@

# Footer
- id: poweredBy # Accepts HTML
translation: '<a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a> powered &nbsp;&bull;&nbsp; Theme by <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adapted to <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'
translation: '<a href="http://gohugo.io">Hugo v{{ .Site.Hugo.Version }}</a> powered &nbsp;&bull;&nbsp; Theme by <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a> adapted to <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a>'

# Navigation
- id: toggleNavigation
@@ -33,7 +33,7 @@

# Footer
- id: poweredBy # Accepts HTML
translation: 'На базе <a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a> &nbsp;&bull;&nbsp; Тема <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a> на базе <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a>'
translation: 'На базе <a href="http://gohugo.io">Hugo v{{ .Site.Hugo.Version }}</a> &nbsp;&bull;&nbsp; Тема <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a> на базе <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a>'

# Navigation
- id: toggleNavigation
@@ -33,7 +33,7 @@

# Footer
- id: poweredBy # Accepts HTML
translation: '由 <a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a> 强力驱动 &nbsp;&bull;&nbsp; 主题 <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a> 移植自 <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a>'
translation: '由 <a href="http://gohugo.io">Hugo v{{ .Site.Hugo.Version }}</a> 强力驱动 &nbsp;&bull;&nbsp; 主题 <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a> 移植自 <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a>'

# Navigation
- id: toggleNavigation
@@ -33,7 +33,7 @@

# Footer
- id: poweredBy # Accepts HTML
translation: '由 <a href="http://gohugo.io">Hugo v{{ .Hugo.Version }}</a> 提供 &nbsp;&bull;&nbsp; 主題 <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a> 移植自 <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a>'
translation: '由 <a href="http://gohugo.io">Hugo v{{ .Site.Hugo.Version }}</a> 提供 &nbsp;&bull;&nbsp; 主題 <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a> 移植自 <a href="http://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a>'

# Navigation
- id: toggleNavigation
@@ -8,6 +8,7 @@
{{ block "header" . }}{{ partial "header.html" . }}{{ end }}
{{ block "main" . }}{{ end }}
{{ partial "footer.html" . }}
{{ block "footer" . }}{{ end }}
</body>
</html>

@@ -47,12 +47,12 @@ <h3 class="post-subtitle">
<ul class="pager main-pager">
{{ if .Paginator.HasPrev }}
<li class="previous">
<a href="{{ .URL }}page/{{ .Paginator.Prev.PageNumber }}/">&larr; {{ i18n "newerPosts" }}</a>
<a href="{{ .Permalink }}page/{{ .Paginator.Prev.PageNumber }}/">&larr; {{ i18n "newerPosts" }}</a>
</li>
{{ end }}
{{ if .Paginator.HasNext }}
<li class="next">
<a href="{{ .URL }}page/{{ .Paginator.Next.PageNumber }}/">{{ i18n "olderPosts" }} &rarr;</a>
<a href="{{ .Permalink }}page/{{ .Paginator.Next.PageNumber }}/">{{ i18n "olderPosts" }} &rarr;</a>
</li>
{{ end }}
</ul>
@@ -23,14 +23,19 @@
{{ end }}

{{ if .Site.Params.showRelatedPosts }}
{{ $related := .Site.RegularPages.Related . | first 3 }}
{{ with $related }}
<h4 class="see-also">{{ i18n "seeAlso" }}</h4>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ range first 1 (where (where .Site.Pages ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }}
{{ $.Scratch.Set "has_related" true }}
{{ end }}
</ul>

{{ if $.Scratch.Get "has_related" }}
<h4 class="see-also">{{ i18n "seeAlso" }}</h4>
<ul>
{{ $num_to_show := .Site.Params.related_content_limit | default 5 }}
{{ range first $num_to_show (where (where .Site.Pages ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>

{{ end }}
{{ end }}
</article>
@@ -9,7 +9,7 @@
{{ end }}

<div class="posts-list">
{{ $pag := .Paginate (where .Data.Pages "Type" "post") }}
{{ $pag := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) }}
{{ range $pag.Pages }}
<article class="post-preview">
<a href="{{ .Permalink }}">
@@ -22,6 +22,9 @@ <h3 class="post-subtitle">
{{ if .Params.image }}
<img src="{{ .Params.image }}" alt="{{ .Title }}" class="img-title" />
{{ end }}
{{ if .Params.video }}
<video src="{{ .Params.video }}" loop autoplay muted playsinline class="img-title" />
{{ end }}
</a>

{{ partial "post_meta.html" . }}
@@ -49,12 +52,12 @@ <h3 class="post-subtitle">
<ul class="pager main-pager">
{{ if .Paginator.HasPrev }}
<li class="previous">
<a href="{{ .URL }}page/{{ .Paginator.Prev.PageNumber }}/">&larr; {{ i18n "newerPosts" }}</a>
<a href="{{ .Permalink }}page/{{ .Paginator.Prev.PageNumber }}/">&larr; {{ i18n "newerPosts" }}</a>
</li>
{{ end }}
{{ if .Paginator.HasNext }}
<li class="next">
<a href="{{ .URL }}page/{{ .Paginator.Next.PageNumber }}/">{{ i18n "olderPosts" }} &rarr;</a>
<a href="{{ .Permalink }}page/{{ .Paginator.Next.PageNumber }}/">{{ i18n "olderPosts" }} &rarr;</a>
</li>
{{ end }}
</ul>
@@ -17,11 +17,7 @@
{{ end }}
{{ if .Site.Params.rss }}
<li>
{{ if .RSSLink }}
<a href="{{ .RSSLink }}" title="RSS">
{{ else }}
<a href="{{ .Site.RSSLink }}" title="RSS">
{{ end }}
<a href="{{ with .OutputFormats.Get "RSS" }}{{ .RelPermalink }}{{ end }}" title="RSS">
<span class="fa-stack fa-lg">
<i class="fas fa-circle fa-stack-2x"></i>
<i class="fas fa-rss fa-stack-1x fa-inverse"></i>
@@ -54,7 +50,7 @@
<!-- Please don't remove this, keep my open source work credited :) -->
<p class="credits theme-by text-muted">
{{ i18n "poweredBy" . | safeHTML }}
{{ with .Site.Params.commit }}&nbsp;&bull;&nbsp;[<a href="{{.}}{{ getenv "GIT_COMMIT_SHA" }}">{{ getenv "GIT_COMMIT_SHA_SHORT" }}</a>]{{ end }}
{{ if $.GitInfo }}&nbsp;&bull;&nbsp;[<a href="{{ .Site.Params.commit }}{{ .GitInfo.Hash }}">{{ substr .GitInfo.Hash 0 8 }}</a>]{{ end }}
</p>
</div>
</div>

0 comments on commit 7e66822

Please sign in to comment.
You can’t perform that action at this time.