Merge branch 'master' into delayed-disqus

This commit is contained in:
Michael Romero 2018-10-26 00:53:23 -07:00 committed by GitHub
commit 934131263b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 726 additions and 19 deletions

View File

@ -6,7 +6,8 @@
$ mkdir themes $ mkdir themes
$ cd themes $ cd themes
$ git clone https://github.com/halogenica/beautifulhugo.git beautifulhugo $ git submodule add https://github.com/halogenica/beautifulhugo.git beautifulhugo
See [the Hugo documentation](https://gohugo.io/themes/installing/) for more information. See [the Hugo documentation](https://gohugo.io/themes/installing/) for more information.

View File

@ -129,3 +129,9 @@ id = "telegram"
url = "https://telegram.me/%s" url = "https://telegram.me/%s"
title = "Telegram" title = "Telegram"
icon = "fa-telegram" icon = "fa-telegram"
[[social_icons]]
id = "500px"
url = "https://500px.com/%s"
title = "500px"
icon = "fa-500px"

View File

@ -25,7 +25,8 @@ pygmentsCodefencesGuessSyntax = true
readingTime = true readingTime = true
useHLJS = true useHLJS = true
socialShare = true socialShare = true
delayDisqus = false delayDisqus = true
showRelatedPosts = 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" # 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]] #[[Params.bigimg]]
@ -64,6 +65,7 @@ pygmentsCodefencesGuessSyntax = true
vk = "username" vk = "username"
paypal = "username" paypal = "username"
telegram = "username" telegram = "username"
500px = "username"
[[menu.main]] [[menu.main]]
name = "Blog" name = "Blog"

View File

@ -67,4 +67,8 @@
- id: show - id: show
translation: "Mostrar" translation: "Mostrar"
- id: comments - id: comments
translation: "comentários" translation: "comentários"
# Related posts
- id: seeAlso
translation: "Veja também"

View File

@ -68,3 +68,7 @@
translation: "Zeige" translation: "Zeige"
- id: comments - id: comments
translation: "Kommentare" translation: "Kommentare"
# Related posts
- id: seeAlso
translation: "Siehe auch"

View File

@ -67,4 +67,8 @@
- id: show - id: show
translation: "Show" translation: "Show"
- id: comments - id: comments
translation: "comments" translation: "comments"
# Related posts
- id: seeAlso
translation: "See also"

View File

@ -67,4 +67,8 @@
- id: show - id: show
translation: "Montru" translation: "Montru"
- id: comments - id: comments
translation: "komentoj" translation: "komentoj"
# Related posts
- id: seeAlso
translation: "Vidu ankaŭ"

View File

@ -67,4 +67,8 @@
- id: show - id: show
translation: "Mostrar" translation: "Mostrar"
- id: comments - id: comments
translation: "comentarios" translation: "comentarios"
# Related posts
- id: seeAlso
translation: "Ver también"

View File

@ -67,4 +67,8 @@
- id: show - id: show
translation: "Afficher" translation: "Afficher"
- id: comments - id: comments
translation: "commentaires" translation: "commentaires"
# Related posts
- id: seeAlso
translation: "Voir également"

View File

@ -68,3 +68,7 @@
translation: "Mostra" translation: "Mostra"
- id: comments - id: comments
translation: "commenti" translation: "commenti"
# Related posts
- id: seeAlso
translation: "Guarda anche"

View File

@ -38,6 +38,8 @@
# Navigation # Navigation
- id: toggleNavigation - id: toggleNavigation
translation: "メニューを切り替え" translation: "メニューを切り替え"
- id: languageSwitcherLabel
translation: "言語"
- id: gcseLabelShort - id: gcseLabelShort
translation: "検索" translation: "検索"
- id: gcseLabelLong - id: gcseLabelLong
@ -67,3 +69,6 @@
- id: comments - id: comments
translation: "コメント" translation: "コメント"
# Related posts
- id: seeAlso
translation: "も参照してください"

View File

@ -68,3 +68,7 @@
translation: "Vis" translation: "Vis"
- id: comments - id: comments
translation: "kommentarer" translation: "kommentarer"
# Related posts
- id: seeAlso
translation: "Se også"

View File

@ -67,4 +67,8 @@
- id: show - id: show
translation: "Laat" translation: "Laat"
- id: comments - id: comments
translation: "reacties zien" translation: "reacties zien"
# Related posts
- id: seeAlso
translation: "Zie ook"

View File

@ -67,4 +67,8 @@
- id: show - id: show
translation: "Pokaż" translation: "Pokaż"
- id: comments - id: comments
translation: "komentarzy" translation: "komentarzy"
# Related posts
- id: seeAlso
translation: "Zobacz też"

View File

@ -67,4 +67,8 @@
- id: show - id: show
translation: "Показать" translation: "Показать"
- id: comments - id: comments
translation: "комментариев" translation: "комментариев"
# Related posts
- id: seeAlso
translation: "Смотрите также"

View File

@ -63,9 +63,12 @@
- id: yourWebsite - id: yourWebsite
translation: "你的网页" translation: "你的网页"
# Delayed Disqus # Delayed Disqus
- id: show - id: show
translation: "显示" translation: "显示"
- id: comments - id: comments
translation: "条评论" translation: "条评论"
# Related posts
- id: seeAlso
translation: "也可以看看"

View File

@ -21,6 +21,18 @@
</ul> </ul>
</section> </section>
{{ end }} {{ 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>
{{ end }}
</ul>
{{ end }}
{{ end }}
</article> </article>
{{ if ne .Type "page" }} {{ if ne .Type "page" }}

View File

@ -49,12 +49,12 @@
<ul class="pager main-pager"> <ul class="pager main-pager">
{{ if .Paginator.HasPrev }} {{ if .Paginator.HasPrev }}
<li class="previous"> <li class="previous">
<a href="{{ .Paginator.Prev.URL | absURL }}">&larr; {{ i18n "newerPosts" }}</a> <a href="{{ .URL }}page/{{ .Paginator.Prev.PageNumber }}/">&larr; {{ i18n "newerPosts" }}</a>
</li> </li>
{{ end }} {{ end }}
{{ if .Paginator.HasNext }} {{ if .Paginator.HasNext }}
<li class="next"> <li class="next">
<a href="{{ .Paginator.Next.URL | absURL }}">{{ i18n "olderPosts" }} &rarr;</a> <a href="{{ .URL }}page/{{ .Paginator.Next.PageNumber }}/">{{ i18n "olderPosts" }} &rarr;</a>
</li> </li>
{{ end }} {{ end }}
</ul> </ul>

View File

@ -1,14 +1,38 @@
{{- if eq .Kind "taxonomyTerm" }}
{{- range $key, $value := .Data.Terms.ByCount }}
{{- $.Scratch.Add "most_used" (slice $value.Name) }}
{{- end }}
{{- if not ($.Scratch.Get "most_used") }}
{{- $description := printf "A full overview of all pages with %s, ordered by %s" .Data.Plural .Data.Singular | truncate 180 }}
{{- $.Scratch.Set "Description" $description }}
{{- else }}
{{- $description := printf "A full overview of all pages with %s, ordered by %s, such as: %s" .Data.Plural .Data.Singular ( delimit ( $.Scratch.Get "most_used" ) ", " ", and " ) | truncate 180 }}
{{- $.Scratch.Set "Description" $description }}
{{- end }}
{{- $title := printf "Overview of all pages with %s, ordered by %s" .Data.Plural .Data.Singular }}
{{- $.Scratch.Set "Title" $title }}
{{- else if eq .Kind "taxonomy" }}
{{- $description := printf "Overview of all pages with the %s #%s, such as: %s" .Data.Singular $.Title ( index .Pages 0).Title | truncate 160 }}
{{- $.Scratch.Set "Description" $description }}
{{- $title := printf "Overview of all pages with the %s #%s" .Data.Singular $.Title }}
{{- $.Scratch.Set "Title" $title }}
{{- else }}
{{- $.Scratch.Set "Description" ( .Description | default .Params.subtitle | default .Summary ) }}
{{- $.Scratch.Set "Title" ( .Title | default .Site.Title ) }}
{{- end }}
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
<!-- Site Title, Description, Author, and Favicon --> <!-- Site Title, Description, Author, and Favicon -->
{{- with .Title | default .Site.Title }} {{- with ($.Scratch.Get "Title") }}
<title>{{ . }}</title> <title>{{ . }} - {{ $.Site.Title }}</title>
<meta property="og:title" content="{{ . }}" /> <meta property="og:title" content="{{ . }}" />
<meta name="twitter:title" content="{{ . | truncate 70 }}" /> <meta name="twitter:title" content="{{ . | truncate 70 }}" />
{{- end }} {{- end }}
{{- with .Description | default .Params.subtitle | default .Summary }} {{- with ($.Scratch.Get "Description") }}
<meta name="description" content="{{ . }}"> <meta name="description" content="{{ . }}">
<meta property="og:description" content="{{ . }}"> <meta property="og:description" content="{{ . }}">
<meta name="twitter:description" content="{{ . | truncate 200 }}"> <meta name="twitter:description" content="{{ . | truncate 200 }}">

View File

@ -0,0 +1,7 @@
<link href="{{"css/mermaid.css" | relURL}}" type="text/css" rel="stylesheet"/>
<script defer src="{{"js/mermaid.js" | relURL}}">
mermaid.initialize({startOnLoad:true});
</script>
<div class="mermaid" align="{{ if .Get "align" }}{{ .Get "align" }}{{ else }}center{{ end }}" >
{{ safeHTML .Inner }}
</div>

View File

@ -1,9 +1,33 @@
/* --- Code blocks --- */ /* --- Code blocks --- */
.chroma .ln { .chroma .ln {
margin-right: 0.8em; margin-right: 0.8em;
padding: 0 0.4em 0 0.4em; padding: 0 0.4em 0 0.4em;
} }
pre code.hljs { pre code.hljs {
padding: 9.5px; padding: 9.5px;
} }
.highlight tr, .highlight pre {
border: none;
}
.highlight div:first-child {
border-radius: 4px;
}
.highlight td:first-child pre, .highlight pre {
border-top-left-radius: 4px;
border-top-right-radius: unset;
border-bottom-left-radius: 4px;
border-bottom-right-radius: unset;
overflow: hidden;
}
.highlight td:last-child pre, .highlight pre {
border-radius: unset;
}
.highlight td:last-child pre code, .highlight pre code {
white-space: pre;
}

View File

@ -765,4 +765,9 @@ div.splitbox div.right {
color: #FFF; color: #FFF;
background: #0085a1; background: #0085a1;
border: 1px solid #0085a1; border: 1px solid #0085a1;
/* Related posts */
h4.see-also {
margin-top: 20px
} }

271
static/css/mermaid.css Normal file
View File

@ -0,0 +1,271 @@
/* Flowchart variables */
/* Sequence Diagram variables */
/* Gantt chart variables */
.mermaid .label {
color: #333;
}
.node rect,
.node circle,
.node ellipse,
.node polygon {
fill: #ECECFF;
stroke: #CCCCFF;
stroke-width: 1px;
}
.edgePath .path {
stroke: #333333;
}
.edgeLabel {
background-color: #e8e8e8;
}
.cluster rect {
fill: #ffffde !important;
rx: 4 !important;
stroke: #aaaa33 !important;
stroke-width: 1px !important;
}
.cluster text {
fill: #333;
}
.actor {
stroke: #CCCCFF;
fill: #ECECFF;
}
text.actor {
fill: black;
stroke: none;
}
.actor-line {
stroke: grey;
}
.messageLine0 {
stroke-width: 1.5;
stroke-dasharray: "2 2";
marker-end: "url(#arrowhead)";
stroke: #333;
}
.messageLine1 {
stroke-width: 1.5;
stroke-dasharray: "2 2";
stroke: #333;
}
#arrowhead {
fill: #333;
}
#crosshead path {
fill: #333 !important;
stroke: #333 !important;
}
.messageText {
fill: #333;
stroke: none;
}
.labelBox {
stroke: #CCCCFF;
fill: #ECECFF;
}
.labelText {
fill: black;
stroke: none;
}
.loopText {
fill: black;
stroke: none;
}
.loopLine {
stroke-width: 2;
stroke-dasharray: "2 2";
marker-end: "url(#arrowhead)";
stroke: #CCCCFF;
}
.note {
stroke: #aaaa33;
fill: #fff5ad;
}
.noteText {
fill: black;
stroke: none;
font-family: 'trebuchet ms', verdana, arial;
font-size: 14px;
}
/** Section styling */
.section {
stroke: none;
opacity: 0.2;
}
.section0 {
fill: rgba(102, 102, 255, 0.49);
}
.section2 {
fill: #fff400;
}
.section1,
.section3 {
fill: white;
opacity: 0.2;
}
.sectionTitle0 {
fill: #333;
}
.sectionTitle1 {
fill: #333;
}
.sectionTitle2 {
fill: #333;
}
.sectionTitle3 {
fill: #333;
}
.sectionTitle {
text-anchor: start;
font-size: 11px;
text-height: 14px;
}
/* Grid and axis */
.grid .tick {
stroke: lightgrey;
opacity: 0.3;
shape-rendering: crispEdges;
}
.grid path {
stroke-width: 0;
}
/* Today line */
.today {
fill: none;
stroke: red;
stroke-width: 2px;
}
/* Task styling */
/* Default task */
.task {
stroke-width: 2;
}
.taskText {
text-anchor: middle;
font-size: 11px;
}
.taskTextOutsideRight {
fill: black;
text-anchor: start;
font-size: 11px;
}
.taskTextOutsideLeft {
fill: black;
text-anchor: end;
font-size: 11px;
}
/* Specific task settings for the sections*/
.taskText0,
.taskText1,
.taskText2,
.taskText3 {
fill: white;
}
.task0,
.task1,
.task2,
.task3 {
fill: #8a90dd;
stroke: #534fbc;
}
.taskTextOutside0,
.taskTextOutside2 {
fill: black;
}
.taskTextOutside1,
.taskTextOutside3 {
fill: black;
}
/* Active task */
.active0,
.active1,
.active2,
.active3 {
fill: #bfc7ff;
stroke: #534fbc;
}
.activeText0,
.activeText1,
.activeText2,
.activeText3 {
fill: black !important;
}
/* Completed task */
.done0,
.done1,
.done2,
.done3 {
stroke: grey;
fill: lightgrey;
stroke-width: 2;
}
.doneText0,
.doneText1,
.doneText2,
.doneText3 {
fill: black !important;
}
/* Tasks on the critical line */
.crit0,
.crit1,
.crit2,
.crit3 {
stroke: #ff8888;
fill: red;
stroke-width: 2;
}
.activeCrit0,
.activeCrit1,
.activeCrit2,
.activeCrit3 {
stroke: #ff8888;
fill: #bfc7ff;
stroke-width: 2;
}
.doneCrit0,
.doneCrit1,
.doneCrit2,
.doneCrit3 {
stroke: #ff8888;
fill: lightgrey;
stroke-width: 2;
cursor: pointer;
shape-rendering: crispEdges;
}
.doneCritText0,
.doneCritText1,
.doneCritText2,
.doneCritText3 {
fill: black !important;
}
.activeCritText0,
.activeCritText1,
.activeCritText2,
.activeCritText3 {
fill: black !important;
}
.titleText {
text-anchor: middle;
font-size: 18px;
fill: black;
}
/*
*/
.node text {
font-family: 'trebuchet ms', verdana, arial;
font-size: 14px;
}
div.mermaidTooltip {
position: absolute;
text-align: center;
max-width: 200px;
padding: 2px;
font-family: 'trebuchet ms', verdana, arial;
font-size: 12px;
background: #ffffde;
border: 1px solid #aaaa33;
border-radius: 2px;
pointer-events: none;
z-index: 100;
}

273
static/css/mermaid.dark.css Normal file
View File

@ -0,0 +1,273 @@
/* Flowchart variables */
/* Sequence Diagram variables */
/* Gantt chart variables */
.mermaid .label {
color: #323D47;
}
.node rect,
.node circle,
.node ellipse,
.node polygon {
fill: #BDD5EA;
stroke: #81B1DB;
stroke-width: 1px;
}
.edgePath .path {
stroke: lightgrey;
}
.edgeLabel {
background-color: #e8e8e8;
}
.cluster rect {
fill: #6D6D65 !important;
rx: 4 !important;
stroke: rgba(255, 255, 255, 0.25) !important;
stroke-width: 1px !important;
}
.cluster text {
fill: #F9FFFE;
}
.actor {
stroke: #81B1DB;
fill: #BDD5EA;
}
text.actor {
fill: black;
stroke: none;
}
.actor-line {
stroke: lightgrey;
}
.messageLine0 {
stroke-width: 1.5;
stroke-dasharray: "2 2";
marker-end: "url(#arrowhead)";
stroke: lightgrey;
}
.messageLine1 {
stroke-width: 1.5;
stroke-dasharray: "2 2";
stroke: lightgrey;
}
#arrowhead {
fill: lightgrey !important;
}
#crosshead path {
fill: lightgrey !important;
stroke: lightgrey !important;
}
.messageText {
fill: lightgrey;
stroke: none;
}
.labelBox {
stroke: #81B1DB;
fill: #BDD5EA;
}
.labelText {
fill: #323D47;
stroke: none;
}
.loopText {
fill: lightgrey;
stroke: none;
}
.loopLine {
stroke-width: 2;
stroke-dasharray: "2 2";
marker-end: "url(#arrowhead)";
stroke: #81B1DB;
}
.note {
stroke: rgba(255, 255, 255, 0.25);
fill: #fff5ad;
}
.noteText {
fill: black;
stroke: none;
font-family: 'trebuchet ms', verdana, arial;
font-size: 14px;
}
/** Section styling */
.section {
stroke: none;
opacity: 0.2;
}
.section0 {
fill: rgba(255, 255, 255, 0.3);
}
.section2 {
fill: #EAE8B9;
}
.section1,
.section3 {
fill: white;
opacity: 0.2;
}
.sectionTitle0 {
fill: #F9FFFE;
}
.sectionTitle1 {
fill: #F9FFFE;
}
.sectionTitle2 {
fill: #F9FFFE;
}
.sectionTitle3 {
fill: #F9FFFE;
}
.sectionTitle {
text-anchor: start;
font-size: 11px;
text-height: 14px;
}
/* Grid and axis */
.grid .tick {
stroke: rgba(255, 255, 255, 0.3);
opacity: 0.3;
shape-rendering: crispEdges;
}
.grid .tick text {
fill: lightgrey;
opacity: 0.5;
}
.grid path {
stroke-width: 0;
}
/* Today line */
.today {
fill: none;
stroke: #DB5757;
stroke-width: 2px;
}
/* Task styling */
/* Default task */
.task {
stroke-width: 1;
}
.taskText {
text-anchor: middle;
font-size: 11px;
}
.taskTextOutsideRight {
fill: #323D47;
text-anchor: start;
font-size: 11px;
}
.taskTextOutsideLeft {
fill: #323D47;
text-anchor: end;
font-size: 11px;
}
/* Specific task settings for the sections*/
.taskText0,
.taskText1,
.taskText2,
.taskText3 {
fill: #323D47;
}
.task0,
.task1,
.task2,
.task3 {
fill: #BDD5EA;
stroke: rgba(255, 255, 255, 0.5);
}
.taskTextOutside0,
.taskTextOutside2 {
fill: lightgrey;
}
.taskTextOutside1,
.taskTextOutside3 {
fill: lightgrey;
}
/* Active task */
.active0,
.active1,
.active2,
.active3 {
fill: #81B1DB;
stroke: rgba(255, 255, 255, 0.5);
}
.activeText0,
.activeText1,
.activeText2,
.activeText3 {
fill: #323D47 !important;
}
/* Completed task */
.done0,
.done1,
.done2,
.done3 {
fill: lightgrey;
}
.doneText0,
.doneText1,
.doneText2,
.doneText3 {
fill: #323D47 !important;
}
/* Tasks on the critical line */
.crit0,
.crit1,
.crit2,
.crit3 {
stroke: #E83737;
fill: #E83737;
stroke-width: 2;
}
.activeCrit0,
.activeCrit1,
.activeCrit2,
.activeCrit3 {
stroke: #E83737;
fill: #81B1DB;
stroke-width: 2;
}
.doneCrit0,
.doneCrit1,
.doneCrit2,
.doneCrit3 {
stroke: #E83737;
fill: lightgrey;
stroke-width: 1;
cursor: pointer;
shape-rendering: crispEdges;
}
.doneCritText0,
.doneCritText1,
.doneCritText2,
.doneCritText3 {
fill: lightgrey !important;
}
.activeCritText0,
.activeCritText1,
.activeCritText2,
.activeCritText3 {
fill: #323D47 !important;
}
.titleText {
text-anchor: middle;
font-size: 18px;
fill: lightgrey;
}
/*
*/
.node text {
font-family: 'trebuchet ms', verdana, arial;
font-size: 14px;
}
div.mermaidTooltip {
position: absolute;
text-align: center;
max-width: 200px;
padding: 2px;
font-family: 'trebuchet ms', verdana, arial;
font-size: 12px;
background: #6D6D65;
border: 1px solid rgba(255, 255, 255, 0.25);
border-radius: 2px;
pointer-events: none;
z-index: 100;
}

30
static/js/mermaid.js Normal file

File diff suppressed because one or more lines are too long