mirror of
https://github.com/dillonzq/LoveIt.git
synced 2024-11-12 18:06:17 +01:00
fix(css): fix some css bugs
This commit is contained in:
parent
7e6236361f
commit
344f0a9f41
36 changed files with 705 additions and 429 deletions
|
@ -6,13 +6,13 @@ draft: true
|
|||
description: ""
|
||||
show_in_homepage: true
|
||||
show_description: false
|
||||
license: ''
|
||||
license: ""
|
||||
|
||||
tags: []
|
||||
categories: []
|
||||
|
||||
featured_image: ''
|
||||
featured_image_preview: ''
|
||||
featured_image: ""
|
||||
featured_image_preview: ""
|
||||
|
||||
comment: true
|
||||
toc: false
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
@import url(https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900);
|
||||
|
||||
html {
|
||||
font-family: "Lato", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", STHeiti, "Microsoft Yahei", "WenQuanYi Micro Hei", Arial, Verdana, sans-serif;
|
||||
font-family: $global-font-family;
|
||||
|
||||
/* scrollbar, only support webkit */
|
||||
&::-webkit-scrollbar {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
@media only screen and (max-width: 1800px) {
|
||||
.post-warp {
|
||||
.warpper {
|
||||
max-width: 780px;
|
||||
|
||||
.post-toc {
|
||||
|
@ -9,7 +9,7 @@
|
|||
}
|
||||
|
||||
@media only screen and (max-width: 1300px) {
|
||||
.post-warp {
|
||||
.warpper {
|
||||
max-width: 560px;
|
||||
|
||||
.post-toc {
|
||||
|
@ -25,7 +25,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
.post-warp {
|
||||
.warpper {
|
||||
max-width: 80%;
|
||||
|
||||
.post-toc {
|
||||
|
@ -38,7 +38,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 480px) {
|
||||
@media only screen and (max-width: 560px) {
|
||||
.navbar {
|
||||
display: none;
|
||||
}
|
||||
|
@ -47,7 +47,7 @@
|
|||
display: block;
|
||||
}
|
||||
|
||||
.post-warp {
|
||||
.warpper {
|
||||
max-width: 100%;
|
||||
|
||||
.categories-card {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */
|
||||
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */
|
||||
|
||||
/* Document
|
||||
========================================================================== */
|
||||
|
@ -7,41 +7,35 @@
|
|||
* 1. Correct the line height in all browsers.
|
||||
* 2. Prevent adjustments of font size after orientation changes in iOS.
|
||||
*/
|
||||
@charset "UTF-8";
|
||||
html {
|
||||
line-height: 1.15; /* 1 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
}
|
||||
|
||||
html {
|
||||
line-height: 1.15; /* 1 */
|
||||
-webkit-text-size-adjust: 100%; /* 2 */
|
||||
}
|
||||
|
||||
/* Sections
|
||||
========================================================================== */
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the margin in all browsers.
|
||||
*/
|
||||
* Remove the margin in all browsers.
|
||||
*/
|
||||
|
||||
html,
|
||||
body,
|
||||
main,
|
||||
div,
|
||||
span,
|
||||
a,
|
||||
li,
|
||||
ul,
|
||||
hr,
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
h4,
|
||||
h5,
|
||||
h6 {
|
||||
padding: 0;
|
||||
body {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the font size and margin on `h1` elements within `section` and
|
||||
* `article` contexts in Chrome, Firefox, and Safari.
|
||||
*/
|
||||
* Render the `main` element consistently in IE.
|
||||
*/
|
||||
|
||||
main {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the font size and margin on `h1` elements within `section` and
|
||||
* `article` contexts in Chrome, Firefox, and Safari.
|
||||
*/
|
||||
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
|
@ -49,12 +43,12 @@ h1 {
|
|||
}
|
||||
|
||||
/* Grouping content
|
||||
========================================================================== */
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Add the correct box sizing in Firefox.
|
||||
* 2. Show the overflow in Edge and IE.
|
||||
*/
|
||||
* 1. Add the correct box sizing in Firefox.
|
||||
* 2. Show the overflow in Edge and IE.
|
||||
*/
|
||||
|
||||
hr {
|
||||
box-sizing: content-box; /* 1 */
|
||||
|
@ -63,9 +57,9 @@ hr {
|
|||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||
* 2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||
* 2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
|
||||
pre {
|
||||
font-family: monospace, monospace; /* 1 */
|
||||
|
@ -73,20 +67,20 @@ pre {
|
|||
}
|
||||
|
||||
/* Text-level semantics
|
||||
========================================================================== */
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the gray background on active links in IE 10.
|
||||
*/
|
||||
* Remove the gray background on active links in IE 10.
|
||||
*/
|
||||
|
||||
a {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Remove the bottom border in Chrome 57-
|
||||
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
||||
*/
|
||||
* 1. Remove the bottom border in Chrome 57-
|
||||
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
|
||||
*/
|
||||
|
||||
abbr[title] {
|
||||
border-bottom: none; /* 1 */
|
||||
|
@ -95,8 +89,8 @@ abbr[title] {
|
|||
}
|
||||
|
||||
/**
|
||||
* Add the correct font weight in Chrome, Edge, and Safari.
|
||||
*/
|
||||
* Add the correct font weight in Chrome, Edge, and Safari.
|
||||
*/
|
||||
|
||||
b,
|
||||
strong {
|
||||
|
@ -104,9 +98,9 @@ strong {
|
|||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||
* 2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
* 1. Correct the inheritance and scaling of font size in all browsers.
|
||||
* 2. Correct the odd `em` font sizing in all browsers.
|
||||
*/
|
||||
|
||||
code,
|
||||
kbd,
|
||||
|
@ -116,17 +110,17 @@ samp {
|
|||
}
|
||||
|
||||
/**
|
||||
* Add the correct font size in all browsers.
|
||||
*/
|
||||
* Add the correct font size in all browsers.
|
||||
*/
|
||||
|
||||
small {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent `sub` and `sup` elements from affecting the line height in
|
||||
* all browsers.
|
||||
*/
|
||||
* Prevent `sub` and `sup` elements from affecting the line height in
|
||||
* all browsers.
|
||||
*/
|
||||
|
||||
sub,
|
||||
sup {
|
||||
|
@ -145,23 +139,23 @@ sup {
|
|||
}
|
||||
|
||||
/* Embedded content
|
||||
========================================================================== */
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Remove the border on images inside links in IE 10.
|
||||
*/
|
||||
* Remove the border on images inside links in IE 10.
|
||||
*/
|
||||
|
||||
img {
|
||||
border-style: none;
|
||||
}
|
||||
|
||||
/* Forms
|
||||
========================================================================== */
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* 1. Change the font styles in all browsers.
|
||||
* 2. Remove the margin in Firefox and Safari.
|
||||
*/
|
||||
* 1. Change the font styles in all browsers.
|
||||
* 2. Remove the margin in Firefox and Safari.
|
||||
*/
|
||||
|
||||
button,
|
||||
input,
|
||||
|
@ -175,30 +169,28 @@ textarea {
|
|||
}
|
||||
|
||||
/**
|
||||
* Show the overflow in IE.
|
||||
* 1. Show the overflow in Edge.
|
||||
*/
|
||||
* Show the overflow in IE.
|
||||
* 1. Show the overflow in Edge.
|
||||
*/
|
||||
|
||||
button,
|
||||
input {
|
||||
/* 1 */
|
||||
input { /* 1 */
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
||||
* 1. Remove the inheritance of text transform in Firefox.
|
||||
*/
|
||||
* Remove the inheritance of text transform in Edge, Firefox, and IE.
|
||||
* 1. Remove the inheritance of text transform in Firefox.
|
||||
*/
|
||||
|
||||
button,
|
||||
select {
|
||||
/* 1 */
|
||||
select { /* 1 */
|
||||
text-transform: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Correct the inability to style clickable types in iOS and Safari.
|
||||
*/
|
||||
* Correct the inability to style clickable types in iOS and Safari.
|
||||
*/
|
||||
|
||||
button,
|
||||
[type="button"],
|
||||
|
@ -208,8 +200,8 @@ button,
|
|||
}
|
||||
|
||||
/**
|
||||
* Remove the inner border and padding in Firefox.
|
||||
*/
|
||||
* Remove the inner border and padding in Firefox.
|
||||
*/
|
||||
|
||||
button::-moz-focus-inner,
|
||||
[type="button"]::-moz-focus-inner,
|
||||
|
@ -220,8 +212,8 @@ button::-moz-focus-inner,
|
|||
}
|
||||
|
||||
/**
|
||||
* Restore the focus styles unset by the previous rule.
|
||||
*/
|
||||
* Restore the focus styles unset by the previous rule.
|
||||
*/
|
||||
|
||||
button:-moz-focusring,
|
||||
[type="button"]:-moz-focusring,
|
||||
|
@ -231,19 +223,19 @@ button:-moz-focusring,
|
|||
}
|
||||
|
||||
/**
|
||||
* Correct the padding in Firefox.
|
||||
*/
|
||||
* Correct the padding in Firefox.
|
||||
*/
|
||||
|
||||
fieldset {
|
||||
padding: 0.35em 0.75em 0.625em;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the text wrapping in Edge and IE.
|
||||
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
||||
* 3. Remove the padding so developers are not caught out when they zero out
|
||||
* `fieldset` elements in all browsers.
|
||||
*/
|
||||
* 1. Correct the text wrapping in Edge and IE.
|
||||
* 2. Correct the color inheritance from `fieldset` elements in IE.
|
||||
* 3. Remove the padding so developers are not caught out when they zero out
|
||||
* `fieldset` elements in all browsers.
|
||||
*/
|
||||
|
||||
legend {
|
||||
box-sizing: border-box; /* 1 */
|
||||
|
@ -255,25 +247,25 @@ legend {
|
|||
}
|
||||
|
||||
/**
|
||||
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
||||
*/
|
||||
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
|
||||
*/
|
||||
|
||||
progress {
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the default vertical scrollbar in IE 10+.
|
||||
*/
|
||||
* Remove the default vertical scrollbar in IE 10+.
|
||||
*/
|
||||
|
||||
textarea {
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the correct box sizing in IE 10.
|
||||
* 2. Remove the padding in IE 10.
|
||||
*/
|
||||
* 1. Add the correct box sizing in IE 10.
|
||||
* 2. Remove the padding in IE 10.
|
||||
*/
|
||||
|
||||
[type="checkbox"],
|
||||
[type="radio"] {
|
||||
|
@ -282,8 +274,8 @@ textarea {
|
|||
}
|
||||
|
||||
/**
|
||||
* Correct the cursor style of increment and decrement buttons in Chrome.
|
||||
*/
|
||||
* Correct the cursor style of increment and decrement buttons in Chrome.
|
||||
*/
|
||||
|
||||
[type="number"]::-webkit-inner-spin-button,
|
||||
[type="number"]::-webkit-outer-spin-button {
|
||||
|
@ -291,9 +283,9 @@ textarea {
|
|||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the odd appearance in Chrome and Safari.
|
||||
* 2. Correct the outline style in Safari.
|
||||
*/
|
||||
* 1. Correct the odd appearance in Chrome and Safari.
|
||||
* 2. Correct the outline style in Safari.
|
||||
*/
|
||||
|
||||
[type="search"] {
|
||||
-webkit-appearance: textfield; /* 1 */
|
||||
|
@ -301,17 +293,17 @@ textarea {
|
|||
}
|
||||
|
||||
/**
|
||||
* Remove the inner padding in Chrome and Safari on macOS.
|
||||
*/
|
||||
* Remove the inner padding in Chrome and Safari on macOS.
|
||||
*/
|
||||
|
||||
[type="search"]::-webkit-search-decoration {
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Correct the inability to style clickable types in iOS and Safari.
|
||||
* 2. Change font properties to `inherit` in Safari.
|
||||
*/
|
||||
* 1. Correct the inability to style clickable types in iOS and Safari.
|
||||
* 2. Change font properties to `inherit` in Safari.
|
||||
*/
|
||||
|
||||
::-webkit-file-upload-button {
|
||||
-webkit-appearance: button; /* 1 */
|
||||
|
@ -319,38 +311,38 @@ textarea {
|
|||
}
|
||||
|
||||
/* Interactive
|
||||
========================================================================== */
|
||||
========================================================================== */
|
||||
|
||||
/*
|
||||
* Add the correct display in Edge, IE 10+, and Firefox.
|
||||
*/
|
||||
* Add the correct display in Edge, IE 10+, and Firefox.
|
||||
*/
|
||||
|
||||
details {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/*
|
||||
* Add the correct display in all browsers.
|
||||
*/
|
||||
* Add the correct display in all browsers.
|
||||
*/
|
||||
|
||||
summary {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
/* Misc
|
||||
========================================================================== */
|
||||
========================================================================== */
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 10+.
|
||||
*/
|
||||
* Add the correct display in IE 10+.
|
||||
*/
|
||||
|
||||
template {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add the correct display in IE 10.
|
||||
*/
|
||||
* Add the correct display in IE 10.
|
||||
*/
|
||||
|
||||
[hidden] {
|
||||
display: none;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
@import "_home";
|
||||
|
||||
.post-warp {
|
||||
.warpper {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
max-width: 960px;
|
||||
|
@ -26,4 +26,4 @@
|
|||
text-align: right;
|
||||
padding-bottom: 2rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,14 +7,14 @@
|
|||
|
||||
.post-meta {
|
||||
font-size: .88rem;
|
||||
color: rgba(85, 85, 85, 0.52941) !important;
|
||||
color: $global-font-secondary-color;
|
||||
|
||||
span {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.dark-theme & {
|
||||
color: $global-font-secondary-color-dark !important;
|
||||
color: $global-font-secondary-color-dark;
|
||||
}
|
||||
|
||||
a {
|
||||
|
@ -246,7 +246,6 @@
|
|||
max-width: 100%;
|
||||
margin: .625rem 0;
|
||||
border-spacing: 0;
|
||||
box-shadow: 2px 2px 3px rgba(0,0,0,.125);
|
||||
background: $table-background-color;
|
||||
|
||||
.dark-theme & {
|
||||
|
@ -306,7 +305,7 @@
|
|||
margin: 0 0 2em 0;
|
||||
position: relative;
|
||||
|
||||
&:before {
|
||||
&::before {
|
||||
content: '\201C';
|
||||
position: absolute;
|
||||
top: 0em;
|
||||
|
@ -323,8 +322,8 @@
|
|||
}
|
||||
}
|
||||
|
||||
&:after {
|
||||
content: "#blockquote" attr(cite);
|
||||
&::after {
|
||||
content: '#blockquote' attr(cite);
|
||||
display: block;
|
||||
text-align: right;
|
||||
font-size: 0.875em;
|
||||
|
@ -340,6 +339,14 @@
|
|||
}
|
||||
}
|
||||
|
||||
.footnotes {
|
||||
color: $global-font-secondary-color;
|
||||
|
||||
.dark-theme & {
|
||||
color: $global-font-secondary-color-dark;
|
||||
}
|
||||
}
|
||||
|
||||
@import "../_partial/_post/code";
|
||||
@import "../_partial/_post/admonition";
|
||||
|
||||
|
@ -420,45 +427,9 @@
|
|||
.code {
|
||||
padding: .375rem;
|
||||
font-size: .875rem;
|
||||
font-family: Consolas, Monaco, Menlo, Consolas, monospace;
|
||||
font-family: $code-font-family;
|
||||
font-weight: bold;
|
||||
word-break: break-all;
|
||||
|
||||
.k {
|
||||
color: #D371E3;
|
||||
}
|
||||
|
||||
.kt {
|
||||
color: #D371E3;
|
||||
}
|
||||
|
||||
.kc {
|
||||
color: #D371E3;
|
||||
}
|
||||
|
||||
.o {
|
||||
color: #D371E3;
|
||||
}
|
||||
|
||||
.nf {
|
||||
color: #F16473;
|
||||
}
|
||||
|
||||
.na {
|
||||
color: #41B1F5;
|
||||
}
|
||||
|
||||
.s {
|
||||
color: #8BC56F;
|
||||
}
|
||||
|
||||
.n {
|
||||
color: #DB975C;
|
||||
}
|
||||
|
||||
.c1 {
|
||||
color: #7E848F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -544,20 +515,20 @@
|
|||
}
|
||||
|
||||
.post-nav {
|
||||
&:before,
|
||||
&:after {
|
||||
content: " ";
|
||||
&::before,
|
||||
&::after {
|
||||
content: ' ';
|
||||
display: table;
|
||||
}
|
||||
|
||||
& a.prev,
|
||||
& a.next {
|
||||
font-weight: 600;
|
||||
font-size: 1rem;
|
||||
font-weight: 600;
|
||||
|
||||
transition-duration: .3s;
|
||||
transition-property: transform;
|
||||
transition-timing-function: ease-out;
|
||||
transition-duration: 0.3s;
|
||||
}
|
||||
|
||||
& a.prev {
|
||||
|
@ -580,4 +551,4 @@
|
|||
|
||||
.post-comment {
|
||||
padding: 4rem 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
width: 100%;
|
||||
padding: 30% 0 0;
|
||||
position: relative;
|
||||
margin-bottom: 1rem;
|
||||
margin: 0.6rem auto;
|
||||
|
||||
img {
|
||||
position: absolute;
|
||||
|
@ -32,7 +32,7 @@
|
|||
height: 100%;
|
||||
left: 0;
|
||||
top: 0;
|
||||
object-fit: scale-down;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,9 +34,8 @@ p > code {
|
|||
// chroma
|
||||
.highlight > .chroma {
|
||||
margin: 1em 0;
|
||||
border-radius: 5px;
|
||||
border-radius: 6px;
|
||||
overflow-x: auto;
|
||||
box-shadow: 1px 1px 2px rgba(0,0,0,0.125);
|
||||
position: relative;
|
||||
background: $code-background-color;
|
||||
|
||||
|
@ -66,7 +65,7 @@ p > code {
|
|||
}
|
||||
|
||||
@each $sign, $text in $code-type-list {
|
||||
&.#{$sign} table::after {
|
||||
& .#{$sign} table::after {
|
||||
content: $text;
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +118,7 @@ p > code {
|
|||
}
|
||||
}
|
||||
|
||||
.code {
|
||||
.highlight {
|
||||
/* Parentheses */ .p { color: #A9A9B3 }
|
||||
/* Keyword */ .k { color: #859900 }
|
||||
/* KeywordConstant */ .kc { color: #859900; font-weight: bold }
|
||||
|
|
|
@ -3,6 +3,10 @@
|
|||
// ==============================
|
||||
|
||||
// ========== Global ========== //
|
||||
@import url(https://fonts.googleapis.com/css?family=Lato:100,300,400,700,900);
|
||||
|
||||
$global-font-family: Lato, -apple-system, BlinkMacSystemFont, PingFang-SC-Regular, Hiragino Sans GB, Microsoft Yahei, Arial, sans-serif !default;
|
||||
|
||||
// Background color of the body
|
||||
$global-background-color: #fff !default;
|
||||
$global-background-color-dark: #292a2d !default;
|
||||
|
@ -31,7 +35,7 @@ $navbar-active-color-dark: #fff !default;
|
|||
$post-link-color: #2d96bd !default;
|
||||
$post-link-color-dark: #eee !default;
|
||||
$post-link-hover-color: #ef3982 !default;
|
||||
$post-link-hover-color-dark: #fff !default;
|
||||
$post-link-hover-color-dark: #2d96bd !default;
|
||||
|
||||
$pagination-link-color: #2d96bd !default;
|
||||
$pagination-link-color-dark: #a9a9b3 !default;
|
||||
|
@ -52,7 +56,7 @@ $code-color: #E74C3C !default;
|
|||
$code-color-dark: #E5BF78 !default;
|
||||
|
||||
// Color of the code background.
|
||||
$code-background-color: whitesmoke !default;
|
||||
$code-background-color: #f5f5f5 !default;
|
||||
$code-background-color-dark: #272C34 !default;
|
||||
|
||||
$code-info-color: #cacaca !default;
|
||||
|
@ -61,7 +65,7 @@ $code-info-color: #cacaca !default;
|
|||
$code-font-size: 13px !default;
|
||||
|
||||
// Font family of the code.
|
||||
$code-font-family: Consolas, Monaco, Menlo, "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace !default;
|
||||
$code-font-family: Source Code Pro, Consolas, Liberation Mono, Menlo, Courier, monospace !default;
|
||||
|
||||
// Code type list.
|
||||
$code-type-list: (
|
||||
|
|
|
@ -157,27 +157,23 @@ jQuery(function($) {
|
|||
};
|
||||
changeTocState();
|
||||
|
||||
const HEADERFIX = 100;
|
||||
const HEADERFIX = 150;
|
||||
const $toclink = $('.toc-link');
|
||||
const $headerlink = $('.headerlink');
|
||||
const $tocLinkLis = $('.post-toc-content li');
|
||||
const activeIndex = function() {
|
||||
const activeIndex = function () {
|
||||
const scrollTop = $(window).scrollTop();
|
||||
const headerlinkTop = $.map($headerlink, function(link) {
|
||||
return $(link).offset().top;
|
||||
});
|
||||
const headerLinksOffsetForSearch = $.map(headerlinkTop, function(offset) {
|
||||
return offset - HEADERFIX;
|
||||
});
|
||||
const searchActiveTocIndex = function(array, target) {
|
||||
for (let i = 0; i < array.length - 1; i++) {
|
||||
if (target > array[i] && target <= array[i + 1]) return i;
|
||||
if ( target < array[i + 1]) return i;
|
||||
}
|
||||
if (target > array[array.length - 1]) return array.length - 1;
|
||||
return 0;
|
||||
return array.length - 1;
|
||||
};
|
||||
|
||||
const activeTocIndex = searchActiveTocIndex(headerLinksOffsetForSearch, scrollTop);
|
||||
const activeTocIndex = searchActiveTocIndex(headerlinkTop, scrollTop + HEADERFIX);
|
||||
|
||||
$($toclink).removeClass('active');
|
||||
$($tocLinkLis).removeClass('has-active');
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<!-- By Sam Herbert (@sherb), for everyone. More @ http://goo.gl/7AJzbL -->
|
||||
<svg width="38" height="38" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg">
|
||||
<svg width="319" height="319" viewBox="-281 -281 600 600" xmlns="http://www.w3.org/2000/svg">
|
||||
<defs>
|
||||
<linearGradient x1="8.042%" y1="0%" x2="65.682%" y2="23.865%" id="a">
|
||||
<stop stop-color="#fff" stop-opacity="0" offset="0%"/>
|
||||
<stop stop-color="#fff" stop-opacity=".631" offset="63.146%"/>
|
||||
<stop stop-color="#fff" offset="100%"/>
|
||||
<stop stop-color="#a5a5a5" stop-opacity="0" offset="0%"/>
|
||||
<stop stop-color="#a5a5a5" stop-opacity=".631" offset="63.146%"/>
|
||||
<stop stop-color="#a5a5a5" offset="100%"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g fill="none" fill-rule="evenodd">
|
||||
|
@ -18,7 +18,7 @@
|
|||
dur="0.9s"
|
||||
repeatCount="indefinite" />
|
||||
</path>
|
||||
<circle fill="#fff" cx="36" cy="18" r="1">
|
||||
<circle fill="#a5a5a5" cx="36" cy="18" r="1">
|
||||
<animateTransform
|
||||
attributeName="transform"
|
||||
type="rotate"
|
||||
|
@ -29,4 +29,4 @@
|
|||
</circle>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
</svg>
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
@ -1,41 +1,64 @@
|
|||
baseURL = "https://example.com/"
|
||||
languageCode = "en" # website language
|
||||
defaultContentLanguage = "en" # [en, zh, ...] determines which i18n file to use
|
||||
title = "LoveIt Theme" # website title
|
||||
theme = "LoveIt" # theme
|
||||
enableGitInfo = false # whether to use git commit log to generate lastmod record
|
||||
hasCJKLanguage = false # whether to include chinese/japanese/korean
|
||||
paginate = 12 # default amount of posts in each pages
|
||||
enableEmoji = true # whether to use emoji code
|
||||
enableRobotsTXT = true # whether to use robots.txt
|
||||
googleAnalytics = "" # [UA-XXXXXXXX-X] google analytics code
|
||||
disqusShortname = "dillonzq" # Disqus shortname to use Disqus in posts
|
||||
# website language
|
||||
languageCode = "en"
|
||||
# [en, zh, ...] determines which i18n file to use
|
||||
defaultContentLanguage = "en"
|
||||
# website title
|
||||
title = "LoveIt Theme"
|
||||
# theme
|
||||
theme = "LoveIt"
|
||||
# whether to use git commit log to generate lastmod record
|
||||
enableGitInfo = false
|
||||
# whether to include chinese/japanese/korean
|
||||
hasCJKLanguage = false
|
||||
# default amount of posts in each pages
|
||||
paginate = 12
|
||||
# whether to use emoji code
|
||||
enableEmoji = true
|
||||
# whether to use robots.txt
|
||||
enableRobotsTXT = true
|
||||
# [UA-XXXXXXXX-X] google analytics code
|
||||
googleAnalytics = ""
|
||||
# copyright description used only for seo schema
|
||||
copyright = "This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License."
|
||||
# copyright description used only for seo schema
|
||||
|
||||
#### Syntax Highlighting (https://gohugo.io/content-management/syntax-highlighting)
|
||||
pygmentsOptions = "linenos=table"
|
||||
pygmentsCodefences = true
|
||||
pygmentsUseClasses = true
|
||||
pygmentsCodefencesGuessSyntax = true
|
||||
|
||||
# Markup related configuration in Hugo
|
||||
[markup]
|
||||
[markup.goldmark]
|
||||
[markup.goldmark.renderer]
|
||||
unsafe = true
|
||||
# Syntax Highlighting (https://gohugo.io/content-management/syntax-highlighting)
|
||||
[markup.highlight]
|
||||
codeFences = true
|
||||
guessSyntax = true
|
||||
lineNoStart = 1
|
||||
lineNos = true
|
||||
lineNumbersInTable = true
|
||||
noClasses = false
|
||||
style = "monokai"
|
||||
tabWidth = 4
|
||||
# Goldmark is from Hugo 0.60 the default library used for Markdown
|
||||
[markup.goldmark]
|
||||
[markup.goldmark.renderer]
|
||||
unsafe = true
|
||||
# Table Of Contents settings
|
||||
[markup.tableOfContents]
|
||||
startLevel = 2
|
||||
endLevel = 6
|
||||
|
||||
[author] #### Author Info
|
||||
name = "XXXX"
|
||||
# Author Info
|
||||
[author]
|
||||
name = "xxxx"
|
||||
|
||||
[sitemap] #### Sitemap Info
|
||||
# Sitemap Info
|
||||
[sitemap]
|
||||
changefreq = "weekly"
|
||||
filename = "sitemap.xml"
|
||||
priority = 0.5
|
||||
|
||||
[Permalinks] #### Permalinks Info (https://gohugo.io/content-management/urls/#permalinks)
|
||||
# Permalinks Info (https://gohugo.io/content-management/urls/#permalinks)
|
||||
[Permalinks]
|
||||
posts = ":year/:month/:filename"
|
||||
|
||||
[menu] #### Menu Info
|
||||
# Menu Info
|
||||
[menu]
|
||||
[[menu.main]]
|
||||
identifier = "posts"
|
||||
name = "Posts"
|
||||
|
@ -62,41 +85,56 @@ unsafe = true
|
|||
|
||||
[[menu.main]]
|
||||
identifier = "zh"
|
||||
name = '<i class="fas fa-language fa-fw"></i>'
|
||||
name = '<i class="fas fa-language fa-fw" title="简体中文"></i>'
|
||||
url = "https://hugo-loveit-zh.netlify.com"
|
||||
weight = 5
|
||||
|
||||
[params]
|
||||
version = "5.x" # LoveIt theme version
|
||||
description = "LoveIt Theme Demo" # site description
|
||||
keywords = ["XXXX", "Theme", "Hugo"] # site keywords
|
||||
# LoveIt theme version
|
||||
version = "0.1.X"
|
||||
# site description
|
||||
description = "LoveIt Theme Demo"
|
||||
# site keywords
|
||||
keywords = ["Theme", "Hugo"]
|
||||
|
||||
#### Home Page Info
|
||||
home_mode = "post" # [post, other] home mode
|
||||
home_paginate = 6 # special amount of posts in each home post page
|
||||
avatar = "images/avatar.png" # URL of avatar shown in home page
|
||||
subtitle = "A Clean, Elegant but Advanced Hugo Theme" # subtitle shown in home page
|
||||
# Home Page Info
|
||||
## [post, other] home mode
|
||||
home_mode = "post"
|
||||
## special amount of posts in each home post page
|
||||
home_paginate = 6
|
||||
## URL of avatar shown in home page
|
||||
avatar = "images/avatar.png"
|
||||
## subtitle shown in home page
|
||||
subtitle = "A Clean, Elegant but Advanced Hugo Theme"
|
||||
|
||||
socialShare = true # whether to show social share links in post page
|
||||
# whether to show social share links in post page
|
||||
socialShare = true
|
||||
|
||||
#### Footer CopyRight Info
|
||||
since = 2018 # Site creation time
|
||||
icp = '' # ICP info only in China (HTML format is allowed)
|
||||
# Footer CopyRight Info
|
||||
## Site creation time
|
||||
since = 2018
|
||||
## ICP info only in China (HTML format is allowed)
|
||||
icp = ""
|
||||
## license info (HTML format is allowed)
|
||||
license= '<a rel="license external nofollow noopener noreffer" href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank">CC BY-NC 4.0</a>'
|
||||
# license info (HTML format is allowed)
|
||||
gitRepo = "" # public git repo url to link lastmod git commit only then enableGitInfo is true
|
||||
|
||||
linkToMarkdown = true # whether to show link to Raw Markdown content of the post
|
||||
# public git repo url to link lastmod git commit only then enableGitInfo is true
|
||||
gitRepo = ""
|
||||
|
||||
#### site verification code for Google/Bing/Yandex/Pinterest/Baidu
|
||||
# whether to show link to Raw Markdown content of the post
|
||||
linkToMarkdown = true
|
||||
|
||||
# site verification code for Google/Bing/Yandex/Pinterest/Baidu
|
||||
google_verification = ""
|
||||
bing_verification = ""
|
||||
yandex_verification = ""
|
||||
pinterest_verification = ""
|
||||
baidu_verification = ""
|
||||
|
||||
[params.cdn] #### CSS and JS Files CDN
|
||||
fontawesome_free_css = '' # for example '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.10.1/css/all.min.css" integrity="sha256-fdcFNFiBMrNfWL6OcAGQz6jDgNTRxnrLEd4vJYFWScE=" crossorigin="anonymous">'
|
||||
# CSS and JS Files CDN
|
||||
[params.cdn]
|
||||
## for example '<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5.10.1/css/all.min.css" integrity="sha256-fdcFNFiBMrNfWL6OcAGQz6jDgNTRxnrLEd4vJYFWScE=" crossorigin="anonymous">'
|
||||
fontawesome_free_css = ''
|
||||
animate_css = ''
|
||||
gitalk_css = ''
|
||||
gitalk_js = ''
|
||||
|
@ -116,15 +154,17 @@ unsafe = true
|
|||
aplayer_js = ''
|
||||
meting_js = ''
|
||||
|
||||
[params.gravatar] # Gravatar Info for preferred avatar in home page
|
||||
# Gravatar Info for preferred avatar in home page
|
||||
[params.gravatar]
|
||||
email = ""
|
||||
|
||||
[params.social] # Social Info in home page
|
||||
# Social Info in home page
|
||||
[params.social]
|
||||
GitHub = "xxxx"
|
||||
Linkedin = "xxxx"
|
||||
Twitter = "xxxx"
|
||||
#Instagram = "xxxx"
|
||||
#Email = "xxxx"
|
||||
Email = "xxxx@outlook.com"
|
||||
Facebook = "xxxx"
|
||||
Telegram = "xxxx"
|
||||
#Medium = "xxxx"
|
||||
|
@ -180,7 +220,8 @@ unsafe = true
|
|||
#Thingiverse = "xxxx"
|
||||
#Devto = "xxxx"
|
||||
|
||||
[params.share] # Social Share Links in post page
|
||||
# Social Share Links in post page
|
||||
[params.share]
|
||||
enable = true
|
||||
Twitter = true
|
||||
Facebook = true
|
||||
|
@ -193,30 +234,40 @@ unsafe = true
|
|||
#VKontakte = true
|
||||
#Weibo = true
|
||||
|
||||
[params.publisher] # Publisher Info just for SEO
|
||||
name = "XXXX"
|
||||
# Publisher Info just for SEO
|
||||
[params.publisher]
|
||||
name = "xxxx"
|
||||
[params.publisher.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
|
||||
[params.logo] # Website Log Info just for SEO
|
||||
# Website Log Info just for SEO
|
||||
[params.logo]
|
||||
url = "logo.png"
|
||||
width = 127
|
||||
height = 40
|
||||
|
||||
[params.image] # Website Image Info just for SEO
|
||||
# Website Image Info just for SEO
|
||||
[params.image]
|
||||
url = "cover.png"
|
||||
width = 800
|
||||
height = 600
|
||||
|
||||
[params.gitalk] # Gittalk Comment Config (https://github.com/gitalk/gitalk)
|
||||
# Disqus Comment Config (https://disqus.com/)
|
||||
[params.disqus]
|
||||
# Disqus shortname to use Disqus in posts
|
||||
shortname = ""
|
||||
|
||||
# Gittalk Comment Config (https://github.com/gitalk/gitalk)
|
||||
[params.gitalk]
|
||||
owner = ""
|
||||
repo = ""
|
||||
clientId = ""
|
||||
clientSecret = ""
|
||||
|
||||
[params.valine] # Valine Comment Config (https://github.com/xCss/Valine)
|
||||
# Valine Comment Config (https://github.com/xCss/Valine)
|
||||
[params.valine]
|
||||
enable = false
|
||||
appId = ""
|
||||
appKey = ""
|
||||
|
@ -227,30 +278,35 @@ unsafe = true
|
|||
visitor = true
|
||||
recordIP = true
|
||||
|
||||
[params.facebook] # Facebook Comment Config (https://developers.facebook.com/docs/plugins/comments)
|
||||
# Facebook Comment Config (https://developers.facebook.com/docs/plugins/comments)
|
||||
[params.facebook]
|
||||
enable = false
|
||||
width = "100%"
|
||||
numPosts = 10
|
||||
appId = ""
|
||||
languageCode = "en_US"
|
||||
|
||||
[privacy] #### Privacy Info (https://gohugo.io/about/hugo-and-gdpr/)
|
||||
# Privacy Info (https://gohugo.io/about/hugo-and-gdpr/)
|
||||
[privacy]
|
||||
[privacy.googleAnalytics]
|
||||
anonymizeIP = true
|
||||
|
||||
[privacy.youtube]
|
||||
privacyEnhanced = true
|
||||
|
||||
[mediaTypes] #### Options to make hugo output .md files.
|
||||
# Options to make hugo output .md files.
|
||||
[mediaTypes]
|
||||
[mediaTypes."text/plain"]
|
||||
suffixes = ["md"]
|
||||
|
||||
[outputFormats.MarkDown] #### Options to make hugo output .md files.
|
||||
# Options to make hugo output .md files.
|
||||
[outputFormats.MarkDown]
|
||||
mediaType = "text/plain"
|
||||
isPlainText = true
|
||||
isHTML = false
|
||||
|
||||
[outputs] #### Options to make hugo output .md files.
|
||||
# Options to make hugo output files.
|
||||
[outputs]
|
||||
home = ["HTML", "RSS"]
|
||||
page = ["HTML", "MarkDown"]
|
||||
section = ["HTML", "RSS"]
|
||||
|
|
|
@ -6,13 +6,13 @@ draft: false
|
|||
description: "This is a LoveIt theme preview and documentation page."
|
||||
show_in_homepage: true
|
||||
show_description: false
|
||||
license: ''
|
||||
license: ""
|
||||
|
||||
tags: ['Hugo', 'Theme']
|
||||
categories: ['Documentation']
|
||||
tags: ["Hugo", "Theme"]
|
||||
categories: ["Documentation"]
|
||||
|
||||
featured_image: ''
|
||||
featured_image_preview: ''
|
||||
featured_image: ""
|
||||
featured_image_preview: ""
|
||||
|
||||
comment: true
|
||||
toc: true
|
||||
|
|
169
exampleSite/content/posts/markdown-syntax.md
Normal file
169
exampleSite/content/posts/markdown-syntax.md
Normal file
|
@ -0,0 +1,169 @@
|
|||
---
|
||||
author: "Hugo Authors"
|
||||
title: "Markdown Syntax Guide"
|
||||
date: 2020-01-30T21:57:40+08:00
|
||||
lastmod: 2020-01-30T21:57:40+08:00
|
||||
draft: false
|
||||
description: "Sample article showcasing basic Markdown syntax and formatting for HTML elements."
|
||||
show_in_homepage: true
|
||||
show_description: false
|
||||
license: ""
|
||||
|
||||
tags: [
|
||||
"markdown",
|
||||
"css",
|
||||
"html",
|
||||
"themes",
|
||||
]
|
||||
categories: [
|
||||
"themes",
|
||||
"syntax",
|
||||
]
|
||||
|
||||
featured_image: /images/markdown.png
|
||||
featured_image_preview: ""
|
||||
|
||||
comment: true
|
||||
toc: true
|
||||
autoCollapseToc: true
|
||||
math: false
|
||||
---
|
||||
|
||||
This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme.
|
||||
<!--more-->
|
||||
|
||||
## Headings
|
||||
|
||||
The following HTML `<h2>`—`<h6>` elements represent six levels of section headings. `<h2>` is the highest section level while `<h6>` is the lowest.
|
||||
|
||||
## H2
|
||||
### H3
|
||||
#### H4
|
||||
##### H5
|
||||
###### H6
|
||||
|
||||
## Paragraph
|
||||
|
||||
Xerum, quo qui aut unt expliquam qui dolut labo. Aque venitatiusda cum,
|
||||
voluptionse latur sitiae dolessi aut parist aut dollo enim qui voluptate ma dolestendit
|
||||
peritin re plis aut quas inctum laceat est volestemque commosa as cus endigna tectur,
|
||||
offic to cor sequas etum rerum idem sintibus eiur? Quianimin porecus evelectur,
|
||||
cum que nis nust voloribus ratem aut omnimi, sitatur? Quiatem. Nam, omnis sum am facea
|
||||
corem alique molestrunt et eos evelece arcillit ut aut eos eos nus, sin conecerem erum
|
||||
fuga. Ri oditatquam, ad quibus unda veliamenimin cusam et facea ipsamus es exerum sitate
|
||||
dolores editium rerore eost, temped molorro ratiae volorro te reribus dolorer
|
||||
sperchicium faceata tiustia prat.
|
||||
|
||||
Itatur? Quiatae cullecum rem ent aut odis in re eossequodi nonsequ idebis ne sapicia is
|
||||
sinveli squiatum, core et que aut hariosam ex eat.
|
||||
|
||||
## Blockquotes
|
||||
|
||||
The blockquote element represents content that is quoted from another source, optionally
|
||||
with a citation which must be within a `footer` or `cite` element, and optionally with
|
||||
in-line changes such as annotations and abbreviations.
|
||||
|
||||
### Blockquote without attribution
|
||||
|
||||
> Tiam, ad mint andaepu dandae nostion secatur sequo quae.
|
||||
> **Note** that you can use *Markdown syntax* within a blockquote.
|
||||
|
||||
### Blockquote with attribution
|
||||
|
||||
> Don't communicate by sharing memory, share memory by communicating.</p>
|
||||
> — <cite>Rob Pike[^1]</cite>
|
||||
|
||||
## Tables
|
||||
|
||||
Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box.
|
||||
|
||||
Name | Age
|
||||
--------|------
|
||||
Bob | 27
|
||||
Alice | 23
|
||||
|
||||
### Inline Markdown within tables
|
||||
|
||||
| Inline | Markdown | In | Table |
|
||||
| ---------- | --------- | ----------------- | ---------- |
|
||||
| *italics* | **bold** | ~~strikethrough~~ | `code` |
|
||||
|
||||
## Code Blocks
|
||||
|
||||
### Code block with backticks
|
||||
|
||||
```html
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Example HTML5 Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
```
|
||||
|
||||
### Code block indented with four spaces
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Example HTML5 Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
### Code block with Hugo's internal highlight shortcode
|
||||
|
||||
{{< highlight html >}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Example HTML5 Document</title>
|
||||
</head>
|
||||
<body>
|
||||
<p>Test</p>
|
||||
</body>
|
||||
</html>
|
||||
{{< /highlight >}}
|
||||
|
||||
## List Types
|
||||
|
||||
### Ordered List
|
||||
|
||||
1. First item
|
||||
2. Second item
|
||||
3. Third item
|
||||
|
||||
### Unordered List
|
||||
|
||||
* List item
|
||||
* Another item
|
||||
* And another item
|
||||
|
||||
### Nested list
|
||||
|
||||
* Item
|
||||
1. First Sub-item
|
||||
2. Second Sub-item
|
||||
|
||||
## Other Elements — abbr, sub, sup, kbd, mark
|
||||
|
||||
<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.
|
||||
|
||||
H<sub>2</sub>O
|
||||
|
||||
X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
|
||||
|
||||
Press <kbd><kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd></kbd> to end the session.
|
||||
|
||||
Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms,
|
||||
and other small creatures.
|
||||
|
||||
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
|
BIN
exampleSite/static/images/markdown.png
Normal file
BIN
exampleSite/static/images/markdown.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 168 KiB |
|
@ -48,7 +48,7 @@ other = "Theme - "
|
|||
|
||||
# === posts/single.html ===
|
||||
[toc]
|
||||
other = "Table of Contents"
|
||||
other = "Contents"
|
||||
|
||||
[publish]
|
||||
other = "published on"
|
||||
|
@ -103,6 +103,9 @@ other = "return"
|
|||
[pageNotFound]
|
||||
other = "Page not found"
|
||||
|
||||
[pageNotFoundText]
|
||||
other = "The page you're looking for doesn't exist. Sorry."
|
||||
|
||||
[backToHome]
|
||||
other = "Back to Home"
|
||||
# === 404.html ===
|
||||
|
|
|
@ -106,6 +106,9 @@ other = "返回"
|
|||
[pageNotFound]
|
||||
other = "页面没找到"
|
||||
|
||||
[pageNotFoundText]
|
||||
other = "抱歉,您要查找的页面不存在。"
|
||||
|
||||
[backToHome]
|
||||
other = "回到主页"
|
||||
# === 404.html ===
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
{{ define "title" }}{{ T "pageNotFound" }} | {{ .Site.Title }}{{ end -}}
|
||||
{{- define "title" }}{{ T "pageNotFound" | printf "404 %s" }} | {{ .Site.Title }}{{ end -}}
|
||||
|
||||
{{ define "content" }}
|
||||
{{- define "content" -}}
|
||||
<div class="notfound">
|
||||
<h1 class="error-emoji"></h1>
|
||||
<p class="error-text">/* 404 {{ T "pageNotFound" }}. */</p>
|
||||
<p class="error-link"><a href="{{ .Site.BaseURL }}">↑ {{ T "backToHome" }} ↑</a></p>
|
||||
<p class="error-text">
|
||||
{{- T "pageNotFoundText" -}}
|
||||
</p>
|
||||
<p class="error-link">
|
||||
<a href="{{ .Site.BaseURL }}">
|
||||
{{- T "backToHome" | printf "← %s" -}}
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<script>
|
||||
var errorEmojiContainer = document.getElementsByClassName('error-emoji')[0];
|
||||
|
@ -15,4 +21,4 @@
|
|||
var errorEmoji = emojiArray[Math.floor(Math.random() * emojiArray.length)];
|
||||
errorEmojiContainer.appendChild(document.createTextNode(errorEmoji));
|
||||
</script>
|
||||
{{ end }}
|
||||
{{- end -}}
|
20
layouts/_default/_markup/render-image.html
Normal file
20
layouts/_default/_markup/render-image.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
<figure>
|
||||
<img
|
||||
{{ $res := resources.Get "svg/loading.svg" | minify }}
|
||||
src="{{ $res.RelPermalink }}"
|
||||
data-sizes="auto"
|
||||
data-src="{{ .Destination | safeURL }}"
|
||||
alt="{{ .Text }}"
|
||||
{{- with .Title -}}
|
||||
title="{{ . }}"
|
||||
{{- end -}}
|
||||
class="lazyload"
|
||||
>
|
||||
<figcaption class="image-caption">
|
||||
{{- if .Title -}}
|
||||
{{- .Title -}}
|
||||
{{- else -}}
|
||||
{{- .Text -}}
|
||||
{{- end -}}
|
||||
</figcaption>
|
||||
</figure>
|
10
layouts/_default/_markup/render-link.html
Normal file
10
layouts/_default/_markup/render-link.html
Normal file
|
@ -0,0 +1,10 @@
|
|||
<a href="{{ .Destination | safeURL }}"
|
||||
{{- with .Title -}}
|
||||
title="{{ . }}"
|
||||
{{- end -}}
|
||||
{{- if strings.HasPrefix .Destination "http" -}}
|
||||
target="_blank"
|
||||
{{- end -}}
|
||||
>
|
||||
{{- .Text -}}
|
||||
</a>
|
|
@ -1,13 +1,13 @@
|
|||
{{ if ne .Site.Params.version "5.x" -}}
|
||||
{{ errorf "\n\nThere are two possible situations that led to this error:\n 1. You haven't copied the config.toml yet. See https://github.com/dillonzq/LoveIt#installation \n 2. You have an incompatible update. See https://github.com//dillonzq/LoveIt/blob/master/CHANGELOG.md \n\n有两种可能的情况会导致这个错误发生:\n 1. 你还没有复制 config.toml 参考 https://github.com/dillonzq/LoveIt#installation \n 2. 你进行了一次不兼容的更新 参考 https://github.com//dillonzq/LoveIt/blob/master/CHANGELOG.md \n" -}}
|
||||
{{ end -}}
|
||||
{{- if ne .Site.Params.version "0.1.X" -}}
|
||||
{{- errorf "\n\nThere are two possible situations that led to this error:\n 1. You haven't copied the config.toml yet. See https://github.com/dillonzq/LoveIt#installation \n 2. You have an incompatible update. See https://github.com//dillonzq/LoveIt/blob/master/CHANGELOG.md \n\n有两种可能的情况会导致这个错误发生:\n 1. 你还没有复制 config.toml 参考 https://github.com/dillonzq/LoveIt#installation \n 2. 你进行了一次不兼容的更新 参考 https://github.com//dillonzq/LoveIt/blob/master/CHANGELOG.md \n" -}}
|
||||
{{- end -}}
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ .Site.LanguageCode }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
|
||||
{{- partial "head.html" . }}
|
||||
{{- partial "head.html" . -}}
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
|
@ -15,15 +15,17 @@
|
|||
window.isDark && document.body.classList.add('dark-theme');
|
||||
</script>
|
||||
<div class="wrapper">
|
||||
{{ partial "header.html" . -}}
|
||||
{{- partial "header.html" . -}}
|
||||
<main class="main">
|
||||
<div class="container">
|
||||
{{ block "content" . }}{{ end -}}
|
||||
{{- block "content" . }}{{ end -}}
|
||||
</div>
|
||||
</main>
|
||||
{{ partial "footer.html" . -}}
|
||||
{{ partial "scripts.html" . -}}
|
||||
{{- partial "footer.html" . -}}
|
||||
{{- partial "scripts.html" . -}}
|
||||
</div>
|
||||
<a href="#" class="dynamic-to-top" id="dynamic-to-top" data-scroll><span> </span></a>
|
||||
<a href="#" class="dynamic-to-top" id="dynamic-to-top" data-scroll>
|
||||
<span> </span>
|
||||
</a>
|
||||
</body>
|
||||
</html>
|
|
@ -1,17 +1,19 @@
|
|||
{{ define "title" }}{{ T "all" | humanize}}{{ T .Section | default .Section | humanize }} | {{ .Site.Title }}{{ end -}}
|
||||
{{- define "title" }}{{ T "all" | humanize}}{{ T .Section | default .Section | humanize }} | {{ .Site.Title }}{{ end -}}
|
||||
|
||||
{{ define "content" -}}
|
||||
{{ $data := .Data -}}
|
||||
<div class="post-warp archive">
|
||||
{{- define "content" -}}
|
||||
{{- $data := .Data -}}
|
||||
<div class="warpper archive">
|
||||
<h2 class="post-title animated pulse faster">
|
||||
{{ T "all" | humanize}}{{ T .Section | default .Section | humanize }}
|
||||
{{- T "all" | humanize}}{{ T .Section | default .Section | humanize -}}
|
||||
</h2>
|
||||
|
||||
{{- range (.Paginate (.Pages.GroupByDate "2006")).PageGroups -}}
|
||||
<h3>{{ .Key }}</h3>
|
||||
{{- range .Pages -}}
|
||||
<article class="archive-item">
|
||||
<a href="{{ .RelPermalink }}" class="archive-item-link">{{ .Title }}</a>
|
||||
<a href="{{ .RelPermalink }}" class="archive-item-link">
|
||||
{{- .Title -}}
|
||||
</a>
|
||||
<span class="archive-item-date">
|
||||
{{- .Date.Format (.Site.Params.dateFormatToUse | default "01-02") -}}
|
||||
</span>
|
||||
|
@ -20,4 +22,4 @@
|
|||
{{- end -}}
|
||||
{{- partial "paginator.html" . -}}
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- end -}}
|
|
@ -1,35 +1,28 @@
|
|||
{{ define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end }}
|
||||
{{- define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end -}}
|
||||
|
||||
{{ define "content" }}
|
||||
<div class="post-warp single">
|
||||
<h1 class="post-title animated pulse faster">{{ .Title }}</h1>
|
||||
{{- define "content" -}}
|
||||
<div class="warpper single">
|
||||
<h1 class="post-title animated pulse faster">
|
||||
{{- .Title -}}
|
||||
</h1>
|
||||
<div class="post-content">
|
||||
{{ $content := .Content }}
|
||||
{{ $REin := `<img src="([^"]+)" alt="([^"]+)?" />` }}
|
||||
{{ $REout := "<figure><img src=/images/loading.svg data-sizes=auto data-src=$1 alt=$2 class=lazyload><figcaption class=image-caption>$2</figcaption></figure>" }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<img src="([^"]+)" alt="([^"]+)?" title="([^"]+)?" />` }}
|
||||
{{ $REout = "<figure><img src=/images/loading.svg data-src=$1 data-sizes=auto alt=$2 title=$3 class=lazyload><figcaption class=image-caption>$2</figcaption></figure>" }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `:\(([\w- ]+?)\):` }}
|
||||
{{ $REout = `<i class="$1 fa-fw"></i>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `\[(.+?)\]\^\((.+?)\)` }}
|
||||
{{ $REout = `<strong><ruby>$1<rt>$2</rt></ruby></strong>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<sup>\[return\]</sup>` }}
|
||||
{{ $REout = printf "<sup>[%s]</sup>" (T "return") }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<(h[123456]) (id=".+?")>` }}
|
||||
{{ $REout = `<a class="post-dummy-target" $2></a><$1>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<(sup class="footnote-ref") (id="fnref:.+?")>` }}
|
||||
{{ $REout = `<a class="post-dummy-target" $2></a><$1>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<(li) (id="fn:.+?")>` }}
|
||||
{{ $REout = `<$1><a class="post-dummy-target" $2></a>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $content | safeHTML }}
|
||||
{{- $content := .Content -}}
|
||||
{{- $REin := `:\(([\w- ]+?)\):` -}}
|
||||
{{- $REout := `<i class="$1 fa-fw"></i>` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
{{- $REin = `\[(.+?)\]\^\((.+?)\)` -}}
|
||||
{{- $REout = `<strong><ruby>$1<rt>$2</rt></ruby></strong>` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
{{- $REin = `<sup>\[return\]</sup>` -}}
|
||||
{{- $REout = printf "<sup>[%s]</sup>" (T "return") -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
{{- $REin = `<(h[23456]) (id=".+?")>` -}}
|
||||
{{- $REout = `<a class="post-dummy-target" $2></a><$1>` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
{{- $REin = `<(.+) (id="fnref:.+?")>` -}}
|
||||
{{- $REout = `<a class="post-dummy-target" $2></a><$1>` -}}
|
||||
{{- $content = replaceRE $REin $REout $content -}}
|
||||
{{- $content | safeHTML -}}
|
||||
</div>
|
||||
</div>
|
||||
{{end }}
|
||||
{{- end -}}
|
|
@ -1,3 +1,3 @@
|
|||
# {{ .Title }}
|
||||
|
||||
{{ .RawContent }}
|
||||
{{ .RawContent }}
|
||||
|
|
|
@ -9,7 +9,8 @@
|
|||
{{ with .Params.featured_image }}
|
||||
{{ $image := $.Params.featured_image_preview | default . }}
|
||||
<div class="post-featured-image-preview">
|
||||
<img src=/images/loading.svg data-sizes=auto data-src={{ $image }} alt="featured image" class="lazyload">
|
||||
{{ $res := resources.Get "svg/loading.svg" | minify }}
|
||||
<img src="{{ $res.RelPermalink }}" data-sizes="auto" data-src="{{ $image }}" alt="featured image" class="lazyload">
|
||||
</div>
|
||||
{{ end }}
|
||||
<!-- end featured_image-->
|
||||
|
@ -42,7 +43,7 @@
|
|||
{{ $summary = replaceRE $REin $REout $summary }}
|
||||
{{ $REin = `\[(.+?)\]\^\((.+?)\)` }}
|
||||
{{ $REout = `<strong><ruby>$1<rt>$2</rt></ruby></strong>` }}
|
||||
{{ $summary = replaceRE $REin $REout $summary }}
|
||||
{{ $summary = replaceRE $REin $REout $summary }}
|
||||
{{ $summary | safeHTML }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
|
|
@ -1,37 +1,49 @@
|
|||
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||
{{ if .IsHome }}
|
||||
<title>{{ .Title }}</title>
|
||||
{{ else }}
|
||||
<title>{{ .Title }} - {{ .Site.Title }}</title>
|
||||
{{ end }}
|
||||
{{- with .Title }}{{ . }} | {{ end }}{{ .Site.Title -}}
|
||||
<link href="{{ .Permalink }}index.xml" rel="self"/>
|
||||
<link href="{{ .Permalink }}"/>
|
||||
{{ if not .Date.IsZero }}
|
||||
<updated>{{ .Date.Format "02-01-2006T15:04:05-07:00" | safeHTML }}</updated>
|
||||
{{ end }}
|
||||
<id>{{ .Permalink }}</id>
|
||||
{{- if not .Date.IsZero -}}
|
||||
<updated>
|
||||
{{- .Date.Format "02-01-2006T15:04:05-07:00" | safeHTML -}}
|
||||
</updated>
|
||||
{{- end -}}
|
||||
<id>
|
||||
{{- .Permalink -}}
|
||||
</id>
|
||||
<author>
|
||||
{{ with .Site.Author.name }}
|
||||
{{- with .Site.Author.name -}}
|
||||
<name>{{ . }}</name>
|
||||
{{ end }}
|
||||
{{ with $.Site.Author.email }}
|
||||
{{- end -}}
|
||||
{{- with .Site.Author.email -}}
|
||||
<email>{{ . }}</email>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
</author>
|
||||
<generator>Hugo -- gohugo.io</generator>
|
||||
{{ range first 15 (where .Data.Pages "Type" "in" .Site.Params.mainSections) }}
|
||||
{{- range first 15 (where .Data.Pages "Type" "in" .Site.Params.mainSections) -}}
|
||||
<entry>
|
||||
{{ `<title type="html"><![CDATA[` | safeHTML }}{{ .Title }}]]></title>
|
||||
<title type="html">
|
||||
{{- printf "<![CDATA[%s]]>" .Title | safeHTML -}}
|
||||
</title>
|
||||
<link href="{{ .Permalink }}"/>
|
||||
<id>{{ .Permalink }}</id>
|
||||
{{ with .Site.Author.name }}
|
||||
<id>
|
||||
{{- .Permalink -}}
|
||||
</id>
|
||||
{{- with .Site.Author.name -}}
|
||||
<author>
|
||||
<name>{{ . }}</name>
|
||||
<name>
|
||||
{{- . -}}
|
||||
</name>
|
||||
</author>
|
||||
{{ end }}
|
||||
<published>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</published>
|
||||
<updated>{{ .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>
|
||||
{{ `<content type="html"><![CDATA[` | safeHTML }}{{ .Content }}]]></content>
|
||||
{{- end -}}
|
||||
<published>
|
||||
{{- .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML -}}
|
||||
</published>
|
||||
<updated>
|
||||
{{- .Lastmod.Format "2006-01-02T15:04:05-07:00" | safeHTML -}}
|
||||
</updated>
|
||||
<content type="html">
|
||||
{{- printf "<![CDATA[%s]]>" .Content | safeHTML -}}
|
||||
</content>
|
||||
</entry>
|
||||
{{ end }}
|
||||
</feed>
|
||||
{{- end -}}
|
||||
</feed>
|
|
@ -1,22 +1,22 @@
|
|||
{{ define "content" -}}
|
||||
{{ if eq .Site.Params.home_mode "post" -}}
|
||||
<div class="post-warp">
|
||||
{{- define "content" -}}
|
||||
{{- if eq .Site.Params.home_mode "post" -}}
|
||||
<div class="warpper">
|
||||
{{- partial "home/profile.html" . -}}
|
||||
|
||||
{{ $paginator := where .Site.RegularPages "Type" "posts" -}}
|
||||
{{ $paginator = where $paginator "Params.show_in_homepage" "!=" false -}}
|
||||
{{ with .Site.Params.home_paginate -}}
|
||||
{{ $paginator = $.Paginate $paginator . -}}
|
||||
{{ else -}}
|
||||
{{ $paginator = $.Paginate $paginator -}}
|
||||
{{ end -}}
|
||||
{{ range $paginator.Pages -}}
|
||||
{{ .Render "summary" -}}
|
||||
{{ end -}}
|
||||
{{- $paginator := where .Site.RegularPages "Type" "posts" -}}
|
||||
{{- $paginator = where $paginator "Params.show_in_homepage" "!=" false -}}
|
||||
{{- with .Site.Params.home_paginate -}}
|
||||
{{- $paginator = $.Paginate $paginator . -}}
|
||||
{{- else -}}
|
||||
{{- $paginator = $.Paginate $paginator -}}
|
||||
{{- end -}}
|
||||
{{- range $paginator.Pages -}}
|
||||
{{- .Render "summary" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{ partial "paginator.html" . -}}
|
||||
{{- partial "paginator.html" . -}}
|
||||
</div>
|
||||
{{- else -}}
|
||||
{{ partial "home/profile.html" . -}}
|
||||
{{ end -}}
|
||||
{{ end }}
|
||||
{{- partial "home/profile.html" . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
|
@ -1,6 +1,6 @@
|
|||
{{ if eq (getenv "HUGO_ENV") "production" | and .IsPage | and (ne .Params.comment false) -}}
|
||||
<!-- Disqus Comment System-->
|
||||
{{- if .Site.DisqusShortname -}}
|
||||
{{- if .Site.Params.disqus.shortname -}}
|
||||
<div id="disqus_thread"></div>
|
||||
<script type="text/javascript">
|
||||
(function() {
|
||||
|
@ -10,7 +10,7 @@
|
|||
return;
|
||||
|
||||
var dsq = document.createElement("script"); dsq.type = "text/javascript"; dsq.async = true;
|
||||
var disqus_shortname = "{{ .Site.DisqusShortname }}";
|
||||
var disqus_shortname = "{{ .Site.Params.disqus.shortname }}";
|
||||
dsq.src = "//" + disqus_shortname + ".disqus.com/embed.js";
|
||||
(document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]).appendChild(dsq);
|
||||
})();
|
||||
|
@ -92,4 +92,4 @@
|
|||
data-numposts="{{ .Site.Params.facebook.numPosts }}"
|
||||
></div>
|
||||
{{- end -}}
|
||||
{{- end }}
|
||||
{{- end }}
|
|
@ -40,17 +40,17 @@
|
|||
|
||||
{{ partial "seo.html" . -}}
|
||||
|
||||
{{ $res := resources.Get "css/style.scss" | resources.ToCSS | resources.Minify -}}
|
||||
{{ $res := resources.Get "css/style.scss" | toCSS | minify -}}
|
||||
<link rel="stylesheet" href="{{ $res.RelPermalink }}">
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.fontawesome_free_css -}}
|
||||
{{ .Site.Params.cdn.fontawesome_free_css | safeHTML }}
|
||||
{{ else -}}
|
||||
{{ $res := resources.Get "css/lib/fontawesome-free/all.min.css" | resources.Minify -}}
|
||||
{{ $res = resources.Get "css/lib/fontawesome-free/all.min.css" | minify -}}
|
||||
<link rel="stylesheet" href="{{ $res.RelPermalink }}">
|
||||
{{ end }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | and .Site.Params.cdn.animate_css -}}
|
||||
{{ .Site.Params.cdn.animate_css | safeHTML }}
|
||||
{{ else -}}
|
||||
{{ $res := resources.Get "css/lib/animate/animate.min.css" | resources.Minify -}}
|
||||
{{ $res = resources.Get "css/lib/animate/animate.min.css" | minify -}}
|
||||
<link rel="stylesheet" href="{{ $res.RelPermalink }}">
|
||||
{{ end }}
|
||||
{{ end }}
|
|
@ -7,7 +7,7 @@
|
|||
{{ $author = .Site.Author.name }}
|
||||
{{ end }}
|
||||
|
||||
<article class="post-warp">
|
||||
<article class="warpper">
|
||||
<h1 class="post-title animated flipInX">{{ .Title }}</h1>
|
||||
|
||||
<div class="post-meta">
|
||||
|
@ -39,7 +39,8 @@
|
|||
|
||||
{{ with .Params.featured_image }}
|
||||
<div class="post-featured-image">
|
||||
<img src=/images/loading.svg data-sizes=auto data-src={{ . }} alt="featured image" class="lazyload">
|
||||
{{ $res := resources.Get "svg/loading.svg" | minify }}
|
||||
<img src="{{ $res.RelPermalink }}" data-sizes="auto" data-src="{{ . }}" alt="featured image" class="lazyload">
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
|
@ -65,14 +66,8 @@
|
|||
|
||||
<div class="post-content">
|
||||
{{ $content := .Content }}
|
||||
{{ $REin := `<img src="([^"]+)" alt="([^"]+)?" />` }}
|
||||
{{ $REout := "<figure><img src=/images/loading.svg data-sizes=auto data-src=$1 alt=$2 class=lazyload><figcaption class=image-caption>$2</figcaption></figure>" }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<img src="([^"]+)" alt="([^"]+)?" title="([^"]+)?" />` }}
|
||||
{{ $REout = "<figure><img src=/images/loading.svg data-src=$1 data-sizes=auto alt=$2 title=$3 class=lazyload><figcaption class=image-caption>$2</figcaption></figure>" }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `:\(([\w- ]+?)\):` }}
|
||||
{{ $REout = `<i class="$1 fa-fw"></i>` }}
|
||||
{{ $REin := `:\(([\w- ]+?)\):` }}
|
||||
{{ $REout := `<i class="$1 fa-fw"></i>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `\[(.+?)\]\^\((.+?)\)` }}
|
||||
{{ $REout = `<strong><ruby>$1<rt>$2</rt></ruby></strong>` }}
|
||||
|
@ -80,15 +75,12 @@
|
|||
{{ $REin = `<sup>\[return\]</sup>` }}
|
||||
{{ $REout = printf "<sup>[%s]</sup>" (T "return") }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<(h[123456]) (id=".+?")>` }}
|
||||
{{ $REin = `<(h[23456]) (id=".+?")>` }}
|
||||
{{ $REout = `<a class="post-dummy-target" $2></a><$1>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<(sup class="footnote-ref") (id="fnref:.+?")>` }}
|
||||
{{ $REin = `<(.+) (id="fnref:.+?")>` }}
|
||||
{{ $REout = `<a class="post-dummy-target" $2></a><$1>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $REin = `<(li) (id="fn:.+?")>` }}
|
||||
{{ $REout = `<$1><a class="post-dummy-target" $2></a>` }}
|
||||
{{ $content = replaceRE $REin $REout $content }}
|
||||
{{ $content | safeHTML }}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,34 +1,62 @@
|
|||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<description>Recent content {{ with .Title }}in {{ . }} {{ end }}on {{ .Site.Title }}</description>
|
||||
<title>
|
||||
{{- with .Title }}{{ . }} | {{ end }}{{ .Site.Title -}}
|
||||
</title>
|
||||
<link>
|
||||
{{- .Permalink -}}
|
||||
</link>
|
||||
<description>
|
||||
{{- with .Title }}{{ . }} | {{ end }}{{ .Site.Title -}}
|
||||
</description>
|
||||
<generator>Hugo -- gohugo.io</generator>
|
||||
{{ with .Site.LanguageCode }}
|
||||
<language>{{ . }}</language>
|
||||
{{ end }}
|
||||
{{ with .Site.Author.email }}
|
||||
<managingEditor>{{ . }}{{ with .Site.Author.name }} ({{ . }}){{ end }}</managingEditor>
|
||||
<webMaster>{{ . }}{{ with .Site.Author.name }} ({{ . }}){{ end }}</webMaster>
|
||||
{{ end }}
|
||||
{{ with .Site.Copyright }}
|
||||
<copyright>{{ . }}</copyright>
|
||||
{{ end }}
|
||||
{{ if not .Date.IsZero }}
|
||||
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>
|
||||
{{ end }}
|
||||
{{- with .Site.LanguageCode -}}
|
||||
<language>
|
||||
{{- . -}}
|
||||
</language>
|
||||
{{- end -}}
|
||||
{{- with .Site.Author.email -}}
|
||||
<managingEditor>
|
||||
{{- . }}{{ with .Site.Author.name }} ({{ . }}){{ end -}}
|
||||
</managingEditor>
|
||||
<webMaster>
|
||||
{{- . }}{{ with .Site.Author.name }} ({{ . }}){{ end -}}
|
||||
</webMaster>
|
||||
{{- end -}}
|
||||
{{- with .Site.Copyright -}}
|
||||
<copyright>
|
||||
{{- . -}}
|
||||
</copyright>
|
||||
{{- end -}}
|
||||
{{- if not .Date.IsZero -}}
|
||||
<lastBuildDate>
|
||||
{{- .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML -}}
|
||||
</lastBuildDate>
|
||||
{{- end -}}
|
||||
<atom:link href="{{.Permalink}}" rel="self" type="application/rss+xml" />
|
||||
{{ range first 15 (where .Data.Pages "Type" "!=" "home") }}
|
||||
{{- range first 15 (where .Data.Pages "Type" "!=" "home") -}}
|
||||
<item>
|
||||
<title>{{ .Title }}</title>
|
||||
<link>{{ .Permalink }}</link>
|
||||
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
||||
{{ with .Site.Author.email }}
|
||||
<author>{{ . }}{{ with .Site.Author.name }} ({{ . }}){{ end }}</author>
|
||||
{{ end }}
|
||||
<guid>{{ .Permalink }}</guid>
|
||||
<description>{{ .Content | html }}</description>
|
||||
<title>
|
||||
{{- .Title -}}
|
||||
</title>
|
||||
<link>
|
||||
{{- .Permalink -}}
|
||||
</link>
|
||||
<pubDate>
|
||||
{{- .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML -}}
|
||||
</pubDate>
|
||||
{{- with .Site.Author.email -}}
|
||||
<author>
|
||||
{{- . }}{{ with .Site.Author.name }} ({{ . }}){{ end -}}
|
||||
</author>
|
||||
{{- end -}}
|
||||
<guid>
|
||||
{{- .Permalink -}}
|
||||
</guid>
|
||||
<description>
|
||||
{{- .Content | html -}}
|
||||
</description>
|
||||
</item>
|
||||
{{ end }}
|
||||
{{- end -}}
|
||||
</channel>
|
||||
</rss>
|
||||
</rss>
|
|
@ -20,7 +20,7 @@
|
|||
<!-- fix "<br />" location error which is a bug of Typeit HTML parser -->
|
||||
{{ $content = replaceRE `<br /></span>` "</span><br />" $content }}
|
||||
<div id={{ printf "r%s" $id }} hidden=true>{{ $content | safeHTML }}</div>
|
||||
<div class="code" id={{ $id }}></div>
|
||||
<div class="highlight" id={{ $id }}></div>
|
||||
{{ else }}
|
||||
{{ $tag := .Get "tag" | default "p" }}
|
||||
{{ $content = $content | markdownify | chomp }}
|
||||
|
|
|
@ -1,22 +1,41 @@
|
|||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
|
||||
{{ range (where .Data.Pages "Section" "!=" "gallery") }}
|
||||
<urlset
|
||||
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
||||
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
||||
>
|
||||
{{- range (where .Data.Pages "Section" "!=" "gallery") -}}
|
||||
<url>
|
||||
<loc>{{ .Permalink }}</loc>
|
||||
{{ if not .Lastmod.IsZero }}
|
||||
<lastmod>{{ safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) }}</lastmod>
|
||||
{{ end }}
|
||||
{{ with .Sitemap.ChangeFreq }}
|
||||
<changefreq>{{ . }}</changefreq>
|
||||
{{ end }}
|
||||
{{ if ge .Sitemap.Priority 0.0 }}
|
||||
<priority>{{ .Sitemap.Priority }}</priority>
|
||||
{{ end }}
|
||||
{{ if .IsTranslated }}
|
||||
{{ range .Translations }}
|
||||
<xhtml:link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}"/>
|
||||
{{ end }}
|
||||
<xhtml:link rel="alternate" hreflang="{{ .Lang }}" href="{{ .Permalink }}"/>
|
||||
{{ end }}
|
||||
<loc>
|
||||
{{- .Permalink -}}
|
||||
</loc>
|
||||
{{- if not .Lastmod.IsZero -}}
|
||||
<lastmod>
|
||||
{{- safeHTML ( .Lastmod.Format "2006-01-02T15:04:05-07:00" ) -}}
|
||||
</lastmod>
|
||||
{{- end -}}
|
||||
{{- with .Sitemap.ChangeFreq -}}
|
||||
<changefreq>
|
||||
{{- . -}}
|
||||
</changefreq>
|
||||
{{- end -}}
|
||||
{{- if ge .Sitemap.Priority 0.0 -}}
|
||||
<priority>
|
||||
{{- .Sitemap.Priority -}}
|
||||
</priority>
|
||||
{{- end -}}
|
||||
{{- if .IsTranslated -}}
|
||||
{{- range .Translations -}}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Lang }}"
|
||||
href="{{ .Permalink }}"
|
||||
/>
|
||||
{{- end -}}
|
||||
<xhtml:link
|
||||
rel="alternate"
|
||||
hreflang="{{ .Lang }}"
|
||||
href="{{ .Permalink }}"
|
||||
/>
|
||||
{{- end -}}
|
||||
</url>
|
||||
{{ end }}
|
||||
</urlset>
|
||||
{{- end -}}
|
||||
</urlset>
|
|
@ -1,7 +1,7 @@
|
|||
{{ define "title" }}{{ .Title }} | {{ T .Data.Singular | default (humanize .Data.Singular) }} | {{ .Site.Title }}{{ end }}
|
||||
|
||||
{{ define "content" }}
|
||||
<div class="post-warp archive">
|
||||
<div class="warpper archive">
|
||||
<h2 class="post-title animated pulse faster">
|
||||
{{ $taxonomy := .Data.Singular }}
|
||||
{{ if eq $taxonomy "category" }}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
{{ $terms := .Data.Terms.ByCount }}
|
||||
{{ $type := .Type }}
|
||||
|
||||
<div class="post-warp archive">
|
||||
<div class="warpper archive">
|
||||
<h2 class="post-title animated pulse faster">
|
||||
{{ T "all" | humanize}}{{ T $taxonomies | default $taxonomies | humanize }}
|
||||
</h2>
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue