tag added to single.html, more comment service support, language- code block ui edited, single page next, prev button style changed

This commit is contained in:
zzossig 2019-11-19 18:25:36 +09:00
parent 6cddb789af
commit 2e0f52a48f
38 changed files with 393 additions and 301 deletions

View File

@ -106,5 +106,15 @@ $(document).ready(function() {
});
// highlight
$("pre[class*='language-']").removeAttr("style");
$("pre[class*='language-']").each(function () {
$(this).removeAttr('style');
var langName = $(this).attr('class').replace('chroma language-', '').toUpperCase();
$(this).closest('table').attr('data-content', langName);
});
$('.lntable').each(function() {
if (!$(this).attr('data-content')) {
$(this).attr('data-content', 'Code');
}
});
});

View File

@ -22,3 +22,4 @@ $breakpoints: (
);
$search-height: 35px !default;
$code-font-size: 0.9em !default;

View File

@ -9,42 +9,13 @@
// flowchart.js
.diagram {
overflow: auto;
background-color: #FCFCFA;
margin-right: 1rem;
margin-bottom: 1rem;
border-radius: 0.25rem;
}
// js-sequence-diagram
.language-msc {
background: #fcfcfa !important;
div[id^=WaveDrom_Display] {
background-color: #FCFCFA;
border-radius: 0.25rem;
}
// .sequence text {
// @include themify($themes) {
// fill: themed('body-color');
// }
// }
// .sequence path {
// @include themify($themes) {
// fill: themed('body-background-color');
// }
// }
// chart.js
.language-chart {
background: #fcfcfa !important;
}
// wavedrom
.language-wave {
background: #fcfcfa !important;
}
// div[id^=WaveDrom_Display] {
// background-color: #FCFCFA;
// border-radius: 0.25rem;
// }
// viz.js
.language-viz-dot {
background: transparent !important;
}

View File

@ -53,59 +53,23 @@
.pagination-single {
@include flexbox();
@include align-items(center);
@include justify-content(space-between);
@include justify-content(center);
@include flex-direction(column);
width: 100%;
margin: 1rem 0;
&__left,
&__right {
@include flex-basis(auto);
@include flex-grow(0);
@include flex-shrink(0);
@include truncate($grid_max_width + $grid_max_unit);
@include flexbox();
@include align-items(center);
@include justify-content(center);
padding: 0.125rem;
border-radius: 0.125rem;
}
&__left {
@include align-items(center);
@include justify-content(center);
padding: 0 0.5rem 0 0.25rem;
&-title {
@include truncate(250px);
@include respond-to(sm) {
@include truncate(150px);
}
padding-bottom: 0.3rem;
}
&-title--icon {
@include themify($themes) {
color: themed('social-icon-color');
}
}
}
&__right {
@include align-items(center);
@include justify-content(center);
padding: 0 0.25rem 0 0.5rem;
&-title {
@include truncate(250px);
@include respond-to(sm) {
@include truncate(150px);
}
padding-bottom: 0.3rem;
}
&-title--icon {
@include themify($themes) {
color: themed('social-icon-color');
}
}
}
}

View File

@ -18,8 +18,9 @@
&__ul {
margin-left: 0.5rem;
li {
text-indent: -0.35em;
padding-left: 0.5em;
&::before {
padding-right: 0.5rem;
font-size: 1rem;

View File

@ -82,6 +82,8 @@ $related_header_title_color: {{ $scr.Get "related_header_title_color" }};
$related_link_color: {{ $scr.Get "related_link_color" }};
$content_pre_main_color: {{ $scr.Get "content_pre_main_color" }};
$content_pre_background_color: {{ $scr.Get "content_pre_background_color" }};
$content_pre_header_background_color: {{ $scr.Get "content_pre_header_background_color" }};
$content_diagram_background_color: {{ $scr.Get "content_diagram_background_color" }};
$content_code_color: {{ $scr.Get "content_code_color" }};
$content_code_background_color: {{ $scr.Get "content_code_background_color" }};
$burger_menu_color: {{ $scr.Get "burger_menu_color" }};

View File

@ -72,41 +72,6 @@
margin: 1.5rem 0 0.5rem 0;
}
pre {
@include themify($themes) {
background-color: themed("content-pre-background-color");
}
border-radius: 0.5rem;
position: relative;
padding: 1rem;
margin: 2rem 0 2rem 0;
width: 100%;
line-height: 1rem;
overflow-x: auto;
white-space: pre;
word-wrap: normal;
code {
@include themify($themes) {
color: themed('content-code-color');
background-color: transparent;
}
}
}
code {
border-radius: 0.25rem;
font-size: 0.9rem;
padding: 0.2rem;
overflow-x: auto;
@include themify($themes) {
background-color: themed("content-code-background-color");
}
a {
text-decoration: none;
}
}
code + .copy-to-clipboard {
margin-left: -1px;
border-left: 0 !important;
@ -134,17 +99,18 @@
@include transition(all, 0.2s, ease);
}
.copy-to-clipboard:hover {
@include translateY(-0.05rem);
@include translateY(-0.1rem);
}
pre .copy-to-clipboard {
.chroma .copy-to-clipboard {
position: absolute;
right: 4px;
top: 4px;
top: 5px;
border-radius: 2px;
z-index: 1;
@include transition(all, 0.2s, ease);
}
pre .copy-to-clipboard:hover {
@include translateY(-0.05rem);
.chroma .copy-to-clipboard:hover {
@include translateY(-0.1rem);
}
blockquote {
@ -202,4 +168,100 @@
cursor: pointer;
}
}
&__tags {
margin: 0 0.5rem;
list-style-type: none;
@include flexbox();
@include align-items(center);
@include flex-wrap(wrap);
}
&__tag {
padding: 0 0.25rem;
}
}
code, pre {
padding: 7px;
font-size: $code-font-size;
font-family: $code-font-stack;
@include themify($themes) {
background: themed('content-pre-background-color');
}
}
code {
padding: 3px 5px;
border-radius: 4px;
@include themify($themes) {
background: themed('content-pre-background-color');
}
}
// chroma
.highlight > .chroma {
margin: 1em 0;
border-radius: 5px;
overflow-x: auto;
box-shadow: 1px 1px 2px rgba(0,0,0,0.125);
position: relative;
@include themify($themes) {
background: themed('content-pre-background-color');
}
code {
padding: 0;
}
table {
position: relative;
&::after {
position: absolute;
top: 0;
right: 0;
left: 0;
padding: 2px 7px;
font-size: $code-font-size;
font-family: 'Montserrat', sans-serif;
font-weight: bold;
@include themify($themes) {
color: themed('content-code-color');
background: themed('content-pre-header-background-color');
}
content: attr(data-content);
}
}
.lntd {
// Fix code block null line height and
// Synchronous gutter and code line highly.
line-height: round($code-font-size * 1.5);
&:first-child {
width: 10px;
pre {
margin: 0;
padding: 30px 7px 10px;
}
}
&:last-child {
vertical-align: top;
pre {
margin: 0;
padding: 30px 10px 10px;
}
}
}
table, tr, td {
margin: 0;
padding: 0;
width: 100%;
border-collapse: collapse;
}
}

View File

@ -10,6 +10,8 @@
word-wrap: normal;
line-height: 1;
min-width: 100%;
font-size: 14px;
line-height: 1.5em;
-moz-tab-size: 4;
-o-tab-size: 4;
@ -206,7 +208,6 @@
position: absolute;
pointer-events: none;
top: 0;
font-size: 100%;
left: -3.8em;
width: 3em;
/* works for line-numbers below 1000 lines */
@ -275,7 +276,6 @@
div.code-toolbar > .toolbar button,
div.code-toolbar > .toolbar span {
color: #ccc;
font-size: 1em;
padding: 0.5em;
background: rgba(98, 114, 164, 1);
border-radius: 0.5em;

View File

@ -50,6 +50,8 @@ $custom: (
related-link-color: $related_link_color,
content-pre-main-color: $content_pre_main_color,
content-pre-background-color: $content_pre_background_color,
content-pre-header-background-color: $content_pre_header_background_color,
content-diagram-background-color: $content_diagram_background_color,
content-code-color: $content_code_color,
content-code-background-color: $content_code_background_color,
burger-menu-color: $burger_menu_color,

View File

@ -50,6 +50,8 @@ $dark: (
related-link-color: #A9DC76,
content-pre-main-color: #FFA7C4,
content-pre-background-color: #011627,
content-pre-header-background-color: darken(#011627, 1.5%),
content-diagram-background-color: red,//#011627,
content-code-color: #FCFCFA,
content-code-background-color: #595B5C,
burger-menu-color: #FCFCFA,

View File

@ -53,6 +53,8 @@ $hacker: (
related-link-color: $secondary-color,
content-pre-main-color: $primary-color,
content-pre-background-color: #202420,
content-pre-header-background-color: darken(#202420, 1.5%),
content-diagram-background-color: #202420,
content-code-color: #f3ff6e,
content-code-background-color: lighten(#151715, 25%),
burger-menu-color: $primary-color,

View File

@ -50,6 +50,8 @@ $light: (
related-link-color: #607d8b,
content-pre-main-color: #607d8b,
content-pre-background-color: #F5F2F0,
content-pre-header-background-color: darken(#F5F2F0, 3%),
content-diagram-background-color: #F5F2F0,
content-code-color: #212121,
content-code-background-color: #F5F2F0,
burger-menu-color: #9e9e9e,

View File

@ -53,6 +53,8 @@ $solarized: (
related-link-color: $secondary-color,
content-pre-main-color: $primary-color,
content-pre-background-color: #FBF1D1,
content-pre-header-background-color: darken(#FBF1D1, 3%),
content-diagram-background-color: #FBF1D1,
content-code-color: #424242,
content-code-background-color: #FBF1D1,
burger-menu-color: $primary-color,

View File

@ -49,6 +49,8 @@ related_header_title_color = "inherit"
related_link_color = "inherit"
content_pre_main_color = "inherit"
content_pre_background_color = "inherit"
content_pre_header_background_color = "inherit"
content_diagram_background_color = "inherit"
content_code_color = "inherit"
content_code_background_color = "inherit"
burger_menu_color = "inherit"

View File

@ -1,30 +0,0 @@
baseURL = "http://example.org/"
title = "Hugo Zzo Theme"
theme = "zzo"
defaultContentLanguage = "en"
defaultContentLanguageInSubdir = true
hasCJKLanguage = true
summaryLength = 70
copyright = "©{year}, All Rights Reserved"
timeout = 10000
enableEmoji = true
paginate = 13
rssLimit = 100
[outputs]
home = ["HTML", "RSS", "JSON", "WebAppManifest"]
[mediaTypes."application/manifest+json"]
suffixes = ["webmanifest"]
[outputFormats.WebAppManifest]
mediaType = "application/manifest+json"
rel = "manifest"
[taxonomies]
category = "categories"
tag = "tags"
series = "series"

View File

@ -1,9 +0,0 @@
[en]
title = "Hugo Zzo Theme"
languageName = "English"
weight = 1
[ko]
title = "Hugo Zzo Theme"
languageName = "한국어"
weight = 2

View File

@ -1,39 +0,0 @@
[[main]]
identifier = "about"
name = "about"
url = "about"
weight = 1
[[main]]
identifier = "archive"
name = "archive"
url = "archive"
weight = 2
[[main]]
identifier = "gallery"
name = "gallery"
url = "gallery"
weight = 3
[[main]]
parent = "gallery"
name = "cartoon"
url = "gallery/cartoon"
[[main]]
parent = "gallery"
name = "photo"
url = "gallery/photo"
[[main]]
identifier = "posts"
name = "posts"
url = "posts"
weight = 4
[[main]]
identifier = "notes"
name = "notes"
url = "notes"
weight = 5

View File

@ -1,72 +0,0 @@
logoText = "Zzo"
description = "The Zzo theme for Hugo example site."
custom_css = []
custom_js = []
# header
homeHeaderType = "slide" # text, img, slide
# body
enableBreadcrumb = true
enablePhotoSwipe = true
enableSearch = true
enableMark = true
enableGoToTop = true
enableWhoami = true
summaryShape = "classic" # card, classic, compact
archiveGroupByDate = "2006" # "2006-01": group by month, "2006": group by year
archivePaginate = 13
paginateWindow = 1
# whoami
myname = "zzossig"
email = "zzossig@gmail.com"
whoami = "Web Developer"
useGravatar = false
location = "Seoul, Korea"
organization = "Hugo"
link = "https://github.com/zzossig/hugo-theme-zzo"
# sidebar
enableBio = true
enableSidebar = true
enableSidebarTags = true
enableSidebarSeries = true
enableSidebarCategories = true
enableToc = true
enableTocSwitch = true
itemsPerCategory = 5
enableSideSubscribe = false
searchLanguages = ['en']
# footer
showPoweredBy = true
showFeedLinks = true
showSocialLinks = true
enableLangChange = true
enableThemeChange = true
themeOptions = ["dark", "light", "hacker", "solarized", "custom"]
# comment
enableComment = false
disqus_shortname = ""
commento = false
[marketing]
google_analytics = ""
google_tag_manager = ""
[socialOptions]
email = "mailto:your@email.com"
facebook = "http://example.org/"
twitter = "http://example.org/"
github = "https://github.com/zzossig/hugo-theme-zzo"
stack-overflow = ""
instagram = ""
google-plus = ""
youtube = ""
medium = ""
tumblr = ""
linkedin = ""
pinterest = ""
stack-exchange = ""

View File

@ -5,6 +5,10 @@ date = "2019-03-05"
description = "Guide to emoji usage in Hugo"
tags = [
"emoji",
"gamoji",
"namoji",
"bamoji",
"amoji"
]
+++

View File

@ -3,7 +3,7 @@ title: "Mermaid support"
date: 2019-11-17T12:00:06+09:00
description: "Generate diagrams, charts, graphs or flows from markdown-like text via javascript."
tags:
-
- diagram
series:
-
categories:

View File

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -7,6 +7,7 @@
<h2 class="single__title">{{ .Title }}</h2>
<div class="single__meta">
<div class="caption">🕓 {{ .Date.Format (i18n "single-dateformat") }} · ☕{{ .ReadingTime }} min read</div>
{{ partial "body/tags" . }}
</div>
<article class="single__contents">
{{ .Content }}

View File

@ -1,6 +1,9 @@
{{ $js := .Site.Data.lib.js }}
{{ $css := .Site.Data.lib.css }}
{{ $prism := resources.Get "js/prism.min.js" | resources.Minify | resources.Fingerprint }}
<script defer src="{{ $prism.RelPermalink }}"></script>
{{ if in .Params.Libraries "mermaid" }}
{{ printf "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\" title=\"mermaid\"></script>" $js.mermaid.url $js.mermaid.sri | safeHTML }}
@ -15,15 +18,27 @@
}
// mermaid Fix Mermaid.js clash with Highlight.js.
let mermaids = [];
$('code.language-mermaid:odd').each(function() {
$(this).unwrap('pre');
$(this).replaceWith(function () {
return $("<div />").append($(this).contents()).addClass('mermaid').css('padding', '30px 8px 8px');
});
});
$('code.language-mermaid').each(function (index, node) {
$(this).css('display', 'none');
});
/*let mermaids = [];
[].push.apply(mermaids, document.getElementsByClassName('language-mermaid'));
console.log(mermaids);
for (i = 0; i < mermaids.length; i++) {
$(mermaids[i]).unwrap('pre'); // Remove <pre> wrapper.
$(mermaids[i]).replaceWith(function () {
// Convert <code> block to <div> and add `mermaid` class so that Mermaid will parse it.
return $("<div />").append($(this).contents()).addClass('mermaid');
});
}
}*/
</script>
{{ end }}
@ -91,9 +106,25 @@
<script>
{{ $msc := .Site.Data.msc }}
var options = JSON.parse({{ $msc | jsonify }});
var chartPrefix = "language-msc";
$('code.language-msc:odd').each(function() {
$(this).unwrap('pre');
$(this).replaceWith(function () {
return $("<div />").append($(this).contents()).addClass('diagram').css('padding', '30px 8px 8px');
});
});
$(".diagram").sequenceDiagram(options);
$('code.language-msc').each(function (index, node) {
$(this).css('display', 'none');
});
/*
var index = 0;
var chartPrefix = "language-msc";
Array.prototype.forEach.call(document.querySelectorAll("[class^=" + chartPrefix + "]"), function (x) {
x.style.display = 'none'
x.parentNode.style.backgroundColor = "transparent"
@ -107,14 +138,13 @@
diagram.drawSVG("msc" + index, options);
index += 1;
});
});*/
</script>
{{ end }}
{{ if in .Params.Libraries "chart" }}
{{ printf "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\" title=\"chart\"></script>" $js.chart.url $js.chart.sri | safeHTML }}
<script>
var chartPrefix = "language-chart";
// setting defaults
var borderColor = "#666";
var bgColor = "#ddd";
@ -132,8 +162,29 @@
Chart.defaults.global.elements.point.borderColor = borderColor;
Chart.defaults.global.elements.point.backgroundColor = bgColor;
$('code.language-chart:odd').each(function(index, node) {
$(this).unwrap('pre');
node0 = document.createElement('canvas');
node0.height = 200;
node0.style.height = 200;
node0.id = 'myChart' + index;
source = JSON.parse(node.innerText);
node.parentNode.insertBefore(node0, node);
var ctx = document.getElementById('myChart' + index).getContext('2d');
var myChart = new Chart(ctx, source);
$(this).closest('td').css('padding', '40px 8px 8px');
$(this).hide();
});
$('code.language-chart:even').each(function (index, node) {
$(this).css('display', 'none');
});
/*var chartPrefix = "language-chart";
var index = 0;
Array.prototype.forEach.call(document.querySelectorAll("[class^=" + chartPrefix + "]"), function(x){
Array.prototype.forEach.call(document.querySelectorAll("[class^=" + chartPrefix + "]"), function(x) {
x.style.display = 'none'
x.parentNode.style.backgroundColor = "transparent"
jsonContent = x.innerText;
@ -148,7 +199,7 @@
var myChart = new Chart(ctx, source);
index +=1;
});
});*/
</script>
{{ end }}
@ -157,10 +208,27 @@
{{ printf "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\" title=\"wavedrom_skin\"></script>" $js.wavedrom_skin.url $js.wavedrom_skin.sri | safeHTML }}
<script>
var wavePrefix = "language-wave";
$('code.language-wave:odd').each(function(index, node) {
$(this).unwrap('pre');
node0 = document.createElement('div');
node0.id = 'WaveDrom_Display_' + index;
source = JSON.parse(node.innerText);
node.parentNode.insertBefore(node0, node);
WaveDrom.RenderWaveForm(index, source, "WaveDrom_Display_");
$(this).closest('td').css('padding', '40px 8px 8px');
$(this).hide();
});
$('code.language-wave').each(function (index, node) {
$(this).css('display', 'none');
});
/*var wavePrefix = "language-wave";
var index = 0;
Array.prototype.forEach.call(document.querySelectorAll("[class^=" + wavePrefix + "]"), function(x){
Array.prototype.forEach.call(document.querySelectorAll("[class^=" + wavePrefix + "]"), function(x) {
x.style.display = 'none'
x.parentNode.style.backgroundColor = "transparent"
jsonContent = x.innerText;
@ -172,7 +240,7 @@
WaveDrom.RenderWaveForm(index, source, "WaveDrom_Display_");
index += 1;
});
});*/
</script>
{{ end }}
@ -183,6 +251,32 @@
<script>
(function(){
var vizPrefix = "language-viz-";
$('code[class^="language-viz-"]:odd').each(function(index, node) {
$(this).unwrap('pre');
var engine;
node.getAttribute("class").split(" ").forEach(function(cls){
if (cls.startsWith(vizPrefix)) {
engine = cls.substr(vizPrefix.length);
}
});
var viz = new Viz();
viz.renderSVGElement(node.innerText, {engine:engine})
.then(function(element) {
element.style.width = "100%";
node.parentNode.insertBefore(element, node);
});
$(this).closest('td').css('padding', '40px 0 16px 0');
$(this).hide();
});
$('code[class^="language-viz-"]:even').each(function (index, node) {
$(this).hide();
});
/*var vizPrefix = "language-viz-";
Array.prototype.forEach.call(document.querySelectorAll("[class^=" + vizPrefix + "]"), function(x){
x.style.display = 'none'
x.parentNode.style.backgroundColor = "transparent"
@ -200,7 +294,7 @@
element.style.width = "100%";
x.parentNode.insertBefore(element, x);
})
});
});*/
})();
</script>
{{ end }}

View File

@ -0,0 +1,14 @@
<div class="single__tags caption">
{{ range $index, $value := .Params.Tags }}
{{ if and (eq $index 0) (ne (len $value) 0) }}
🏷️
{{ end }}
{{ if $value }}
<li>
<a href="{{ "/tags/" | relLangURL }}{{ $value | urlize }}" class="single__tag">
#{{ $value }}
</a>
</li>
{{ end }}
{{ end }}
</div>

View File

@ -0,0 +1,11 @@
<div id="SOHUCS" sid="{{ .RelPermalink }}"></div>
<script>
(function () {
if (window.location.hostname === 'localhost') return;
var appid = '{{ .Site.Params.changyan.changyanAppid }}';
var conf = '{{ .Site.Params.changyan.changyanAppkey }}';
var width = window.innerWidth || document.documentElement.clientWidth;
if (width < 960) { window.document.write('<script id="changyan_mobile_js" charset="utf-8" type="text/javascript" src="https://changyan.sohu.com/upload/mobile/wap-js/changyan_mobile.js?client_id=' + appid + '&conf=' + conf + '"><\/script>'); } else { var loadJs = function (d, a) { var c = document.getElementsByTagName("head")[0] || document.head || document.documentElement; var b = document.createElement("script"); b.setAttribute("type", "text/javascript"); b.setAttribute("charset", "UTF-8"); b.setAttribute("src", d); if (typeof a === "function") { if (window.attachEvent) { b.onreadystatechange = function () { var e = b.readyState; if (e === "loaded" || e === "complete") { b.onreadystatechange = null; a() } } } else { b.onload = a } } c.appendChild(b) }; loadJs("https://changyan.sohu.com/upload/changyan.js", function () { window.changyan.api.config({ appid: appid, conf: conf }) }); }
})();
</script>

View File

@ -3,5 +3,19 @@
{{ partial "comments/disqus.html" . }}
{{ else if $.Param "commento" }}
{{ partial "comments/commento.html" . }}
{{ else if $.Param "valine.enable" }}
{{ partial "comments/valine.html" . }}
{{ else if $.Param "changyan.changyanAppid" }}
{{ partial "comments/changyan.html" . }}
{{ else if $.Param "livere.livereUID" }}
{{ partial "comments/livere.html" . }}
{{ else if $.Param "gitment.owner" }}
{{ partial "comments/gitment.html" . }}
{{ else if $.Param "gitalk.owner" }}
{{ partial "comments/gitalk.html" . }}
{{ else if $.Param "utterances.owner" }}
{{ partial "comments/utterances.html" . }}
{{ else if $.Param "isso.enable" }}
{{ partial "comments/isso.html" . }}
{{ end }}
{{ end }}

View File

@ -1,4 +1,3 @@
{{ if .Site.Params.disqus_shortname }}
<div id="disqus_thread"></div>
<script>
let disqus_config = function () {
@ -17,4 +16,3 @@
(d.head || d.body).appendChild(s);
}) ();
</script>
{{end}}

View File

@ -0,0 +1,17 @@
<div id="gitalk-container"></div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.css" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js" crossorigin="anonymous"></script>
<script>
var gitalk = new Gitalk({
id: '{{ .Date }}',
title: '{{ .Title }}',
clientID: '{{ .Site.Params.gitalk.clientId }}',
clientSecret: '{{ .Site.Params.gitalk.clientSecret }}',
repo: '{{ .Site.Params.gitalk.repo }}',
owner: '{{ .Site.Params.gitalk.owner }}',
admin: ['{{ .Site.Params.gitalk.owner }}'],
body: decodeURI(location.href)
});
gitalk.render('gitalk-container');
</script>
<noscript>Please enable JavaScript to view the <a href="https://github.com/gitalk/gitalk">comments powered by gitalk.</a></noscript>

View File

@ -0,0 +1,19 @@
<div id="comments-gitment"></div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/theme-next/theme-next-gitment@1/default.min.css" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/gh/theme-next/theme-next-gitment@1/gitment.browser.min.js" crossorigin="anonymous"></script>
<script type="text/javascript">
var gitment = new Gitment({
id: '{{ .Date }}',
title: '{{ .Title }}',
link: decodeURI(location.href),
desc: '{{ .Summary }}',
owner: '{{ .Site.Params.gitment.owner }}',
repo: '{{ .Site.Params.gitment.repo }}',
oauth: {
client_id: '{{ .Site.Params.gitment.clientId }}',
client_secret: '{{ .Site.Params.gitment.clientSecret }}'
}
});
gitment.render('comments-gitment');
</script>
<noscript>Please enable JavaScript to view the <a href="https://github.com/imsun/gitment">comments powered by gitment.</a></noscript>

View File

@ -0,0 +1,6 @@
{{- $scriptSrc := .Site.Params.isso.scriptSrc -}}
{{- $dataAttrs := .Site.Params.isso.dataAttrs -}}
<script src='{{ $scriptSrc }}' {{- with $dataAttrs }} {{ . | safeHTMLAttr }} {{- end -}}></script>
<section id='isso-thread'></section>

View File

@ -0,0 +1,17 @@
<div id="lv-container" data-id="city" data-uid="{{ .Site.Params.livere.livereUID }}">
<script>
(function (d, s) {
var j, e = d.getElementsByTagName(s)[0];
if (typeof LivereTower === 'function') { return; }
j = d.createElement(s);
j.src = 'https://cdn-city.livere.com/js/embed.dist.js';
j.async = true;
e.parentNode.insertBefore(j, e);
})(document, 'script');
</script>
<noscript>Please enable JavaScript to view the comments powered by <a
href="https://livere.com/">LiveRe.</a></noscript>
</div>

View File

@ -0,0 +1,3 @@
<script src="https://utteranc.es/client.js" repo="{{ .Site.Params.utterances.owner }}/{{ .Site.Params.utterances.repo }}" issue-term="pathname" theme="github-light" crossorigin="anonymous" async>
</script>
<noscript>Please enable JavaScript to view the <a href="https://github.com/utterance">comments powered by utterances.</a></noscript>

View File

@ -0,0 +1,22 @@
{{- if .Site.Params.valine.visitor -}}
<span id="{{ .RelPermalink | relLangURL }}" class="leancloud_visitors" data-flag-title="{{ .Title }}">
<span class="post-meta-item-text">文章阅读量 </span>
<span class="leancloud-visitors-count">0</span>
<p></p>
</span>
{{- end }}
<div id="vcomments"></div>
<script src="//cdn1.lncld.net/static/js/3.0.4/av-min.js"></script>
<script src='//unpkg.com/valine/dist/Valine.min.js'></script>
<script>
new Valine({
el: '#vcomments' ,
appId: '{{ .Site.Params.valine.appId }}',
appKey: '{{ .Site.Params.valine.appKey }}',
notify: {{ .Site.Params.valine.notify }},
verify: {{ .Site.Params.valine.verify }},
avatar:'{{ .Site.Params.valine.avatar }}',
placeholder: '{{ .Site.Params.valine.placeholder }}',
visitor: {{ .Site.Params.valine.visitor }}
});
</script>

View File

@ -52,6 +52,8 @@
{{- $scr.Set "related_link_color" $skin.related_link_color -}}
{{- $scr.Set "content_pre_main_color" $skin.content_pre_main_color -}}
{{- $scr.Set "content_pre_background_color" $skin.content_pre_background_color -}}
{{- $scr.Set "content_pre_header_background_color" $skin.content_pre_header_background_color -}}
{{- $scr.Set "content_diagram_background_color" $skin.content_diagram_background_color -}}
{{- $scr.Set "content_code_color" $skin.content_code_color -}}
{{- $scr.Set "content_code_background_color" $skin.content_code_background_color -}}
{{- $scr.Set "burger_menu_color" $skin.burger_menu_color -}}

View File

@ -4,8 +4,6 @@
<script defer src="{{ $clipboard.RelPermalink }}"></script>
{{ $enquire := resources.Get "js/enquire.min.js" | resources.Fingerprint }}
<script defer src="{{ $enquire.RelPermalink }}"></script>
{{ $prism := resources.Get "js/prism.min.js" | resources.Minify | resources.Fingerprint }}
<script defer src="{{ $prism.RelPermalink }}"></script>
{{ $lazysizes := resources.Get "js/lazysizes.min.js" | resources.Fingerprint }}
<script defer src="{{ $lazysizes.RelPermalink }}"></script>
{{ $zzo := resources.Get "js/zzo.js" | resources.Minify | resources.Fingerprint }}

View File

@ -2,13 +2,12 @@
{{ if .PrevPage }}
<a href="{{ .PrevPage.Permalink }}" class="pagination-single__left">
{{ partial "svgs/arrow/keyboard-arrow-left.svg" (dict "width" 25 "height" 25) }}
<span class="pagination-single__left-title p1">{{ .PrevPage.Title }}</span>
<div class="pagination-single__left-title p1">{{ .PrevPage.Title }}</div>
</a>
{{ end }}
<div class="grow"></div>
{{ if .NextPage }}
<a href="{{ .NextPage.Permalink }}" class="pagination-single__right">
<span class="pagination-single__right-title p1">{{ .NextPage.Title }}</span>
<div class="pagination-single__right-title p1">{{ .NextPage.Title }}</div>
{{ partial "svgs/arrow/keyboard-arrow-right.svg" (dict "width" 25 "height" 25) }}
</a>
{{ end }}

File diff suppressed because one or more lines are too long