1
0
Fork 0
mirror of https://github.com/dillonzq/LoveIt.git synced 2025-04-27 06:06:20 +02:00
This commit is contained in:
dreamsafari 2025-03-28 21:47:39 +08:00 committed by GitHub
commit aba28fe286
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 674 additions and 48 deletions

View file

@ -2,3 +2,26 @@
// Custom style
// 自定义样式
// ==============================
.app-refresh {
background: #000;
height: 0;
line-height: 3em;
overflow: hidden;
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 42;
padding: 0 1em;
transition: all .3s ease;
}
.app-refresh-wrap {
display: flex;
color: #fff;
}
.app-refresh-wrap label {
flex: 1;
}
.app-refresh-show {
height: 3em;
}

View file

@ -6,3 +6,4 @@
max-height: 1.5em;
}
}
@import "_disqusjs.scss";

View file

@ -0,0 +1,319 @@
#dsqjs * {
margin: 0;
padding: 0;
}
#dsqjs a {
text-decoration: none;
color: #076dd0;
}
#dsqjs .dsqjs-hide {
display: none !important
}
#dsqjs .dsqjs-disabled {
cursor: not-allowed;
opacity: .5;
}
#dsqjs #dsqjs-msg {
text-align: center;
margin-top: 4px;
margin-bottom: 4px;
font-size: 14px;
}
#dsqjs #dsqjs-msg .dsqjs-msg-btn {
cursor: pointer;
}
#dsqjs .dsqjs-bullet {
line-height: 1.4;
margin: 0 2px;
}
#dsqjs .dsqjs-bullet::after {
color: #c2c6cc;
content: "·";
font-weight: 700
}
#dsqjs .dsqjs-clearfix:after,
#dsqjs .dsqjs-clearfix:before {
display: table;
content: "";
line-height: 0;
clear: both;
}
#dsqjs .dsqjs-nav {
position: relative;
margin: 0 0 20px;
border-bottom: 2px solid #e7e9ee;
}
#dsqjs ol,
#dsqjs ul {
list-style: none;
list-style-type: none;
}
#dsqjs .dsqjs-no-comment {
text-align: center;
font-size: 16px;
line-height: 1.5;
word-wrap: break-word;
overflow: hidden;
color: $global-font-color;
margin-bottom: 6px;
.dark-theme & {
color: $global-font-color-dark;
}
}
#dsqjs .dsqjs-nav-tab {
float: left;
text-transform: capitalize;
font-size: 15px;
padding: 12px 8px;
color: $global-font-color;
display: block;
margin: 0 15px 0 0;
font-weight: 700;
line-height: 1;
position: relative;
transition: all .2s ease-in-out;
.dark-theme & {
color: $global-font-color-dark;
}
}
#dsqjs .dsqjs-nav-tab:last-child {
margin: 0;
}
#dsqjs .dsqjs-tab-active {
color: $global-font-color;
.dark-theme & {
color: $global-font-color-dark;
}
}
#dsqjs .dsqjs-tab-active>span:after {
content: " ";
display: block;
height: 2px;
background-color: #076dd0 !important;
position: absolute;
bottom: -5px;
left: 0;
right: 0;
}
#dsqjs .dsqjs-post-list .dsqjs-post-item {
position: relative;
margin-bottom: 16px;
}
#dsqjs .dsqjs-post-list .dsqjs-post-avatar {
float: left;
margin-right: 10px;
position: relative;
background: #dbdfe4;
padding: 0;
display: block;
border-radius: 4px;
}
#dsqjs .dsqjs-post-list .dsqjs-post-avatar img {
width: 44px;
height: 44px;
display: block;
border-radius: 4px;
}
#dsqjs .dsqjs-post-list .dsqjs-post-header {
line-height: 1;
font-size: 14px;
margin-bottom: 3px;
}
#dsqjs .dsqjs-post-list .dsqjs-post-header .dsqjs-post-author {
color: $global-font-color;
font-weight: 700;
.dark-theme & {
color: $global-font-color-dark;
}
}
#dsqjs .dsqjs-post-list .dsqjs-post-header .dsqjs-admin-badge {
color: #fff;
background: #687a86;
padding: 1px 3px;
margin-left: 4px;
font-size: 12px;
line-height: 1;
font-weight: 700;
border-radius: 3px;
display: inline-block;
position: relative;
top: -1px;
left: 1px;
}
#dsqjs .dsqjs-post-list .dsqjs-post-header .dsqjs-meta {
display: inline-block;
font-size: 12px;
color: #656c7a;
}
#dsqjs .dsqjs-post-body {
font-size: 15px;
line-height: 1.5;
word-wrap: break-word;
overflow: hidden;
color: $global-font-color;
.dark-theme &{
color: $global-font-color-dark;
}
}
#dsqjs .dsqjs-post-body code {
padding: .2em .4em;
margin: 0;
font-size: 85%;
background: #f5f5f5;
color: inherit;
border-radius: 3px;
}
#dsqjs .dsqjs-post-body pre {
padding: .5em;
overflow: auto;
font-size: 85%;
line-height: 1.45;
border-radius: 3px;
background: #f5f5f5;
margin: .5em 0;
}
#dsqjs .dsqjs-post-body blockquote {
padding: 0 .8em;
margin: .5em 0;
color: #6a737d;
border-left: .25em solid #dfe2e5;
}
#dsqjs .dsqjs-post-body p:last-child {
margin: 0;
}
#dsqjs .dsqjs-post-list.dsqjs-children>li {
margin-left: 30px;
}
@media (min-width: 768px) {
#dsqjs .dsqjs-post-list.dsqjs-children>li {
margin-left: 48px;
}
#dsqjs .dsqjs-post-list .dsqjs-post-avatar {
margin-right: 12px;
}
#dsqjs .dsqjs-post-list .dsqjs-post-item {
margin-bottom: 20px;
}
}
@media (min-width: 1024px) {
#dsqjs .dsqjs-post-list.dsqjs-children>li {
margin-left: 60px;
}
}
#dsqjs .dsqjs-post-list.dsqjs-children .dsqjs-post-avatar img {
width: 38px;
height: 38px;
}
#dsqjs .dsqjs-load-more {
font-size: 14px;
font-weight: 400;
display: block;
text-align: center;
padding: 11px 14px;
margin: 0 0 24px;
background: #687a86;
color: #fff;
cursor: pointer;
}
#dsqjs .dsqjs-load-more:hover {
opacity: .8;
}
#dsqjs footer {
text-align: right;
line-height: 1.5;
padding-top: 10px;
padding-right: 10px;
border-top: 2px solid #e7e9ee;
margin-top: 12px;
font-weight: 700;
font-size: 16px;
color: #555;
}
#dsqjs .dsqjs-disqus-logo {
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 438 80'%3e%3cpath fill='%23575B5D' d='M30.2 1.6H1v76h28.9C57 77.6 73 61.3 73 39.4v-.2c0-22-15.7-37.6-42.9-37.6zm21.3 38.1c0 12.3-8.4 19.3-21 19.3H22V20.3h8.5c12.6 0 21 7 21 19.2v.2zm35.6 38h21.2V1.5H87.1v76zm70-47.4c-10.4-2.4-13-4-13-7.4v-.2c0-2.7 2.4-5 7.6-5 6.7 0 14.3 2.7 21.2 7.6l10.6-14.9A47.9 47.9 0 0 0 152.2.3c-18.3 0-29.4 10.2-29.4 24.3v.2c0 15.7 12.4 20.3 28.6 24 10.4 2.3 12.9 4 12.9 7.2v.2c0 3.3-3 5.2-8.7 5.2-8.8 0-17.2-3.1-24.7-9l-11.7 14a53.1 53.1 0 0 0 35.6 12.5c18.5 0 30.7-9.2 30.7-24.7V54c0-14.3-10.8-20-28.3-23.7zm120.7 9.3v-.2A39.5 39.5 0 0 0 236.9.1c-23.4 0-41 17.7-41 39.5v.2a39.5 39.5 0 0 0 40.8 39.4c8.7 0 16.6-2.5 23.1-6.8l8.4 7.5L279 68.1l-7.9-6.6a38 38 0 0 0 6.8-21.9zm-21.4.5c0 2.6-.5 5-1.3 7.3l-10.4-9.3-10.6 12 10.5 9a21.7 21.7 0 0 1-7.7 1.4c-11.6 0-19.4-9.7-19.4-20.7v-.2c0-11 7.7-20.5 19.2-20.5 11.7 0 19.7 9.7 19.7 20.7v.3zm83.5 4.3c0 10.6-5.5 15.6-14 15.6s-14-5.2-14-16.1V1.6h-21.4v42.7C290.5 68 304 79 325.7 79s35.6-10.8 35.6-35.3V1.5h-21.4v42.8zm68.9-14.1c-10.6-2.4-13.2-4-13.2-7.4v-.2c0-2.7 2.5-5 7.6-5 6.8 0 14.4 2.7 21.3 7.6l10.6-14.9A47.9 47.9 0 0 0 403.8.3c-18.3 0-29.5 10.2-29.5 24.3v.2c0 15.7 12.5 20.3 28.7 24 10.3 2.3 12.8 4 12.8 7.2v.2c0 3.3-3 5.3-8.7 5.3-8.8 0-17.1-3.2-24.6-9.2l-11.7 14A53.1 53.1 0 0 0 406.4 79c18.5 0 30.7-9.2 30.7-24.7V54c0-14.3-10.8-20-28.3-23.7z'/%3e%3c/svg%3e");
background-position: 50% 50%;
background-repeat: no-repeat;
display: inline-block;
height: 12px;
width: 65.7px;
}
#dsqjs .dsqjs-order {
display: flex;
float: right;
align-items: center;
margin-top: 10px;
margin-bottom: 12px;
}
#dsqjs .dsqjs-order-radio {
display: none;
}
#dsqjs .dsqjs-order-radio:checked+.dsqjs-order-label {
color: #fff;
background-color: #888;
}
#dsqjs .dsqjs-order-label {
display: block;
height: 20px;
line-height: 20px;
margin-right: 10px;
font-size: 12px;
border-radius: 2px;
padding: 0 5px;
background-color: #dcdcdc;
color: $global-font-color;
cursor: pointer;
}
#dsqjs p.dsqjs-has-more {
margin-bottom: 24px;
margin-left: 48px;
font-size: 13px;
line-height: 15px;
}
#dsqjs p.dsqjs-has-more a.dsqjs-has-more-btn {
color: #656c7a;
text-decoration: underline;
cursor: pointer;
}

View file

@ -202,3 +202,8 @@ other = "DELETED"
[deprecated]
other = "DEPRECATED"
# === shortcodes/version.html ===
# === single/footer.html ===
[RelatedPosts]
other = "You might also like..."
# === single/footer.html ===

View file

@ -203,3 +203,8 @@ other = "CHANGÉ"
[deleted]
other = "EFFACÉ"
# === shortcodes/version.html ===
# === single/footer.html ===
[RelatedPosts]
other = "Vous pourriez aussi aimer..."
# === single/footer.html ===

View file

@ -207,3 +207,8 @@ other = "删除"
[deprecated]
other = "弃用"
# === shortcodes/version.html ===
# === single/footer.html ===
[RelatedPosts]
other = "您可能还喜欢:"
# === single/footer.html ===

View file

@ -0,0 +1,262 @@
{{- $index := slice -}}
{{- range $page := $.Site.RegularPages -}}
{{- $cleaned := slice -}}
{{- $cleaned = $page.Plain}}
{{- $cleaned = replace $cleaned "\r" ""}}
{{- $cleaned = replace $cleaned "\n" ""}}
{{- $cleaned = replace $cleaned "\u0026rsquo;" "'"}}
{{- $cleaned = replace $cleaned "\u0026amp;" "&"}}
{{- $cleaned = replace $cleaned "\u0026#34;" "\""}}
{{- $cleaned = replace $cleaned "\u0026#39;" "'"}}
{{- $cleaned = replace $cleaned "\u0026ndash;" "-"}}
{{- $cleaned = replace $cleaned "\u0026gt;" ">"}}
{{- $cleaned = replace $cleaned "\u0026quot;" "\""}}
{{- $cleaned = replace $cleaned "\u0026ldquo;" "“"}}
{{- $cleaned = replace $cleaned "\u0026rdquo;" "”"}}
{{- $chunked := slice -}}
{{- $chunked = $chunked | append (substr $cleaned 0 500) -}}
{{- if gt (countwords $cleaned) 500 }}
{{- $chunked = $chunked | append (substr $cleaned 500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 1000 }}
{{- $chunked = $chunked | append (substr $cleaned 1000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 1500 }}
{{- $chunked = $chunked | append (substr $cleaned 1500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 2000 }}
{{- $chunked = $chunked | append (substr $cleaned 2000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 2500 }}
{{- $chunked = $chunked | append (substr $cleaned 2500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 3000 }}
{{- $chunked = $chunked | append (substr $cleaned 3000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 3500 }}
{{- $chunked = $chunked | append (substr $cleaned 3500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 4000 }}
{{- $chunked = $chunked | append (substr $cleaned 4000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 4500 }}
{{- $chunked = $chunked | append (substr $cleaned 4500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 5000 }}
{{- $chunked = $chunked | append (substr $cleaned 5000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 5500 }}
{{- $chunked = $chunked | append (substr $cleaned 5500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 6000 }}
{{- $chunked = $chunked | append (substr $cleaned 6000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 6500 }}
{{- $chunked = $chunked | append (substr $cleaned 6500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 7000 }}
{{- $chunked = $chunked | append (substr $cleaned 7000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 7500 }}
{{- $chunked = $chunked | append (substr $cleaned 7500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 8000 }}
{{- $chunked = $chunked | append (substr $cleaned 8000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 8500 }}
{{- $chunked = $chunked | append (substr $cleaned 8500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 9000 }}
{{- $chunked = $chunked | append (substr $cleaned 9000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 9500 }}
{{- $chunked = $chunked | append (substr $cleaned 9500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 10000 }}
{{- $chunked = $chunked | append (substr $cleaned 10000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 10500 }}
{{- $chunked = $chunked | append (substr $cleaned 10500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 11000 }}
{{- $chunked = $chunked | append (substr $cleaned 11000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 11500 }}
{{- $chunked = $chunked | append (substr $cleaned 11500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 12000 }}
{{- $chunked = $chunked | append (substr $cleaned 12000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 12500 }}
{{- $chunked = $chunked | append (substr $cleaned 12500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 13000 }}
{{- $chunked = $chunked | append (substr $cleaned 13000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 13500 }}
{{- $chunked = $chunked | append (substr $cleaned 13500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 14000 }}
{{- $chunked = $chunked | append (substr $cleaned 14000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 14500 }}
{{- $chunked = $chunked | append (substr $cleaned 14500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 15000 }}
{{- $chunked = $chunked | append (substr $cleaned 15000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 15500 }}
{{- $chunked = $chunked | append (substr $cleaned 15500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 16000 }}
{{- $chunked = $chunked | append (substr $cleaned 16000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 16500 }}
{{- $chunked = $chunked | append (substr $cleaned 16500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 17000 }}
{{- $chunked = $chunked | append (substr $cleaned 17000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 17500 }}
{{- $chunked = $chunked | append (substr $cleaned 17500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 18000 }}
{{- $chunked = $chunked | append (substr $cleaned 18000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 18500 }}
{{- $chunked = $chunked | append (substr $cleaned 18500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 19000 }}
{{- $chunked = $chunked | append (substr $cleaned 19000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 19500 }}
{{- $chunked = $chunked | append (substr $cleaned 19500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 20000 }}
{{- $chunked = $chunked | append (substr $cleaned 20000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 20500 }}
{{- $chunked = $chunked | append (substr $cleaned 20500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 21000 }}
{{- $chunked = $chunked | append (substr $cleaned 21000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 21500 }}
{{- $chunked = $chunked | append (substr $cleaned 21500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 22000 }}
{{- $chunked = $chunked | append (substr $cleaned 22000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 22500 }}
{{- $chunked = $chunked | append (substr $cleaned 22500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 23000 }}
{{- $chunked = $chunked | append (substr $cleaned 23000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 23500 }}
{{- $chunked = $chunked | append (substr $cleaned 23500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 24000 }}
{{- $chunked = $chunked | append (substr $cleaned 24000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 24500 }}
{{- $chunked = $chunked | append (substr $cleaned 24500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 25000 }}
{{- $chunked = $chunked | append (substr $cleaned 25000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 25500 }}
{{- $chunked = $chunked | append (substr $cleaned 25500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 26000 }}
{{- $chunked = $chunked | append (substr $cleaned 26000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 26500 }}
{{- $chunked = $chunked | append (substr $cleaned 26500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 27000 }}
{{- $chunked = $chunked | append (substr $cleaned 27000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 27500 }}
{{- $chunked = $chunked | append (substr $cleaned 27500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 28000 }}
{{- $chunked = $chunked | append (substr $cleaned 28000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 28500 }}
{{- $chunked = $chunked | append (substr $cleaned 28500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 29000 }}
{{- $chunked = $chunked | append (substr $cleaned 29000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 29500 }}
{{- $chunked = $chunked | append (substr $cleaned 29500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 30000 }}
{{- $chunked = $chunked | append (substr $cleaned 30000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 30500 }}
{{- $chunked = $chunked | append (substr $cleaned 30500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 31000 }}
{{- $chunked = $chunked | append (substr $cleaned 31000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 31500 }}
{{- $chunked = $chunked | append (substr $cleaned 31500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 32000 }}
{{- $chunked = $chunked | append (substr $cleaned 32000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 32500 }}
{{- $chunked = $chunked | append (substr $cleaned 32500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 33000 }}
{{- $chunked = $chunked | append (substr $cleaned 33000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 33500 }}
{{- $chunked = $chunked | append (substr $cleaned 33500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 34000 }}
{{- $chunked = $chunked | append (substr $cleaned 34000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 34500 }}
{{- $chunked = $chunked | append (substr $cleaned 34500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 35000 }}
{{- $chunked = $chunked | append (substr $cleaned 35000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 35500 }}
{{- $chunked = $chunked | append (substr $cleaned 35500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 36000 }}
{{- $chunked = $chunked | append (substr $cleaned 36000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 36500 }}
{{- $chunked = $chunked | append (substr $cleaned 36500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 37000 }}
{{- $chunked = $chunked | append (substr $cleaned 37000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 37500 }}
{{- $chunked = $chunked | append (substr $cleaned 37500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 38000 }}
{{- $chunked = $chunked | append (substr $cleaned 38000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 38500 }}
{{- $chunked = $chunked | append (substr $cleaned 38500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 39000 }}
{{- $chunked = $chunked | append (substr $cleaned 39000 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 39500 }}
{{- $chunked = $chunked | append (substr $cleaned 39500 500) -}}
{{- end -}}
{{- if gt (countwords $cleaned) 40000 }}
{{- $chunked = $chunked | append (substr $cleaned 40000 500) -}}
{{- end -}}
{{- range $i, $c := $chunked -}}
{{- $index = $index | append (dict "objectID" (print $page.File.UniqueID "_" $i) "content" $c "order" $i "title" $page.Title "date" $page.Date "url" $page.Permalink "tags" $page.Params.tags "categories" $page.Params.Categories) -}}
{{- end -}}
{{- end -}}
{{- $index | jsonify -}}

View file

@ -1,46 +0,0 @@
{{- if .Site.Params.search -}}
{{- $index := slice -}}
{{- $pages := .Site.RegularPages -}}
{{- if .Site.Params.page.hiddenFromSearch -}}
{{- $pages = where $pages "Params.hiddenfromsearch" false -}}
{{- else -}}
{{- $pages = where $pages "Params.hiddenfromsearch" "!=" true -}}
{{- end -}}
{{- range $pages -}}
{{- $uri := .RelPermalink -}}
{{- if $.Site.Params.search.absoluteURL -}}
{{- $uri = .Permalink -}}
{{- end -}}
{{- $meta := dict "uri" $uri "title" .Title "tags" .Params.tags "categories" .Params.categories -}}
{{- $meta = $.Site.Params.dateFormat | default "2006-01-02" | .PublishDate.Format | dict "date" | merge $meta -}}
{{- with .Description -}}
{{- $index = $index | append (dict "content" . "objectID" $uri | merge $meta) -}}
{{- end -}}
{{- $params := .Params | merge $.Site.Params.page -}}
{{/* Extended Markdown syntax */}}
{{- $content := dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" -}}
{{/* Remove line number for code */}}
{{- $content = $content | replaceRE `<span class="lnt?"> *\d*\n?</span>` "" -}}
{{- range $i, $contenti := split $content "<h2 id=" -}}
{{- if gt $i 0 -}}
{{- $contenti = printf "<h2 id=%v" $contenti -}}
{{- end -}}
{{- range $j, $contentj := split $contenti "<h3 id=" -}}
{{- if gt $j 0 -}}
{{- $contentj = printf "<h3 id=%v" $contentj -}}
{{- end -}}
{{/* Plainify, unescape and remove (\n, \t) */}}
{{- $contentj = $contentj | plainify | htmlUnescape | replaceRE `[\n\t ]+` " " -}}
{{- if gt $.Site.Params.search.contentLength 0 -}}
{{- $contentj = substr $contentj 0 $.Site.Params.search.contentLength -}}
{{- end -}}
{{- if $contentj | and (ne $contentj " ") -}}
{{- $one := printf "%v:%v:%v" $uri $i $j | dict "content" $contentj "objectID" | merge $meta -}}
{{- $index = $index | append $one -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- $index | jsonify | safeJS -}}
{{- end -}}

View file

@ -9,8 +9,25 @@
{{- $disqus := $comment.disqus | default dict -}}
{{- if $disqus.enable -}}
<div id="disqus_thread" class="comment"></div>
{{- if $disqus.proxy -}}
<script src="https://cdn.jsdelivr.net/npm/disqusjs@1.2/dist/disqus.js"></script>
<script>
var dsqjs = new DisqusJS({
shortname: {{ .Site.Params.page.comment.disqus.shortname }},
siteName: {{ .Site.Params.title }},
identifier: {{ if .Params.identifier }}{{ trim .Params.identifier "/" }}{{ else }}{{ trim .RelPermalink "/" }}{{end}},
url: {{ if .Params.identifier }}"{{ trim .Site.BaseURL "/" }}{{ .Params.identifier }}"{{ else }}{{ .Permalink }}{{end}},
title: {{ .Title }},
api: {{ .Site.Params.page.comment.disqus.api }},
apikey: {{ .Site.Params.page.comment.disqus.apikey }},
admin: {{ .Site.Params.page.comment.disqus.admin }},
adminLabel: {{ .Site.Params.page.comment.disqus.adminLabel }}
});
</script>
{{- else -}}
{{- $source := printf "https://%v.disqus.com/embed.js" $disqus.shortname -}}
{{- dict "Source" $source "Defer" true | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
<noscript>
Please enable JavaScript to view the comments powered by <a href="https://disqus.com/?ref_noscript">Disqus</a>.
</noscript>

View file

@ -47,5 +47,27 @@
{{- end -}}
</div>
</div>
<div class="app-refresh" id="app-refresh">
<div class="app-refresh-wrap" onclick="location.reload()">
<label>已更新最新版本</label>
<span>点击刷新</span>
</div>
</div>
<script>
if ('serviceWorker' in navigator) {
if (navigator.serviceWorker.controller) {
navigator.serviceWorker.addEventListener('controllerchange', function() {
showNotification();
});
}
window.addEventListener('load', function() {
navigator.serviceWorker.register('/sw.js');
});
}
function showNotification() {
document.querySelector('meta[name=theme-color]').content = '#000';
document.getElementById('app-refresh').className += ' app-refresh-show';
}
</script>
</footer>
{{- end -}}

View file

@ -13,7 +13,8 @@
{{- with .Site.Params.app.iconColor -}}
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="{{ . }}">
{{- end -}}
<link rel="manifest" href="/site.webmanifest">
<link rel="manifest" href="/manifest.webmanifest">
<script async src="https://cdn.jsdelivr.net/npm/pwacompat@2.0.10/pwacompat.min.js" integrity="sha384-I1iiXcTSM6j2xczpDckV+qhhbqiip6FyD6R5CpuqNaWXvyDUvXN5ZhIiyLQ7uuTh" crossorigin="anonymous"></script>
{{- end -}}
<link rel="canonical" href="{{ .Permalink }}" />

View file

@ -2,6 +2,18 @@
<div class="post-footer" id="post-footer">
<div class="post-info">
<div class="related-posts">
{{- if ( .Params.RelatedPosts | default true ) -}}
</br>
<b>{{- printf (T "RelatedPosts") -}}</b>
{{ range first 5 ( where ( where .Site.Pages.ByDate.Reverse ".Params.tags" "intersect" .Params.tags ) "Permalink" "!=" .Permalink ) }}
<li class="relatedPost">
<a href="{{ .RelPermalink }}">{{ .Title | markdownify }}</a><br />
{{ .Description | markdownify }}
</li>
{{ end }}
{{- end -}}
</div>
<div class="post-info-line">
<div class="post-info-mod">
<span>

View file

@ -6,7 +6,7 @@
{{- $toc := $params.toc -}}
{{- if eq $toc true -}}
{{- $toc = .Site.Params.page.toc | default dict -}}
{{- else if eq $toc false -}}
{{- else -}}
{{- $toc = dict "enable" false -}}
{{- end -}}