Merge branch 'master' into local-build-doc

This commit is contained in:
Michael Romero 2019-09-21 00:33:13 -07:00 committed by GitHub
commit b47a3e02fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 182 additions and 72 deletions

View File

@ -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

View File

@ -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"
@ -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"

View File

@ -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"

View File

@ -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**

View File

@ -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

View File

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

View File

@ -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 }}

View File

@ -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>

View File

@ -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" . }}

View File

@ -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>

View File

@ -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 -->

View File

@ -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>

View File

@ -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;

View File

@ -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 }}
{{ end }}

View File

@ -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>

BIN
static/css/default-skin.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 547 B

View File

@ -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;
}

View File

@ -82,7 +82,7 @@
height: 10em;
}
form--loading:before {
.form--loading:before {
content: '';
}