diff --git a/README.md b/README.md index 63657e9..f40c57b 100644 --- a/README.md +++ b/README.md @@ -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///master/comments - pulls: https://github.com///pulls - recaptcha: +[Params.staticman] + api = "https:///v3/entry/{GIT-HOST}///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:///v3/encrypt/ + You must also configure the `staticman.yml` in you blog website. ``` @@ -99,7 +104,7 @@ 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 @@ -107,20 +112,15 @@ To add Google Analytics, simply sign up to [Google Analytics](https://www.google ### 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///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 diff --git a/data/beautifulhugo/social.toml b/data/beautifulhugo/social.toml index 7bf03a5..0ebf774 100644 --- a/data/beautifulhugo/social.toml +++ b/data/beautifulhugo/social.toml @@ -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" diff --git a/exampleSite/config.toml b/exampleSite/config.toml index 9ed7e1d..97699ba 100644 --- a/exampleSite/config.toml +++ b/exampleSite/config.toml @@ -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" diff --git a/exampleSite/content/post/2015-02-20-test-markdown.md b/exampleSite/content/post/2015-02-20-test-markdown.md index 8ef8cbf..1b36059 100644 --- a/exampleSite/content/post/2015-02-20-test-markdown.md +++ b/exampleSite/content/post/2015-02-20-test-markdown.md @@ -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** diff --git a/i18n/br.yaml b/i18n/br.yaml index 76dabc3..98cbc47 100644 --- a/i18n/br.yaml +++ b/i18n/br.yaml @@ -33,7 +33,7 @@ # Footer - id: poweredBy # Accepts HTML - translation: 'Hugo v{{ .Hugo.Version }} powered  •  Tema por Beautiful Jekyll adaptado para Beautiful Hugo' + translation: 'Hugo v{{ .Site.Hugo.Version }} powered  •  Tema por Beautiful Jekyll adaptado para Beautiful Hugo' # Navigation - id: toggleNavigation diff --git a/i18n/de.yaml b/i18n/de.yaml index d2774cf..be3a79a 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -33,7 +33,7 @@ # Footer - id: poweredBy # Accepts HTML - translation: 'Hugo v{{ .Hugo.Version }} powered  •  Theme by Beautiful Jekyll adapted to Beautiful Hugo' + translation: 'Hugo v{{ .Site.Hugo.Version }} powered  •  Theme by Beautiful Jekyll adapted to Beautiful Hugo' # Navigation - id: toggleNavigation diff --git a/i18n/en.yaml b/i18n/en.yaml index a4c316e..ce90070 100644 --- a/i18n/en.yaml +++ b/i18n/en.yaml @@ -33,7 +33,7 @@ # Footer - id: poweredBy # Accepts HTML - translation: 'Hugo v{{ .Hugo.Version }} powered  •  Theme by Beautiful Jekyll adapted to Beautiful Hugo' + translation: 'Hugo v{{ .Site.Hugo.Version }} powered  •  Theme by Beautiful Jekyll adapted to Beautiful Hugo' # Navigation - id: toggleNavigation diff --git a/i18n/eo.yaml b/i18n/eo.yaml index 8d56660..68540ca 100644 --- a/i18n/eo.yaml +++ b/i18n/eo.yaml @@ -33,7 +33,7 @@ # Footer - id: poweredBy # Accepts HTML - translation: 'Hugo v{{ .Hugo.Version }}-povigita  •  Haŭto de Beautiful Jekyll adaptiĝis al Beautiful Hugo' + translation: 'Hugo v{{ .Site.Hugo.Version }}-povigita  •  Haŭto de Beautiful Jekyll adaptiĝis al Beautiful Hugo' # Navigation - id: toggleNavigation diff --git a/i18n/es.yaml b/i18n/es.yaml index 2ce455d..6c0850f 100644 --- a/i18n/es.yaml +++ b/i18n/es.yaml @@ -33,7 +33,7 @@ # Footer - id: poweredBy # Accepts HTML - translation: 'Hugo v{{ .Hugo.Version }} powered  •  Theme by Beautiful Jekyll adapted to Beautiful Hugo' + translation: 'Hugo v{{ .Site.Hugo.Version }} powered  •  Theme by Beautiful Jekyll adapted to Beautiful Hugo' # Navigation - id: toggleNavigation diff --git a/i18n/fr.yaml b/i18n/fr.yaml index ddac58d..ed85a9b 100644 --- a/i18n/fr.yaml +++ b/i18n/fr.yaml @@ -33,7 +33,7 @@ # Footer - id: poweredBy # Accepts HTML - translation: 'Carbure avec Hugo v{{ .Hugo.Version }} •  Avec le Theme Beautiful Jekyll adapté en Beautiful Hugo' + translation: 'Carbure avec Hugo v{{ .Site.Hugo.Version }} •  Avec le Theme Beautiful Jekyll adapté en Beautiful Hugo' # Navigation - id: toggleNavigation diff --git a/i18n/it.yaml b/i18n/it.yaml index 543a726..4bf0305 100644 --- a/i18n/it.yaml +++ b/i18n/it.yaml @@ -33,7 +33,7 @@ # Footer - id: poweredBy # Accepts HTML - translation: 'Sviluppato con Hugo v{{ .Hugo.Version }}  •  Tema: Beautiful Jekyll adattato a Beautiful Hugo' + translation: 'Sviluppato con Hugo v{{ .Site.Hugo.Version }}  •  Tema: Beautiful Jekyll adattato a Beautiful Hugo' # Navigation - id: toggleNavigation diff --git a/i18n/ja.yaml b/i18n/ja.yaml index 2e6b869..f810b0b 100644 --- a/i18n/ja.yaml +++ b/i18n/ja.yaml @@ -33,7 +33,7 @@ # Footer - id: poweredBy # Accepts HTML - translation: '起動力にHugo v{{ .Hugo.Version }}  •  テーマにBeautiful Jekyllに基づいているBeautiful Hugo' + translation: '起動力にHugo v{{ .Site.Hugo.Version }}  •  テーマにBeautiful Jekyllに基づいているBeautiful Hugo' # Navigation - id: toggleNavigation diff --git a/i18n/nb.yaml b/i18n/nb.yaml index 11002d6..cd12ec6 100644 --- a/i18n/nb.yaml +++ b/i18n/nb.yaml @@ -33,7 +33,7 @@ # Footer - id: poweredBy # Accepts HTML - translation: 'Kjører på Hugo v{{ .Hugo.Version }} •  Tema fra Beautiful Jekyll tilpasset til Beautiful Hugo' + translation: 'Kjører på Hugo v{{ .Site.Hugo.Version }} •  Tema fra Beautiful Jekyll tilpasset til Beautiful Hugo' # Navigation - id: toggleNavigation diff --git a/i18n/nl.yaml b/i18n/nl.yaml index ab51ec3..02993bb 100644 --- a/i18n/nl.yaml +++ b/i18n/nl.yaml @@ -33,7 +33,7 @@ # Footer - id: poweredBy # Accepts HTML - translation: 'Hugo v{{ .Hugo.Version }}-aangedreven  •  Thema door Beautiful Jekyll aangepast voor Beautiful Hugo' + translation: 'Hugo v{{ .Site.Hugo.Version }}-aangedreven  •  Thema door Beautiful Jekyll aangepast voor Beautiful Hugo' # Navigation - id: toggleNavigation diff --git a/i18n/pl.yaml b/i18n/pl.yaml index cbc8efc..e3d4f8b 100644 --- a/i18n/pl.yaml +++ b/i18n/pl.yaml @@ -33,7 +33,7 @@ # Footer - id: poweredBy # Accepts HTML - translation: 'Hugo v{{ .Hugo.Version }} powered  •  Theme by Beautiful Jekyll adapted to Beautiful Hugo' + translation: 'Hugo v{{ .Site.Hugo.Version }} powered  •  Theme by Beautiful Jekyll adapted to Beautiful Hugo' # Navigation - id: toggleNavigation diff --git a/i18n/ru.yaml b/i18n/ru.yaml index 8b37143..e05bdb4 100644 --- a/i18n/ru.yaml +++ b/i18n/ru.yaml @@ -33,7 +33,7 @@ # Footer - id: poweredBy # Accepts HTML - translation: 'На базе Hugo v{{ .Hugo.Version }}  •  Тема Beautiful Hugo на базе Beautiful Jekyll' + translation: 'На базе Hugo v{{ .Site.Hugo.Version }}  •  Тема Beautiful Hugo на базе Beautiful Jekyll' # Navigation - id: toggleNavigation diff --git a/i18n/zh-CN.yaml b/i18n/zh-CN.yaml index ff6807f..9b104c3 100644 --- a/i18n/zh-CN.yaml +++ b/i18n/zh-CN.yaml @@ -33,7 +33,7 @@ # Footer - id: poweredBy # Accepts HTML - translation: '由 Hugo v{{ .Hugo.Version }} 强力驱动  •  主题 Beautiful Hugo 移植自 Beautiful Jekyll' + translation: '由 Hugo v{{ .Site.Hugo.Version }} 强力驱动  •  主题 Beautiful Hugo 移植自 Beautiful Jekyll' # Navigation - id: toggleNavigation diff --git a/i18n/zh-TW.yaml b/i18n/zh-TW.yaml index 17d9234..fea27b0 100644 --- a/i18n/zh-TW.yaml +++ b/i18n/zh-TW.yaml @@ -33,7 +33,7 @@ # Footer - id: poweredBy # Accepts HTML - translation: '由 Hugo v{{ .Hugo.Version }} 提供  •  主題 Beautiful Hugo 移植自 Beautiful Jekyll' + translation: '由 Hugo v{{ .Site.Hugo.Version }} 提供  •  主題 Beautiful Hugo 移植自 Beautiful Jekyll' # Navigation - id: toggleNavigation diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 25befda..a67d0c4 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -8,6 +8,7 @@ {{ block "header" . }}{{ partial "header.html" . }}{{ end }} {{ block "main" . }}{{ end }} {{ partial "footer.html" . }} + {{ block "footer" . }}{{ end }} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 164a75c..5e52b60 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -47,12 +47,12 @@ diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 7af7637..0ab1bf5 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -23,14 +23,19 @@ {{ end }} {{ if .Site.Params.showRelatedPosts }} - {{ $related := .Site.RegularPages.Related . | first 3 }} - {{ with $related }} -

{{ i18n "seeAlso" }}

-
    - {{ range . }} -
  • {{ .Title }}
  • + {{ range first 1 (where (where .Site.Pages ".Params.tags" "intersect" .Params.tags) "Permalink" "!=" .Permalink) }} + {{ $.Scratch.Set "has_related" true }} {{ end }} -
+ + {{ if $.Scratch.Get "has_related" }} +

{{ i18n "seeAlso" }}

+
    + {{ $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) }} +
  • {{ .Title }}
  • + {{ end }} +
+ {{ end }} {{ end }} diff --git a/layouts/index.html b/layouts/index.html index 7be74c8..d72364a 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -9,7 +9,7 @@ {{ end }}
- {{ $pag := .Paginate (where .Data.Pages "Type" "post") }} + {{ $pag := .Paginate (where site.RegularPages "Type" "in" site.Params.mainSections) }} {{ range $pag.Pages }}
@@ -22,6 +22,9 @@ {{ if .Params.image }} {{ .Title }} {{ end }} + {{ if .Params.video }} + {{ partial "post_meta.html" . }} @@ -49,12 +52,12 @@ diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index 65c5616..58e2e68 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -17,11 +17,7 @@ {{ end }} {{ if .Site.Params.rss }}
  • - {{ if .RSSLink }} - - {{ else }} - - {{ end }} + @@ -54,7 +50,7 @@

    {{ i18n "poweredBy" . | safeHTML }} - {{ with .Site.Params.commit }} • [{{ getenv "GIT_COMMIT_SHA_SHORT" }}]{{ end }} + {{ if $.GitInfo }} • [{{ substr .GitInfo.Hash 0 8 }}]{{ end }}

  • diff --git a/layouts/partials/head.html b/layouts/partials/head.html index fef8579..2c872b4 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -57,11 +57,11 @@ {{- with .Site.Params.fb_app_id }} {{- end }} - + - {{ .Hugo.Generator -}} + {{ hugo.Generator -}} diff --git a/layouts/partials/post_meta.html b/layouts/partials/post_meta.html index 61f6637..a449767 100644 --- a/layouts/partials/post_meta.html +++ b/layouts/partials/post_meta.html @@ -11,14 +11,16 @@ {{ if .Site.Params.wordCount }}  |  {{ .WordCount }} {{ i18n "words" }} {{ end }} - {{ if .Params.author }} -  |  {{ .Params.author | safeHTML }} - {{ else }} -  |  {{ .Site.Author.name | safeHTML }} + {{ if not .Site.Params.hideAuthor }} + {{ if .Params.author }} +  |  {{ .Params.author | safeHTML }} + {{ else }} +  |  {{ .Site.Author.name | safeHTML }} + {{ end }} {{ end }} {{- if .Site.Params.staticman -}}  |   - {{ $slug := replace .URL "/" "" }} + {{ $slug := replace .RelPermalink "/" "" }} {{ if .Site.Data.comments }} {{ $comments := index $.Site.Data.comments $slug }} {{ if $comments }} diff --git a/layouts/partials/seo/opengraph.html b/layouts/partials/seo/opengraph.html index 19e6ee0..9a14a07 100644 --- a/layouts/partials/seo/opengraph.html +++ b/layouts/partials/seo/opengraph.html @@ -10,6 +10,6 @@ {{- with .Site.Params.fb_app_id }} {{- end }} - + - \ No newline at end of file + diff --git a/layouts/partials/share-links.html b/layouts/partials/share-links.html index d264d1c..78fe91b 100644 --- a/layouts/partials/share-links.html +++ b/layouts/partials/share-links.html @@ -9,13 +9,6 @@ - -
  • - - - -
  • -
  • @@ -52,4 +45,4 @@
  • - {{ end }} \ No newline at end of file + {{ end }} diff --git a/layouts/partials/staticman-comments.html b/layouts/partials/staticman-comments.html index 8f54b02..8d01894 100644 --- a/layouts/partials/staticman-comments.html +++ b/layouts/partials/staticman-comments.html @@ -1,6 +1,6 @@
    - {{ $slug := replace .URL "/" "" }} + {{ $slug := replace .RelPermalink "/" "" }} {{ if .Site.Data.comments }} {{ $comments := index $.Site.Data.comments $slug }} @@ -36,7 +36,7 @@
    - + {{ if .Site.Params.staticman.recaptcha }} diff --git a/static/css/default-skin.png b/static/css/default-skin.png new file mode 100644 index 0000000..441c502 Binary files /dev/null and b/static/css/default-skin.png differ