Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/halogenica/beautifulhugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Romero <halogenica@users.noreply.github.com>2019-09-21 10:33:13 +0300
committerGitHub <noreply@github.com>2019-09-21 10:33:13 +0300
commitb47a3e02fd53d20aba7230c6beeca8513821b66e (patch)
treede8ad3bc7a9d75b7131f1bee6e9df0bfef8923b9
parent7cc01ccfb1bdfcf12d26f000d423a78fdaef536b (diff)
parent3dabe46dbae9a566e0a1c405de3931fc7bb76690 (diff)
Merge branch 'master' into local-build-doc
-rw-r--r--README.md30
-rw-r--r--data/beautifulhugo/social.toml38
-rw-r--r--exampleSite/config.toml8
-rw-r--r--exampleSite/content/post/2015-02-20-test-markdown.md2
-rw-r--r--i18n/de.yaml2
-rw-r--r--layouts/_default/baseof.html1
-rw-r--r--layouts/_default/section.html62
-rw-r--r--layouts/_default/single.html19
-rw-r--r--layouts/index.html5
-rw-r--r--layouts/partials/footer.html5
-rw-r--r--layouts/partials/head.html20
-rw-r--r--layouts/partials/page_meta.html8
-rw-r--r--layouts/partials/post_meta.html10
-rw-r--r--layouts/partials/share-links.html9
-rw-r--r--layouts/partials/staticman-comments.html4
-rw-r--r--static/css/default-skin.pngbin0 -> 547 bytes
-rw-r--r--static/css/main.css29
-rw-r--r--static/css/staticman.css2
18 files changed, 182 insertions, 72 deletions
diff --git a/README.md b/README.md
index b386e99..6ec1c6e 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/<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,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/<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.
### Multilingual
diff --git a/data/beautifulhugo/social.toml b/data/beautifulhugo/social.toml
index cead546..0ebf774 100644
--- a/data/beautifulhugo/social.toml
+++ b/data/beautifulhugo/social.toml
@@ -11,12 +11,6 @@ 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"
title = "GitHub"
@@ -41,6 +35,12 @@ 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"
title = "Reddit"
@@ -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"
@@ -135,3 +135,27 @@ id = "500px"
url = "https://500px.com/%s"
title = "500px"
icon = "fab fa-500px"
+
+[[social_icons]]
+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 22dbfb9..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"
@@ -67,6 +68,11 @@ pygmentsCodefencesGuessSyntax = true
paypal = "username"
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/de.yaml b/i18n/de.yaml
index be3a79a..49ee8ff 100644
--- a/i18n/de.yaml
+++ b/i18n/de.yaml
@@ -57,7 +57,7 @@
- id: useMarkdown
translation: "Sie können Markdown-Syntax verwenden"
- id: yourName
- translation: "Irh Name"
+ translation: "Ihr Name"
- id: yourEmail
translation: "Ihre Emailadresse"
- id: yourWebsite
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 }}
</body>
</html>
diff --git a/layouts/_default/section.html b/layouts/_default/section.html
new file mode 100644
index 0000000..6844096
--- /dev/null
+++ b/layouts/_default/section.html
@@ -0,0 +1,62 @@
+{{ define "header" }}
+ <header class="header-section ">
+ <div class="intro-header no-img">
+ <div class="container">
+ <div class="row">
+ <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
+ <div class="page-heading">
+ <h1>archives</h1>
+ <hr class="small">
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </header>
+{{ end }}
+{{ define "main" }}
+{{- $paginator := .Paginate .Pages.ByDate.Reverse}}
+ <div class="container" role="main">
+ <div class="row">
+ <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
+ <div class="posts-list">
+ <section id="archive" class="archive">
+ {{- range $index, $element := $paginator.Pages -}}
+ {{- $thisYear := $element.Date.Format "2006" }}
+ {{- $lastElement := $index | add -1 | index $paginator.Pages }}
+ {{ if or (eq $index 0) ( ne ($lastElement.Date.Format "2006") $thisYear ) }}
+ <div class="collection-title">
+ <h2 class="archive-year">{{ $thisYear }}</h2>
+ </div>
+ {{- end }}
+ <div class="archive-post">
+ <span class="archive-post-time">
+ {{ $element.Date.Format "01-02" }}
+ </span>
+ <span class="archive-post-title">
+ <a href="{{ $element.RelPermalink }}" class="archive-post-link">
+ {{ .Title }}
+ </a>
+ </span>
+ </div>
+ {{- end -}}
+ </section>
+ </div>
+ {{ if or (.Paginator.HasPrev) (.Paginator.HasNext) }}
+ <ul class="pager main-pager">
+ {{ if .Paginator.HasPrev }}
+ <li class="previous">
+ <a href="{{ .RelPermalink }}page/{{ .Paginator.Prev.PageNumber }}/">&larr; {{ i18n "newerPosts" }}</a>
+ </li>
+ {{ end }}
+ {{ if .Paginator.HasNext }}
+ <li class="next">
+ <a href="{{ .RelPermalink }}page/{{ .Paginator.Next.PageNumber }}/">{{ i18n "olderPosts" }} &rarr;</a>
+ </li>
+ {{ end }}
+ </ul>
+ {{ end }}
+ </div>
+ </div>
+ </div>
+{{ end }}
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 }}
- <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>
diff --git a/layouts/index.html b/layouts/index.html
index d7544e2..d72364a 100644
--- a/layouts/index.html
+++ b/layouts/index.html
@@ -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 @@
{{ 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" . }}
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html
index 030f657..8b48793 100644
--- a/layouts/partials/footer.html
+++ b/layouts/partials/footer.html
@@ -1,3 +1,6 @@
+ {{ if eq .Type "page" }}
+ {{ partial "page_meta.html" . }}
+ {{ end }}
<footer>
<div class="container">
<div class="row">
@@ -50,7 +53,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>
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 2c872b4..83ace10 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -29,13 +29,9 @@
<!-- Site Title, Description, Author, and Favicon -->
{{- with ($.Scratch.Get "Title") }}
<title>{{ . }} - {{ $.Site.Title }}</title>
- <meta property="og:title" content="{{ . }}" />
- <meta name="twitter:title" content="{{ . | truncate 70 }}" />
{{- end }}
{{- with ($.Scratch.Get "Description") }}
<meta name="description" content="{{ . }}">
- <meta property="og:description" content="{{ . }}">
- <meta name="twitter:description" content="{{ . | truncate 200 }}">
{{- end }}
{{- with .Site.Author.name }}
<meta name="author" content="{{ . }}"/>
@@ -44,22 +40,6 @@
{{- with .Site.Params.favicon }}
<link href='{{ . | absURL }}' rel='icon' type='image/x-icon'/>
{{- end -}}
-<!-- Social Media Tags -->
-{{- with .Params.share_img | default .Params.image | default .Site.Params.logo }}
- <meta property="og:image" content="{{ . | absURL }}" />
- <meta name="twitter:image" content="{{ . | absURL }}" />
-{{- end }}
- <meta name="twitter:card" content="summary" />
-{{- with .Site.Author.twitter }}
- <meta name="twitter:site" content="@{{ . }}" />
- <meta name="twitter:creator" content="@{{ . }}" />
-{{- end }}
-{{- with .Site.Params.fb_app_id }}
- <meta property="fb:app_id" content="{{ . }}" />
-{{- end }}
- <meta property="og:url" content="{{ .Permalink | absLangURL }}" />
- <meta property="og:type" content="website" />
- <meta property="og:site_name" content="{{ .Site.Title }}" />
<!-- Hugo Version number -->
{{ hugo.Generator -}}
<!-- Links and stylesheets -->
diff --git a/layouts/partials/page_meta.html b/layouts/partials/page_meta.html
new file mode 100644
index 0000000..ac9661b
--- /dev/null
+++ b/layouts/partials/page_meta.html
@@ -0,0 +1,8 @@
+<div class="page-meta">
+ {{ $lastmodstr := default (i18n "dateFormat") .Site.Params.dateformat | .Lastmod.Format }}
+ {{ $datestr := default (i18n "dateFormat") .Site.Params.dateformat | .Date.Format }}
+ {{ if ne $datestr $lastmodstr }}
+ {{ $lastmodstr | i18n "lastModified" }}
+ {{ end }}
+</div>
+
diff --git a/layouts/partials/post_meta.html b/layouts/partials/post_meta.html
index f7e03d7..a449767 100644
--- a/layouts/partials/post_meta.html
+++ b/layouts/partials/post_meta.html
@@ -11,10 +11,12 @@
{{ if .Site.Params.wordCount }}
&nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;{{ .WordCount }}&nbsp;{{ i18n "words" }}
{{ end }}
- {{ if .Params.author }}
- &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;{{ .Params.author | safeHTML }}
- {{ else }}
- &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;{{ .Site.Author.name | safeHTML }}
+ {{ if not .Site.Params.hideAuthor }}
+ {{ if .Params.author }}
+ &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;{{ .Params.author | safeHTML }}
+ {{ else }}
+ &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;{{ .Site.Author.name | safeHTML }}
+ {{ end }}
{{ end }}
{{- if .Site.Params.staticman -}}
&nbsp;|&nbsp;<i class="fas fa-comment"></i>&nbsp;
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 @@
</a>
</li>
- <!-- Google Plus -->
- <li>
- <a href="//plus.google.com/share?url={{ .Permalink }}" target="_blank" title="Share on Google Plus">
- <i class="fab fa-google-plus"></i>
- </a>
- </li>
-
<!-- Facebook -->
<li>
<a href="//www.facebook.com/sharer/sharer.php?u={{ .Permalink }}" target="_blank" title="Share on Facebook">
@@ -52,4 +45,4 @@
</li>
</ul>
</div>
- {{ end }} \ No newline at end of file
+ {{ end }}
diff --git a/layouts/partials/staticman-comments.html b/layouts/partials/staticman-comments.html
index 8d01894..a3db153 100644
--- a/layouts/partials/staticman-comments.html
+++ b/layouts/partials/staticman-comments.html
@@ -46,7 +46,7 @@
<fieldset>
<div class="textfield">
- <textarea name="fields[comment]" type="text" placeholder="{{ i18n "useMarkdown" }}"></textarea>
+ <textarea name="fields[comment]" placeholder="{{ i18n "useMarkdown" }}"></textarea>
</div>
</fieldset>
@@ -64,7 +64,7 @@
<fieldset>
<div class="textfield">
- <input type="text" name="fields[website]" placeholder="{{ i18n "yourWebsite" }}"/>
+ <input type="url" name="fields[website]" placeholder="{{ i18n "yourWebsite" }}"/>
</div>
</fieldset>
diff --git a/static/css/default-skin.png b/static/css/default-skin.png
new file mode 100644
index 0000000..441c502
--- /dev/null
+++ b/static/css/default-skin.png
Binary files differ
diff --git a/static/css/main.css b/static/css/main.css
index 999ff11..74f90ad 100644
--- a/static/css/main.css
+++ b/static/css/main.css
@@ -370,14 +370,19 @@ footer .theme-by {
margin-bottom: 10px;
}
.post-preview .post-meta,
-.post-heading .post-meta {
+.post-heading .post-meta,
+.page-meta {
color: #808080;
font-size: 18px;
font-style: italic;
margin: 0 0 10px;
}
+.page-meta {
+ align-self: center;
+}
.post-preview .post-meta a,
-.post-heading .post-meta a {
+.post-heading .post-meta a,
+.page-meta a {
color: #404040;
text-decoration: none;
}
@@ -756,7 +761,7 @@ div.splitbox div.right {
padding: 15px 25px;
}
}
-.disqus-comments button:hover,
+.disqus-comments button:hover,
.disqus-comments button:focus {
color: #FFF;
background: #0085a1;
@@ -804,3 +809,21 @@ h4.see-also {
ul.share li:hover .fab {
transform: scale(1.4)
}
+
+/* --- Archives --- */
+
+.archive .archive-post {
+ padding: 3px 20px;
+ padding-top: 3px;
+ padding-right: 20px;
+ padding-bottom: 3px;
+ padding-left: 20px;
+ border-left: 1px solid #cacaca;
+ border-left-width: 1px;
+ border-left-style: solid;
+ border-left-color: rgb(202, 202, 202);
+}
+
+.archive .archive-post .archive-post-time {
+ margin-right: 10px;
+}
diff --git a/static/css/staticman.css b/static/css/staticman.css
index 082c7f0..2c01efc 100644
--- a/static/css/staticman.css
+++ b/static/css/staticman.css
@@ -82,7 +82,7 @@
height: 10em;
}
-form--loading:before {
+.form--loading:before {
content: '';
}