🎉 initial commit

This commit is contained in:
Covey 2018-09-13 00:14:09 +08:00
commit 84c7107039
66 changed files with 4582 additions and 0 deletions

20
LICENSE Normal file
View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2018 LIUZHICHAO.COM
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

20
LICENSE.md Normal file
View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2018 LIUZHICHAO.COM
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

98
README.md Normal file
View File

@ -0,0 +1,98 @@
LeaveIt Hugo Theme
========================
LeaveIt Hugo Theme
========================
LeaveIt is a clean, elegant, simple but not simpler blog theme for Hugo.
![hugo-theme-LeaveIt](https://raw.githubusercontent.com/liuzc/LeaveIt/master/images/screenshot.png)
# Demo
To see this theme in action, Here is a live [demo site](https://liuzhichao.com) which is rendered with this theme and some content for documentation and blog posts.
[中文说明](https://liuzhichao.com/2018/hugo-theme-leaveit/)
# Features
* Dark/Light mode
* Wrap Image with Figure Tag without Shortcode. Thanks [Junian.Net](https://www.junian.net/hugo-image-figure-wrap/)
* Load images with Lazy Load By [lazysizes](https://github.com/aFarkas/lazysizes)
* Automatically highlighting code By [Google code-prettify](https://github.com/google/code-prettify), Customizable styles via CSS. See the [themes gallery](https://rawgit.com/google/code-prettify/master/styles/index.html).
* Automagical image gallery with [lightGallery](https://github.com/sachinchoolur/lightGallery)
* ...
# Getting Started
Clone this repository to your hugo theme directory.
```bash
cd themes
git clone https://github.com/liuzc/LeaveIt.git
```
Next, open config.toml in the base of the Hugo site and ensure the theme option is set to mainroad:
```bash
theme = "LeaveIt"
```
For more information read the official setup guide of Hugo.
# Site Configuration
Take a look in the `exampleSite` folder.
This directory contains an example config file and the content for the demo. It serves as an example setup for your documentation.
Copy the config.toml in the root directory of your website. Overwrite the existing config file if necessary.
# Content Suggestions
A few suggestions to help you get a good looking site quickly:
* Keep blog posts in the content/posts directory, for example: content/posts/my-first-post.md
* Keep static pages in the content directory, for example: content/about.md
* Keep media like images in the static directory, for example: static/images/2016/10/screenshot.png
# Customizing styles for your website
If you want to change some styling to fit your own website needs, you can edit them:
* `assets/css/_varibales/default.scss`: You can override the variables in `_variables.scss` to customize the style
* `assets/css/_custom.scss` : You can put your custom css in this file
# Favicons, Browserconfig, Manifest
It is recommended to put your own favicons
* apple-touch-icon.png (180x180)
* favicon-32x32.png (32x32)
* favicon-16x16.png (16x16)
* mstile-150x150.png (150x150)
* android-chrome-192x192.png (192x192)
* android-chrome-512x512.png (512x512)
into `/static`. Theyre easily created via https://realfavicongenerator.net/.
Customize browserconfig.xml and site.webmanifest to set theme-color and background-color for example.
# Tips
Because some functions are only in production mode, So you **need to add a production** environment variables when generating your site.
```bash
HUGO_ENV=production hugo --gc --minify
```
# Questions, ideas, bugs, pull requests?
All feedback is welcome! Head over to the [issue tracker](https://github.com/liuzc/LeaveIt/issues).
# License
Kiss is licensed under the MIT license. Check the LICENSE file for details.
The following resources are included in the theme:
* lazysizes - https://github.com/aFarkas/lazysizes
* lightGallery - https://github.com/sachinchoolur/lightGallery
* code-prettify - https://github.com/google/code-prettify
# Author
[LiuZhichao](https://github.com/liuzc)
# See Also
* [Coder](https://themes.gohugo.io/hugo-coder/)
* [hello-friend](https://themes.gohugo.io/hugo-theme-hello-friend/)

10
archetypes/default.md Normal file
View File

@ -0,0 +1,10 @@
---
title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
categories:
-
tags:
-
featured_image:
---

View File

@ -0,0 +1,147 @@
/** Font **/
/* josefin-sans-regular */
@font-face {
font-family: "Josefin Sans";
font-style: normal;
font-weight: normal;
src: url("//lib.baomitu.com/fonts/josefin-sans/josefin-sans-regular.eot");
/* IE9 Compat Modes */
src: local("Josefin Sans"), local("JosefinSans-Normal"), url("//lib.baomitu.com/fonts/josefin-sans/josefin-sans-regular.eot?#iefix") format("embedded-opentype"), url("//lib.baomitu.com/fonts/josefin-sans/josefin-sans-regular.woff2") format("woff2"), url("//lib.baomitu.com/fonts/josefin-sans/josefin-sans-regular.woff") format("woff"), url("//lib.baomitu.com/fonts/josefin-sans/josefin-sans-regular.ttf") format("truetype"), url("//lib.baomitu.com/fonts/josefin-sans/josefin-sans-regular.svg#JosefinSans") format("svg");
/* Legacy iOS */
}
/* pt-sans-regular */
@font-face {
font-family: "PT Sans";
font-style: normal;
font-weight: normal;
src: url("//lib.baomitu.com/fonts/pt-sans/pt-sans-regular.eot");
/* IE9 Compat Modes */
src: local("PT Sans"), local("PTSans-Normal"), url("//lib.baomitu.com/fonts/pt-sans/pt-sans-regular.eot?#iefix") format("embedded-opentype"), url("//lib.baomitu.com/fonts/pt-sans/pt-sans-regular.woff2") format("woff2"), url("//lib.baomitu.com/fonts/pt-sans/pt-sans-regular.woff") format("woff"), url("//lib.baomitu.com/fonts/pt-sans/pt-sans-regular.ttf") format("truetype"), url("//lib.baomitu.com/fonts/pt-sans/pt-sans-regular.svg#PTSans") format("svg");
/* Legacy iOS */
}
html {
&::-webkit-scrollbar {
width: 8px;
height: 8px;
}
&::-webkit-scrollbar-thumb {
height: 40px;
background-color: #eee;
border-radius: 16px;
&:hover {
background-color: #ddd;
}
}
}
::selection {
background: rgba(0, 149, 255, 0.1);
}
html {
font-family: "Josefin Sans", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", STHeiti, "Microsoft Yahei", "WenQuanYi Micro Hei", Arial, Verdana, sans-serif;
}
body {
font-size: 11pt;
font-weight: 400;
line-height: 2em;
background-color: $light-background-color;
color: $light-font-color;
&:before {
content: "";
background-repeat: no-repeat;
background-position: center;
opacity: 0.05;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
-webkit-filter: grayscale(100%);
-moz-filter: grayscale(100%);
-ms-filter: grayscale(100%);
-o-filter: grayscale(100%);
filter: grayscale(100%);
filter: gray;
}
&.dark-theme {
background-color: $dark-background-color;
color: $dark-font-color;
}
}
a {
color: $light-global-link-color;
text-decoration: none;
transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
&:hover {
color: $light-global-link-hover-color;
text-decoration: none;
transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}
.dark-theme & {
color: $dark-global-link-color;
text-decoration: none;
transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
&:hover{
color: $dark-global-link-hover-color;
text-decoration: none;
transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}
}
}
blockquote {
font-size: 1rem;
display: block;
border-width: 1px 0;
border-style: solid;
border-color: $light-border-color;
padding: 1.5em 1.2em 0.5em 1.2em;
margin: 0 0 2em 0;
position: relative;
&:before {
content: '\201C';
position: absolute;
top: 0em;
left: 50%;
transform: translate(-50%, -50%);
background: #fff;
width: 3rem;
height: 2rem;
font: 6em/1.08em 'PT Sans', sans-serif;
color: $light-post-link-color;
text-align: center;
.dark-theme &{
color: $dark-post-link-color;
}
}
&:after {
content: "#blockquote" attr(cite);
display: block;
text-align: right;
font-size: 0.875em;
color: $light-post-link-color;
.dark-theme &{
color: $dark-post-link-color;
}
}
.dark-theme & {
border-color: $dark-border-color;
}
}

View File

@ -0,0 +1,43 @@
/** Layout **/
.wrapper {
display: flex;
flex-direction: column;
min-height: 100vh;
width: 100%;
}
.navbar {
height: 4rem;
line-height: 4rem;
width: 100%;
.container {
width: auto;
max-width: 1200px;
text-align: center;
margin: 0 auto;
}
}
.main {
flex: 1 0 auto;
}
.container{
padding-left: 1em;
padding-right: 1em;
}
.footer {
height: 4rem;
width: 100%;
text-align: center;
line-height: 4rem;
}
.notfound {
font-size: 2em;
transform: translateY(35vh);
text-align: center;
}

View File

@ -0,0 +1,27 @@
@media (max-width: 767px) {
.archive-item-date{
display: none;
}
.footer {
height: 3rem;
width: 100%;
text-align: center;
line-height: 1.5rem;
}
#dynamic-to-top{
bottom: 3em;
right: 4em;
}
.post-warp {
.categories-card {
.card-item {
width: 95%;
}
}
}
}

356
assets/css/_common/_core/normalize.scss vendored Normal file
View File

@ -0,0 +1,356 @@
/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */
/* Document
========================================================================== */
/**
* 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 */
}
/* Sections
========================================================================== */
/**
* Remove the margin in all browsers.
*/
html,
body,
main,
div,
span,
a,
li,
ul,
hr,
h1,
h2,
h3,
h4 {
padding: 0;
margin: 0;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/* Grouping content
========================================================================== */
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/**
* 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 */
font-size: 1em; /* 2 */
}
/* Text-level semantics
========================================================================== */
/**
* 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.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* 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.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -0.25em;
}
sup {
top: -0.5em;
}
/* Embedded content
========================================================================== */
/**
* 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.
*/
button,
input,
optgroup,
select,
textarea {
font-family: inherit; /* 1 */
font-size: 100%; /* 1 */
line-height: 1.15; /* 1 */
margin: 0; /* 2 */
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input {
/* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select {
/* 1 */
text-transform: none;
}
/**
* Correct the inability to style clickable types in iOS and Safari.
*/
button,
[type="button"],
[type="reset"],
[type="submit"] {
-webkit-appearance: button;
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* 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.
*/
legend {
box-sizing: border-box; /* 1 */
color: inherit; /* 2 */
display: table; /* 1 */
max-width: 100%; /* 1 */
padding: 0; /* 3 */
white-space: normal; /* 1 */
}
/**
* Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
vertical-align: baseline;
}
/**
* 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.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* 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.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
/* Interactive
========================================================================== */
/*
* Add the correct display in Edge, IE 10+, and Firefox.
*/
details {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Misc
========================================================================== */
/**
* Add the correct display in IE 10+.
*/
template {
display: none;
}
/**
* Add the correct display in IE 10.
*/
[hidden] {
display: none;
}

View File

@ -0,0 +1,54 @@
/** Home **/
.intro {
transform: translateY(25vh);
text-align: center;
.avatar {
padding: 10px;
img {
width: 128px;
height: auto;
display: inline-block;
-webkit-border-radius: 100%;
border-radius: 100%;
-webkit-box-shadow: 0 0 0 0.3618em rgba(0, 0, 0, 0.05);
box-shadow: 0 0 0 0.3618em rgba(0, 0, 0, 0.05);
margin: 0 auto;
-webkit-transition: all ease 0.4s;
-moz-transition: all ease 0.4s;
-o-transition: all ease 0.4s;
transition: all ease 0.4s;
cursor: pointer;
&:hover {
position: relative;
-webkit-transform: translateY(-0.75em);
-moz-transform: translateY(-0.75em);
-ms-transform: translateY(-0.75em);
-o-transform: translateY(-0.75em);
transform: translateY(-0.75em);
cursor: pointer;
}
}
}
}
h2.description {
font-size: 1em;
font-weight: normal;
padding: 5px;
}
.social-links {
a {
padding: 0 5px;
&:hover {
background-color: transparent;
}
}
.iconfont {
font-size: 2em;
}
}

View File

@ -0,0 +1,236 @@
/** Post **/
.post-warp {
position: relative;
width: 100%;
max-width: 780px;
margin: 0 auto;
padding-top: 2rem;
.post-header h1 {
margin: 0 !important;
}
.post-title {
font-size: 2em;
line-height: 1.5em;
}
.post-meta {
color: rgba(85, 85, 85, 0.52941) !important;
.dark-theme & {
color: $dark-font-secondary-color !important;
}
a {
color: $light-post-link-color;
.dark-theme & {
color: $dark-post-link-color;
}
&:hover {
color: $light-post-link-hover-color;
.dark-theme & {
color: $dark-post-link-hover-color;
}
}
}
}
.post-content {
padding-top: 2rem;
h2,
h3,
h4,
h5,
h6 {
padding-top: .8em;
padding-bottom: .3em;
}
h2::before {
content: "#";
margin-right: 5px;
color: $light-post-link-color;
.dark-theme & {
color: $dark-post-link-color;
}
}
h3::before {
content: "|";
margin-right: 5px;
color: $light-post-link-color;
.dark-theme & {
color: $dark-post-link-color;
}
}
a {
color: $light-post-link-color;
.dark-theme & {
color: $dark-post-link-color;
}
}
a:hover {
color: $light-post-link-hover-color;
.dark-theme &:hover {
color: $dark-post-link-hover-color;
font-weight: bold;
text-decoration: underline;
}
}
code,
pre {
padding: 7px;
font-size: 13px;
font-family: Consolas, Monaco, Menlo, Consolas, monospace;
word-break: break-all;
word-wrap: break-word;
}
code:not([class]) {
padding: 5px 5px;
background: #fff;
border: 1px solid #ddd;
box-shadow: 1px 1px 0 #fff, 2px 2px 0 #ddd;
margin-left: 3px;
margin-right: 3px;
.dark-theme &:not([class]) {
background: transparent;
box-shadow: 1px 1px 0 $dark-font-secondary-color, 2px 2px 0 $dark-font-secondary-color;
}
}
ul {
padding-left: 2em;
}
table {
max-width: 100%;
margin: 10px 0;
border-spacing: 0;
box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.125);
th,
td {
padding: 5px 15px;
border: 1px double #ebe9f5;
}
}
figure {
text-align: center;
img:hover{
cursor: zoom-in;
}
}
.image-caption:not(:empty) {
min-width: 20%;
max-width: 80%;
display: inline-block;
padding: 10px;
margin: 0 auto;
border-bottom: 1px solid #d9d9d9;
font-size: 14px;
color: #969696;
line-height: 1.7;
}
img {
display: block;
max-width: 80%;
height: auto;
margin: 0 auto;
overflow: hidden;
}
img[data-action="zoom"] {
cursor: zoom-in;
}
.featured_image {
width: 100% !important;
max-width: 100% !important;
height: auto !important;
margin: 0 !important;
}
}
p {
font-size: 1em;
margin: .5em 0 .5em 0;
}
.post-copyright {
margin-top: 5rem;
border-top: 1px solid $light-border-color;
border-bottom: 1px solid $light-border-color;
.copyright-item {
margin: 5px 0;
}
.lincese {
font-weight: bold;
& a {}
}
.dark-theme & {
border-top: 1px solid $dark-border-color;
border-bottom: 1px solid $dark-border-color;
}
}
.post-tags {
padding: 1rem 0 1rem;
}
.post-nav {
margin: 2rem 0;
&:before,
&:after {
content: " ";
display: table;
}
& a.prev,
& a.next {
font-weight: 600;
font-size: 16px;
transition-property: transform;
transition-timing-function: ease-out;
transition-duration: 0.3s;
}
& a.prev {
float: left;
}
& a.prev:hover {
transform: translateX(-4px);
}
& a.next {
float: right;
}
& a.next:hover {
transform: translateX(4px);
}
}
.tag:not(:last-child) a::after {
content: " / ";
}
}

View File

@ -0,0 +1,32 @@
.tag-cloud-tags {
margin: 10px 0;
a {
display: inline-block;
position: relative;
margin: 5px 10px;
word-wrap: break-word;
transition-duration: .3s;
transition-property: transform;
transition-timing-function: ease-out;
&:active,
&:focus,
&:hover {
color: $light-global-link-hover-color;
transform: scale(1.1);
.dark-theme &{
color: $dark-global-link-hover-color;
}
}
small {
color: $light-font-secondary-color;
.dark-theme &{
color: $dark-global-link-hover-color;
}
}
}
}

View File

@ -0,0 +1,82 @@
.post-warp {
.archive-item {
margin-left: 2rem;
}
.categories-card {
margin: 0 auto;
margin-top: 3em;
display: flex;
align-items: center;
justify-content: space-between;
flex-direction: row;
flex-wrap: wrap;
padding: 0 2.5em;
line-height: 1.6em;
.card-item {
font-size: 14px;
text-align: left;
width: 45%;
display: flex;
align-items: flex-start;
margin-top:2em;
min-height: 16em;
padding: 0 2%;
position: relative;
.categories{
overflow: hidden;
}
}
}
.archive-item-link {
display: inline-block;
text-decoration: none;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 95%;
&:hover {
color: $light-global-link-hover-color;
background-color: transparent;
}
.dark-theme & {
color: $dark-global-link-color;
text-decoration: none;
transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
&:hover {
color: $dark-global-link-hover-color;
text-decoration: none;
transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}
}
}
.archive-item-date {
float: right;
text-align: right;
color: $light-font-secondary-color;
.dark-theme & {
color: $dark-font-secondary-color;
}
}
.more-post {
text-align: right;
}
}
.categories {
h3 {
display: inline-block;
}
span {
float: right;
padding-right: 1em;
}
}

View File

@ -0,0 +1,64 @@
/*! Color themes for Google Code Prettify | MIT License | github.com/jmblog/color-themes-for-google-code-prettify */
.prettyprint {
background: #2d2d2d;
font-family: Menlo,Bitstream Vera Sans Mono,DejaVu Sans Mono,Monaco,Consolas,monospace;
border: 0 !important;
}
.pln {
color: #ccc;
}
ol.linenums {
margin-top: 0;
margin-bottom: 0;
color: #999;
}
li {
&.L0, &.L1, &.L2, &.L3, &.L4, &.L5, &.L6, &.L7, &.L8, &.L9 {
padding-left: 1em;
background-color: #2d2d2d;
list-style-type: decimal;
}
}
@media screen {
.str {
color: #9c9;
}
.kwd {
color: #c9c;
}
.com {
color: #999;
}
.typ {
color: #69c;
}
.lit {
color: #f99157;
}
.pun, .opn, .clo {
color: #ccc;
}
.tag {
color: #f2777a;
}
.atn {
color: #f99157;
}
.atv {
color: #6cc;
}
.dec {
color: #f99157;
}
.var {
color: #f2777a;
}
.fun {
color: #69c;
}
}

View File

@ -0,0 +1,49 @@
/**Footer**/
.copyright {
font-size: 14px;
}
#dynamic-to-top {
display: none;
overflow: hidden;
width: auto;
z-index: 90;
position: fixed;
bottom: 2em;
right: 2em;
top: auto;
left: auto;
font-family: sans-serif;
font-size: 1em;
color: #fff;
text-decoration: none;
text-shadow: 0 1px 0 #333;
font-weight: bold;
padding: 17px 16px;
border: 1px solid $light-border-color;
background: #222;
&:hover {
background: #000;
cursor: pointer;
}
&:active {
background: #000;
outline: none;
}
outline: none;
&:focus, &:hover {
outline: none;
}
span {
display: block;
overflow: hidden;
width: 14px;
height: 12px;
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAKCAYAAACE2W/HAAAACXBIWXMAAArwAAAK8AFCrDSYAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAgY0hSTQAAeiUAAICDAAD5/wAAgOkAAHUwAADqYAAAOpgAABdvkl/FRgAAAKVJREFUeNqUz7ENgzAURdErUSXQMgdTZJFIqeg8DFI2YQeEvAEbUJja3y9NEiwCUXIlN/62jww7Saok3Z+r4pckXSRNWpskXb5deClHfeo7ylGrLqnbTmOMs/e+9d63McZ554GOlFLId0IIvXOuAUqgdM41IYQ+P5NSCpjZkitADRTZTwqgznUzWzCzZaMc9dbNbGEYhuuOclQB1OM43gBO/N/5MQAeMwpyB1MtLQAAAABJRU5ErkJggg==') no-repeat center center;
}
.dark-theme &{
border: 1px solid $dark-border-color;
}
}

View File

@ -0,0 +1,36 @@
.navbar-header {
float: left;
}
.header-logo a{
padding: 0 ;
i{
line-height: 2em;
}
}
.navbar-right {
float: right !important;
margin-right: -15px;
}
.navbar .menu a {
padding: 0 8px;
}
.navbar .menu .active{
font-weight: 900;
color: $light-navbar-active-color;
.dark-theme &{
color: $dark-navbar-active-color;
}
}
.navbar-header a:hover, .navbar .menu a:hover {
background-color: transparent;
}

View File

@ -0,0 +1,83 @@
/** pagination **/
.pagination {
display: flex;
flex-direction: row;
justify-content: center;
list-style: none;
white-space: nowrap;
width: 100%;
padding-top: 2em;
a {
-webkit-font-smoothing: antialiased;
font-size: 12px;
color: #bfbfbf;
letter-spacing: 0.1em;
font-weight: 700;
padding: 5px 5px;
text-decoration: none;
transition: 0.3s;
}
li {
padding-bottom: 3px;
margin: 0 20px;
box-sizing: border-box;
position: relative;
display: inline;
&.disabled {
display: none;
}
&:hover a {
color: $light-pagination-link-active-color;
}
.dark-theme &:hover a {
color: $dark-pagination-link-active-color;
}
&:before,
&:after {
position: absolute;
content: "";
width: 0;
height: 3px;
background: $light-pagination-link-active-color;
transition: 0.3s;
bottom: 0px;
}
.dark-theme &:before,
.dark-theme &:after{
background: $dark-pagination-link-active-color;
}
&:before .active,
&:after .active {
width: 100%;
}
&:before {
left: 50%;
}
&:after {
right: 50%;
}
&:hover {
&:before,
&:after {
width: 50%;
}
}
&.active {
a {
color: $light-pagination-link-active-color;
}
.dark-theme & a {
color: $dark-pagination-link-active-color;
}
&:before,
&:after {
width: 60%;
}
}
}
}

4
assets/css/_custom.scss Normal file
View File

@ -0,0 +1,4 @@
// ==============================
// Custom style
// ==============================
// You can override the variables in _variables.scss to customize the style

View File

@ -0,0 +1,41 @@
/** light theme **/
$light-background-color: #fff;
$light-font-color: #161209;
$light-font-secondary-color: #a9a9b3;
$light-navbar-active-color: #161209;
$light-global-link-color: #161209;
$light-global-link-hover-color:#2d96bd;
$light-post-link-color: #2d96bd;
$light-post-link-hover-color:#ef3982;
$light-pagination-link-color : #2d96bd;
$light-pagination-link-active-color: #000;
$light-border-color: #dcdcdc;
/** dark theme **/
$dark-background-color: #292a2d;
$dark-font-color: #a9a9b3;
$dark-font-secondary-color: #87878d;
$dark-navbar-active-color: #fff;
$dark-global-link-color: #a9a9b3;
$dark-global-link-hover-color:#fff;
$dark-post-link-color: #eee;
$dark-post-link-hover-color:#fff;
$dark-pagination-link-color : #a9a9b3;
$dark-pagination-link-active-color: #fff;
$dark-border-color: #4a4b50;

22
assets/css/main.scss Normal file
View File

@ -0,0 +1,22 @@
@import "_variables/default.scss";
@import "_common/_core/normalize.scss";
@import "_common/_core/base.scss";
@import "_common/_core/layout.scss";
@import "_common/_page/home.scss";
@import "_common/_page/terms.scss";
@import "_common/_page/post.scss";
@import "_common/_page/tags.scss";
@import "_common/_section/navbar.scss";
@import "_common/_section/footer.scss";
@import "_common/_section/pagination.scss";
@import "_common/_prettyprint/default.scss";
@import "_common/_core/media.scss";
@import "custom"

13
assets/js/dynamic.to.top.min.js vendored Executable file
View File

@ -0,0 +1,13 @@
/*
* Dynamic To Top Plugin
* http://www.mattvarone.com
*
* By Matt Varone
* @sksmatt
*
*/
var mv_dynamic_to_top = {"text":"0","version":"0","min":"200","speed":"1000","easing":"easeInOutExpo","margin":"20"};
(function($,mv_dynamic_to_top){jQuery.fn.DynamicToTop=function(options){var defaults={text:mv_dynamic_to_top.text,min:parseInt(mv_dynamic_to_top.min,10),fade_in:600,fade_out:400,speed:parseInt(mv_dynamic_to_top.speed,10),easing:mv_dynamic_to_top.easing,version:mv_dynamic_to_top.version,id:'dynamic-to-top'},settings=$.extend(defaults,options);if(settings.version===""||settings.version==='0'){settings.text='<span>&nbsp;</span>';}
if(!$.isFunction(settings.easing)){settings.easing='linear';}
var $toTop=$('<a href=\"#\" id=\"'+settings.id+'\"></a>').html(settings.text);$toTop.hide().appendTo('body').click(function(){$('html, body').stop().animate({scrollTop:0},settings.speed,settings.easing);return false;});$(window).scroll(function(){var sd=jQuery(window).scrollTop();if(typeof document.body.style.maxHeight==="undefined"){$toTop.css({'position':'absolute','top':sd+$(window).height()-mv_dynamic_to_top.margin});}
if(sd>settings.min){$toTop.fadeIn(settings.fade_in);}else{$toTop.fadeOut(settings.fade_out);}});};$('body').DynamicToTop();})(jQuery,mv_dynamic_to_top);

2
assets/js/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

2
assets/js/lazysizes.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,52 @@
$(document).ready(function() {
let items = [];
$('.post-content figure').each(function() {
if ($(this).attr('class') == 'gallery-ignore') return true; // ignore any figures where class="pswp-ignore"
// get properties from child a/img/figcaption elements,
let $figure = $(this),
$img = $figure.find('img'),
$src = $img.attr('data-src'),
$title = $figure.find('figcaption').html();
if ($img.data('size')) {
let $size = $a.data('size').split('x');
var item = {
'src': $src,
'thumb': $src,
'subHtml': $title,
'width': $size[0],
'height': $size[1]
}
}else{
var item = {
'src': $src,
'thumb': $src,
'subHtml': $title
}
var img = new Image();
img.src = $src;
var wait = setInterval(function() {
var w = img.naturalWidth,
h = img.naturalHeight;
if (w && h) {
clearInterval(wait);
item.width = w;
item.height = h;
}
}, 30);
}
items.push(item);
// console.log(item)
$figure.on('click', function(event) {
event.preventDefault();
$(this).lightGallery({
dynamic: true,
download: false,
showThumbByDefault: false,
dynamicEl: items
})
});
});
});

5
assets/js/lightgallery-all.min.js vendored Normal file

File diff suppressed because one or more lines are too long

34
assets/js/main.js Normal file
View File

@ -0,0 +1,34 @@
(function(){
'use strict';
var _Blog = window._Blog || {};
_Blog.changeTitle = function() {
var currentTitle = document.title;
window.onblur = function() {
document.title = 'I miss you!';
}
window.onfocus = function() {
document.title = currentTitle;
}
};
_Blog.toggleTheme = function() {
const currentTheme = window.localStorage && window.localStorage.getItem('theme')
const themeSwitchEL = document.querySelector('.theme-switch')
const isDark = currentTheme === 'dark'
document.body.classList.toggle('dark-theme', isDark)
themeSwitchEL.addEventListener('click', () => {
document.body.classList.toggle('dark-theme')
window.localStorage &&
window.localStorage.setItem(
'theme',
document.body.classList.contains('dark-theme') ? 'dark' : 'light',
)
})
}
_Blog.toggleTheme()
_Blog.changeTitle()
}());

24
assets/js/page.js Normal file
View File

@ -0,0 +1,24 @@
jQuery(function($) {
'use strict';
var _Blog = window._Blog || {};
_Blog.prettify = function() {
$('pre').addClass('prettyprint linenums').attr('style', 'overflow:auto;');
window.prettyPrint && prettyPrint();
};
_Blog.externalUrl = function() {
$.expr[':'].external = function(obj) {
return !obj.href.match(/^mailto\:/) &&
(obj.hostname != location.hostname);
};
$('a:external').addClass('external');
$(".external").attr('target', '_blank');
}
$(document).ready(function() {
_Blog.prettify();
});
});

1
assets/js/prettify.min.js vendored Normal file

File diff suppressed because one or more lines are too long

69
exampleSite/config.toml Normal file
View File

@ -0,0 +1,69 @@
baseURL = "https://liuzhichao.com/"
languageCode = "zh-CN"
title = "柳志超博客"
theme = "LeaveIt"
paginate = 12
enableEmoji = true
enableRobotsTXT = true
googleAnalytics = ""
preserveTaxonomyNames = true
[blackfriday]
hrefTargetBlank = true
nofollowLinks = true
noreferrerLinks = true
[Permalinks]
posts = "/:year/:filename/"
[menu]
[[menu.main]]
name = "Blog"
url = "/posts/"
weight = 1
[[menu.main]]
name = "Categories"
url = "/categories/"
weight = 2
[[menu.main]]
name = "Tags"
url = "/tags/"
weight = 3
[[menu.main]]
name = "About"
url = "/about/"
weight = 4
[params]
since = 2011
author = "柳志超" # Author's name
avatar = "/images/me/avatar.jpg" # Author's avatar
subtitle = "我会更好,因为我没有停止" # Subtitle
cdn_url = "" # Base CDN URL
google_verification = ""
description = "柳志超个人博客" # site description
keywords = "柳志超,柳志超博客" # site keywords
beian = ""
baiduAnalytics = ""
license= '本文采用<a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/" target="_blank">知识共享署名-非商业性使用 4.0 国际许可协议</a>进行许可'
[params.social]
GitHub = "xxoo"
Twitter = "xxoo"
Email = "xxoo"
Instagram = "xxoo"
Wechat = "/images/me/wechat.jpeg" # Wechat QRcode image
Facebook = "xxoo"
Telegram = "xxoo"
Dribbble = "xxoo"
Medium = "xxoo"

View File

@ -0,0 +1,18 @@
+++
title = "About Hugo"
date = "2014-04-09"
menu = "main"
+++
Hugo is the **worlds fastest framework for building websites**. It is written in Go.
It makes use of a variety of open source projects including:
* https://github.com/russross/blackfriday
* https://github.com/alecthomas/chroma
* https://github.com/muesli/smartcrop
* https://github.com/spf13/cobra
* https://github.com/spf13/viper
Learn more and contribute on [GitHub](https://github.com/gohugoio).

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,332 @@
---
title: (Hu)go Template Primer
tags: ["go", "golang", "templates", "themes", "development"]
date: 2014-07-28
---
Hugo uses the excellent [go][] [html/template][gohtmltemplate] library for
its template engine. It is an extremely lightweight engine that provides a very
small amount of logic. In our experience that it is just the right amount of
logic to be able to create a good static website. If you have used other
template systems from different languages or frameworks you will find a lot of
similarities in go templates.
This document is a brief primer on using go templates. The [go docs][gohtmltemplate]
provide more details.
## Introduction to Go Templates
Go templates provide an extremely simple template language. It adheres to the
belief that only the most basic of logic belongs in the template or view layer.
One consequence of this simplicity is that go templates parse very quickly.
A unique characteristic of go templates is they are content aware. Variables and
content will be sanitized depending on the context of where they are used. More
details can be found in the [go docs][gohtmltemplate].
## Basic Syntax
Go lang templates are html files with the addition of variables and
functions.
**Go variables and functions are accessible within {{ }}**
Accessing a predefined variable "foo":
{{ foo }}
**Parameters are separated using spaces**
Calling the add function with input of 1, 2:
{{ add 1 2 }}
**Methods and fields are accessed via dot notation**
Accessing the Page Parameter "bar"
{{ .Params.bar }}
**Parentheses can be used to group items together**
{{ if or (isset .Params "alt") (isset .Params "caption") }} Caption {{ end }}
## Variables
Each go template has a struct (object) made available to it. In hugo each
template is passed either a page or a node struct depending on which type of
page you are rendering. More details are available on the
[variables](/layout/variables) page.
A variable is accessed by referencing the variable name.
<title>{{ .Title }}</title>
Variables can also be defined and referenced.
{{ $address := "123 Main St."}}
{{ $address }}
## Functions
Go template ship with a few functions which provide basic functionality. The go
template system also provides a mechanism for applications to extend the
available functions with their own. [Hugo template
functions](/layout/functions) provide some additional functionality we believe
are useful for building websites. Functions are called by using their name
followed by the required parameters separated by spaces. Template
functions cannot be added without recompiling hugo.
**Example:**
{{ add 1 2 }}
## Includes
When including another template you will pass to it the data it will be
able to access. To pass along the current context please remember to
include a trailing dot. The templates location will always be starting at
the /layout/ directory within Hugo.
**Example:**
{{ template "chrome/header.html" . }}
## Logic
Go templates provide the most basic iteration and conditional logic.
### Iteration
Just like in go, the go templates make heavy use of range to iterate over
a map, array or slice. The following are different examples of how to use
range.
**Example 1: Using Context**
{{ range array }}
{{ . }}
{{ end }}
**Example 2: Declaring value variable name**
{{range $element := array}}
{{ $element }}
{{ end }}
**Example 2: Declaring key and value variable name**
{{range $index, $element := array}}
{{ $index }}
{{ $element }}
{{ end }}
### Conditionals
If, else, with, or, & and provide the framework for handling conditional
logic in Go Templates. Like range, each statement is closed with `end`.
Go Templates treat the following values as false:
* false
* 0
* any array, slice, map, or string of length zero
**Example 1: If**
{{ if isset .Params "title" }}<h4>{{ index .Params "title" }}</h4>{{ end }}
**Example 2: If -> Else**
{{ if isset .Params "alt" }}
{{ index .Params "alt" }}
{{else}}
{{ index .Params "caption" }}
{{ end }}
**Example 3: And & Or**
{{ if and (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}}
**Example 4: With**
An alternative way of writing "if" and then referencing the same value
is to use "with" instead. With rebinds the context `.` within its scope,
and skips the block if the variable is absent.
The first example above could be simplified as:
{{ with .Params.title }}<h4>{{ . }}</h4>{{ end }}
**Example 5: If -> Else If**
{{ if isset .Params "alt" }}
{{ index .Params "alt" }}
{{ else if isset .Params "caption" }}
{{ index .Params "caption" }}
{{ end }}
## Pipes
One of the most powerful components of go templates is the ability to
stack actions one after another. This is done by using pipes. Borrowed
from unix pipes, the concept is simple, each pipeline's output becomes the
input of the following pipe.
Because of the very simple syntax of go templates, the pipe is essential
to being able to chain together function calls. One limitation of the
pipes is that they only can work with a single value and that value
becomes the last parameter of the next pipeline.
A few simple examples should help convey how to use the pipe.
**Example 1 :**
{{ if eq 1 1 }} Same {{ end }}
is the same as
{{ eq 1 1 | if }} Same {{ end }}
It does look odd to place the if at the end, but it does provide a good
illustration of how to use the pipes.
**Example 2 :**
{{ index .Params "disqus_url" | html }}
Access the page parameter called "disqus_url" and escape the HTML.
**Example 3 :**
{{ if or (or (isset .Params "title") (isset .Params "caption")) (isset .Params "attr")}}
Stuff Here
{{ end }}
Could be rewritten as
{{ isset .Params "caption" | or isset .Params "title" | or isset .Params "attr" | if }}
Stuff Here
{{ end }}
## Context (aka. the dot)
The most easily overlooked concept to understand about go templates is that {{ . }}
always refers to the current context. In the top level of your template this
will be the data set made available to it. Inside of a iteration it will have
the value of the current item. When inside of a loop the context has changed. .
will no longer refer to the data available to the entire page. If you need to
access this from within the loop you will likely want to set it to a variable
instead of depending on the context.
**Example:**
{{ $title := .Site.Title }}
{{ range .Params.tags }}
<li> <a href="{{ $baseurl }}/tags/{{ . | urlize }}">{{ . }}</a> - {{ $title }} </li>
{{ end }}
Notice how once we have entered the loop the value of {{ . }} has changed. We
have defined a variable outside of the loop so we have access to it from within
the loop.
# Hugo Parameters
Hugo provides the option of passing values to the template language
through the site configuration (for sitewide values), or through the meta
data of each specific piece of content. You can define any values of any
type (supported by your front matter/config format) and use them however
you want to inside of your templates.
## Using Content (page) Parameters
In each piece of content you can provide variables to be used by the
templates. This happens in the [front matter](/content/front-matter).
An example of this is used in this documentation site. Most of the pages
benefit from having the table of contents provided. Sometimes the TOC just
doesn't make a lot of sense. We've defined a variable in our front matter
of some pages to turn off the TOC from being displayed.
Here is the example front matter:
```
---
title: "Permalinks"
date: "2013-11-18"
aliases:
- "/doc/permalinks/"
groups: ["extras"]
groups_weight: 30
notoc: true
---
```
Here is the corresponding code inside of the template:
{{ if not .Params.notoc }}
<div id="toc" class="well col-md-4 col-sm-6">
{{ .TableOfContents }}
</div>
{{ end }}
## Using Site (config) Parameters
In your top-level configuration file (eg, `config.yaml`) you can define site
parameters, which are values which will be available to you in chrome.
For instance, you might declare:
```yaml
params:
CopyrightHTML: "Copyright &#xA9; 2013 John Doe. All Rights Reserved."
TwitterUser: "spf13"
SidebarRecentLimit: 5
```
Within a footer layout, you might then declare a `<footer>` which is only
provided if the `CopyrightHTML` parameter is provided, and if it is given,
you would declare it to be HTML-safe, so that the HTML entity is not escaped
again. This would let you easily update just your top-level config file each
January 1st, instead of hunting through your templates.
```
{{if .Site.Params.CopyrightHTML}}<footer>
<div class="text-center">{{.Site.Params.CopyrightHTML | safeHtml}}</div>
</footer>{{end}}
```
An alternative way of writing the "if" and then referencing the same value
is to use "with" instead. With rebinds the context `.` within its scope,
and skips the block if the variable is absent:
```
{{with .Site.Params.TwitterUser}}<span class="twitter">
<a href="https://twitter.com/{{.}}" rel="author">
<img src="/images/twitter.png" width="48" height="48" title="Twitter: {{.}}"
alt="Twitter"></a>
</span>{{end}}
```
Finally, if you want to pull "magic constants" out of your layouts, you can do
so, such as in this example:
```
<nav class="recent">
<h1>Recent Posts</h1>
<ul>{{range first .Site.Params.SidebarRecentLimit .Site.Recent}}
<li><a href="{{.RelPermalink}}">{{.Title}}</a></li>
{{end}}</ul>
</nav>
```
[go]: <http://golang.org/>
[gohtmltemplate]: <http://golang.org/pkg/html/template/>

View File

@ -0,0 +1,79 @@
---
title: Getting Started with Hugo
cover: "/img/cover.jpg"
tags: ["go", "golang", "hugo", "development"]
date: "2014-04-02"
---
## Step 1. Install Hugo
Goto [hugo releases](https://github.com/spf13/hugo/releases) and download the
appropriate version for your os and architecture.
Save it somewhere specific as we will be using it in the next step.
More complete instructions are available at [installing hugo](/overview/installing/)
## Step 2. Build the Docs
Hugo has its own example site which happens to also be the documentation site
you are reading right now.
Follow the following steps:
1. Clone the [hugo repository](http://github.com/spf13/hugo)
2. Go into the repo
3. Run hugo in server mode and build the docs
4. Open your browser to http://localhost:1313
Corresponding pseudo commands:
git clone https://github.com/spf13/hugo
cd hugo
/path/to/where/you/installed/hugo server --source=./docs
> 29 pages created
> 0 tags index created
> in 27 ms
> Web Server is available at http://localhost:1313
> Press ctrl+c to stop
Once you've gotten here, follow along the rest of this page on your local build.
## Step 3. Change the docs site
Stop the Hugo process by hitting ctrl+c.
Now we are going to run hugo again, but this time with hugo in watch mode.
/path/to/hugo/from/step/1/hugo server --source=./docs --watch
> 29 pages created
> 0 tags index created
> in 27 ms
> Web Server is available at http://localhost:1313
> Watching for changes in /Users/spf13/Code/hugo/docs/content
> Press ctrl+c to stop
Open your [favorite editor](http://vim.spf13.com) and change one of the source
content pages. How about changing this very file to *fix the typo*. How about changing this very file to *fix the typo*.
Content files are found in `docs/content/`. Unless otherwise specified, files
are located at the same relative location as the url, in our case
`docs/content/overview/quickstart.md`.
Change and save this file.. Notice what happened in your terminal.
> Change detected, rebuilding site
> 29 pages created
> 0 tags index created
> in 26 ms
Refresh the browser and observe that the typo is now fixed.
Notice how quick that was. Try to refresh the site before it's finished building.. I double dare you.
Having nearly instant feedback enables you to have your creativity flow without waiting for long builds.
## Step 4. Have fun
The best way to learn something is to play with it.

View File

@ -0,0 +1,150 @@
---
title: Migrate to Hugo from Jekyll
date: 2014-03-10
---
## Move static content to `static`
Jekyll has a rule that any directory not starting with `_` will be copied as-is to the `_site` output. Hugo keeps all static content under `static`. You should therefore move it all there.
With Jekyll, something that looked like
<root>/
▾ images/
logo.png
should become
<root>/
▾ static/
▾ images/
logo.png
Additionally, you'll want any files that should reside at the root (such as `CNAME`) to be moved to `static`.
## Create your Hugo configuration file
Hugo can read your configuration as JSON, YAML or TOML. Hugo supports parameters custom configuration too. Refer to the [Hugo configuration documentation](/overview/configuration/) for details.
## Set your configuration publish folder to `_site`
The default is for Jekyll to publish to `_site` and for Hugo to publish to `public`. If, like me, you have [`_site` mapped to a git submodule on the `gh-pages` branch](http://blog.blindgaenger.net/generate_github_pages_in_a_submodule.html), you'll want to do one of two alternatives:
1. Change your submodule to point to map `gh-pages` to public instead of `_site` (recommended).
git submodule deinit _site
git rm _site
git submodule add -b gh-pages git@github.com:your-username/your-repo.git public
2. Or, change the Hugo configuration to use `_site` instead of `public`.
{
..
"publishdir": "_site",
..
}
## Convert Jekyll templates to Hugo templates
That's the bulk of the work right here. The documentation is your friend. You should refer to [Jekyll's template documentation](http://jekyllrb.com/docs/templates/) if you need to refresh your memory on how you built your blog and [Hugo's template](/layout/templates/) to learn Hugo's way.
As a single reference data point, converting my templates for [heyitsalex.net](http://heyitsalex.net/) took me no more than a few hours.
## Convert Jekyll plugins to Hugo shortcodes
Jekyll has [plugins](http://jekyllrb.com/docs/plugins/); Hugo has [shortcodes](/doc/shortcodes/). It's fairly trivial to do a port.
### Implementation
As an example, I was using a custom [`image_tag`](https://github.com/alexandre-normand/alexandre-normand/blob/74bb12036a71334fdb7dba84e073382fc06908ec/_plugins/image_tag.rb) plugin to generate figures with caption when running Jekyll. As I read about shortcodes, I found Hugo had a nice built-in shortcode that does exactly the same thing.
Jekyll's plugin:
module Jekyll
class ImageTag < Liquid::Tag
@url = nil
@caption = nil
@class = nil
@link = nil
// Patterns
IMAGE_URL_WITH_CLASS_AND_CAPTION =
IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK = /(\w+)(\s+)((https?:\/\/|\/)(\S+))(\s+)"(.*?)"(\s+)->((https?:\/\/|\/)(\S+))(\s*)/i
IMAGE_URL_WITH_CAPTION = /((https?:\/\/|\/)(\S+))(\s+)"(.*?)"/i
IMAGE_URL_WITH_CLASS = /(\w+)(\s+)((https?:\/\/|\/)(\S+))/i
IMAGE_URL = /((https?:\/\/|\/)(\S+))/i
def initialize(tag_name, markup, tokens)
super
if markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION_AND_LINK
@class = $1
@url = $3
@caption = $7
@link = $9
elsif markup =~ IMAGE_URL_WITH_CLASS_AND_CAPTION
@class = $1
@url = $3
@caption = $7
elsif markup =~ IMAGE_URL_WITH_CAPTION
@url = $1
@caption = $5
elsif markup =~ IMAGE_URL_WITH_CLASS
@class = $1
@url = $3
elsif markup =~ IMAGE_URL
@url = $1
end
end
def render(context)
if @class
source = "<figure class='#{@class}'>"
else
source = "<figure>"
end
if @link
source += "<a href=\"#{@link}\">"
end
source += "<img src=\"#{@url}\">"
if @link
source += "</a>"
end
source += "<figcaption>#{@caption}</figcaption>" if @caption
source += "</figure>"
source
end
end
end
Liquid::Template.register_tag('image', Jekyll::ImageTag)
is written as this Hugo shortcode:
<!-- image -->
<figure {{ with .Get "class" }}class="{{.}}"{{ end }}>
{{ with .Get "link"}}<a href="{{.}}">{{ end }}
<img src="{{ .Get "src" }}" {{ if or (.Get "alt") (.Get "caption") }}alt="{{ with .Get "alt"}}{{.}}{{else}}{{ .Get "caption" }}{{ end }}"{{ end }} />
{{ if .Get "link"}}</a>{{ end }}
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr")}}
<figcaption>{{ if isset .Params "title" }}
{{ .Get "title" }}{{ end }}
{{ if or (.Get "caption") (.Get "attr")}}<p>
{{ .Get "caption" }}
{{ with .Get "attrlink"}}<a href="{{.}}"> {{ end }}
{{ .Get "attr" }}
{{ if .Get "attrlink"}}</a> {{ end }}
</p> {{ end }}
</figcaption>
{{ end }}
</figure>
<!-- image -->
### Usage
I simply changed:
{% image full http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg "One of my favorite touristy-type photos. I secretly waited for the good light while we were "having fun" and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing." ->http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/ %}
to this (this example uses a slightly extended version named `fig`, different than the built-in `figure`):
{{%/* fig class="full" src="http://farm5.staticflickr.com/4136/4829260124_57712e570a_o_d.jpg" title="One of my favorite touristy-type photos. I secretly waited for the good light while we were having fun and took this. Only regret: a stupid pole in the top-left corner of the frame I had to clumsily get rid of at post-processing." link="http://www.flickr.com/photos/alexnormand/4829260124/in/set-72157624547713078/" */%}}
As a bonus, the shortcode named parameters are, arguably, more readable.
## Finishing touches
### Fix content
Depending on the amount of customization that was done with each post with Jekyll, this step will require more or less effort. There are no hard and fast rules here except that `hugo server --watch` is your friend. Test your changes and fix errors as needed.
### Clean up
You'll want to remove the Jekyll configuration at this point. If you have anything else that isn't used, delete it.
## A practical example in a diff
[Hey, it's Alex](http://heyitsalex.net/) was migrated in less than a _father-with-kids day_ from Jekyll to Hugo. You can see all the changes (and screw-ups) by looking at this [diff](https://github.com/alexandre-normand/alexandre-normand/compare/869d69435bd2665c3fbf5b5c78d4c22759d7613a...b7f6605b1265e83b4b81495423294208cc74d610).

BIN
images/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 KiB

BIN
images/tn.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

16
layouts/404.html Normal file
View File

@ -0,0 +1,16 @@
{{ define "content" }}
<div class="notfound">
<h1 class="error-emoji"></h1>
<p class="error-text">/* 404 page not found. */</p>
<p class="error-link"><a href="{{ "/" | relLangURL }}">↑ Back Home ↑</a></p>
</div>
<script>
var errorEmojiContainer = document.getElementsByClassName('error-emoji')[0];
var emojiArray = [
'\\(o_o)/', '(o^^)o', '(˚Δ˚)b', '(^-^*)', '(≥o≤)', '(^_^)b', '(·_·)',
'(=\'X\'=)', '(>_<)', '(;-;)', '\\(^Д^)/',
];
var errorEmoji = emojiArray[Math.floor(Math.random() * emojiArray.length)];
errorEmojiContainer.appendChild(document.createTextNode(errorEmoji));
</script>
{{ end }}

View File

@ -0,0 +1,15 @@
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode }}">
{{ partial "head.html" . }}
<body class="">
<div class="wrapper">
{{ partial "header" . }}
<main class="main">
<div class="container">
{{ block "content" . }}{{ end }}
</div>
</main>
{{ partial "footer.html" . }}
</div>
</body>
</html>

View File

@ -0,0 +1,15 @@
{{ define "content" }}
{{ $data := .Data }}
<div class="post-warp archive">
<h2 class="post-title" style="text-align:right;padding-bottom:2em">-&nbsp;{{ $data.Plural | humanize }}&nbsp;·&nbsp;{{ .Title }}&nbsp;-</h2>
{{ range (.Paginate .Pages).Pages }}
<article class="archive-item">
<a href="{{ .Permalink }}" class="archive-item-link hvr-underline-from-center">{{ .Title }}</a>
<span class="archive-item-date">
{{ .Date.Format "January 2, 2006" }}
</span>
</article>
{{ end }}
{{ partial "paginator.html" . }}
</div>
{{end }}

View File

@ -0,0 +1,16 @@
{{ define "content" }}
<div class="post-warp archive">
{{ range (.Paginate (.Pages.GroupByDate "2006")).PageGroups }}
<h3>{{ .Key }}</h3>
{{ range .Pages }}
<article class="archive-item">
<a href="{{ .RelPermalink }}" class="archive-item-link">{{ .Title }}</a>
<span class="archive-item-date">
{{ .Date.Format "January 2, 2006" }}
</span>
</article>
{{ end }} {{ end }}
{{ partial "paginator.html" . }}
</div>
{{end }}

View File

@ -0,0 +1,95 @@
{{ define "content" -}}
{{ $cdn_url := .Scratch.Get "cdn_url" }}
<article class="post-warp" itemscope itemtype="http://schema.org/Article">
<header class="post-header">
<h1 class="post-title" itemprop="name headline">{{ .Title }}</h1>
<div class="post-meta">
Written by <a itemprop="name" href="{{.Site.BaseURL }}" rel="author">{{ if isset .Params "author" }}{{ .Params.author }}{{ else }}{{ .Site.Params.author }}{{ end }}</a> with ♥
<span class="post-time">
on <time datetime={{.Date.Format (.Site.Params.dateFormatToUse | default "2006-01-02") }} itemprop="datePublished">{{ .Date.Format (.Site.Params.dateFormatToUse | default "January 2, 2006") }}</time>
</span>
in
{{ with .Params.categories -}}
<i class="iconfont icon-folder"></i>
<span class="post-category">
{{ range . }}
{{- $name := . -}}
{{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}}
<a href="{{ .Permalink }}"> {{ $name }} </a>
{{ end -}}
{{ end }}
</span>
{{- end }}
</div>
</header>
<div class="post-content">
<!--featured_image-->
{{ $images := findRE "<img src=\"[^\"|\\\"]*\"" .Content -}}
{{ if ge (len $images) 1}}
{{ $.Scratch.Set "postHasImages" true }}
{{ end }}
{{ with .Params.featured_image }}
{{- $img := . -}}
<img src="{{ printf "%s%s" $cdn_url $img }}" class="featured_image">
{{ end }}
<!-- end featured_image-->
{{ $reAltIn := "<img src=\"([^\"]+)\" alt=\"([^\"]+)?\" />" }}
{{ $reAltOut := ( printf "<figure><img src=\"/images/ring.svg\" data-sizes=\"auto\" data-src=\"%s$1\" alt=\"$2\" class=\"lazyload\"><figcaption class=\"image-caption\">$2</figcaption></figure>" $cdn_url ) }}
{{ $altContent := .Content | replaceRE $reAltIn $reAltOut | safeHTML }}
{{ $reAltTitleIn := "<img src=\"([^\"]+)\" alt=\"([^\"]+)?\" title=\"([^\"]+)?\" />" }}
{{ $reAltTitleOut := ( printf "<figure><img src=\"/images/ring.svg\" data-src=\"%s$1\" data-sizes=\"auto\" alt=\"$2\" title=\"$3\" class=\"lazyload\"><figcaption class=\"image-caption\">$2</figcaption></figure>" $cdn_url ) }}
{{ $finalContent := $altContent | replaceRE $reAltTitleIn $reAltTitleOut | safeHTML }}
{{ $finalContent }}
</div>
<div class="post-copyright">
{{ with .Site.Params.author }}
<p class="copyright-item">
<span>Author:</span>
<span>{{ . }} </span>
</p>
{{ end }}
{{ with .Permalink }}
<p class="copyright-item">
<span>Link:</span>
<a href={{ . }}>{{ . }}</span>
</p>
{{ end }}
{{ with .Site.Params.license }}
<p class="copyright-item lincese">
{{ . | safeHTML}}
</p>
{{ end }}
</div>
{{ with .Params.tags }}
<div class="post-tags">
<section style="float:left;">
<i class="iconfont icon-tag"></i>Tag(s):
{{ range . }}
<span class="tag"><a href="{{ "tags/" | absURL }}{{ . | urlize }}/">
#{{.}}</a></span>
{{ end }}
</section>
<section style="float:right;">
<a href="javascript:window.history.back();">back</a></span> ·
<span><a href="{{ "/" | absURL}}">home</a></span>
</section>
</div>
{{ end }}
<div class="post-nav">
{{ if .PrevInSection }}
<a href="{{.PrevInSection.Permalink}}" class="prev" rel="prev" title="{{ .PrevInSection.Title}}"><i class="iconfont icon-left"></i>&nbsp;{{ .PrevInSection.Title}}</a>
{{ end }}
{{ if .NextInSection }}
<a href="{{.NextInSection.Permalink}}" class="next" rel="next" title="{{.NextInSection.Title}}">{{.NextInSection.Title}}&nbsp;<i class="iconfont icon-right"></i></a>
{{ end }}
</div>
</article>
{{- end }}

View File

@ -0,0 +1,47 @@
{{ define "content" }}
{{ $termName := .Data.Plural }}
{{ $terms := .Data.Terms.ByCount }}
{{ $length := len $terms }}
{{ $type := .Type }}
<!-- Categories Page -->
<div class="post-warp {{.Data.Plural}}">
<h2 class="post-title" style="text-align:right;padding-bottom:2em">-&nbsp;{{ .Data.Plural | humanize }}&nbsp;-</h2>
{{ if and $.Site.Taxonomies.categories (eq $termName "categories") }}
<div class="categories-card">
{{ range $terms }}
{{ $term := .Term }}
{{ $pages := .Pages }}
{{ with $.Site.GetPage "taxonomy" (printf "%s/%s" $type $term) }}
<div class="card-item">
<div class="categories" >
<a href="{{ .URL }}"><h3> <i class="iconfont icon-folder" style="padding-right: 3px"></i> {{ $term | humanize}} </h3> </a>
{{ range first 5 $pages }}
<article class="archive-item">
<a href="{{ .URL }}" class="archive-item-link">{{ .Title }}</a>
</article>
{{ end }}
{{ if gt (len $pages) 5 }}
<span class="more-post">
<a href="{{ .Permalink }}" class="more-post-link">More >></a>
</span>
{{ end }}
</div>
</div>
{{ end }}
{{ end }}
</div> <!-- //categories-card -->
<!-- Tag cloud Page -->
{{ else if and $.Site.Taxonomies.tags (eq $termName "tags") }}
<div class="tag-cloud-tags">
{{ range $.Site.Taxonomies.tags.ByCount }}
{{ if .Name }}
<a href="/tags/{{ .Name | urlize}}/"> {{ .Name }} <small>({{ .Count }})</small></a>
{{ end }}
{{end}}
</div>
{{ end }}
</div>
{{end }}

27
layouts/index.atom.xml Normal file
View File

@ -0,0 +1,27 @@
<feed xmlns="http://www.w3.org/2005/Atom">
{{ if .IsHome }}
<title>{{ .Title }}</title>
{{ else }}
<title>{{ .Title }} - {{ .Site.Title }}</title>
{{ end }}
<link href="{{ .Permalink }}index.xml" rel="self"/>
<link href="{{ .Permalink }}"/>{{ if not .Date.IsZero }}
<updated>{{ .Date.Format "2006-01-02T15:04:05-07:00" | safeHTML }}</updated>{{ end }}
<id>{{ .Permalink }}</id>{{ with .Site.Author.name }}
<author>
<name>{{.}}</name>{{ with $.Site.Author.email }}
<email>{{.}}</email>{{end}}
</author>{{end}}
<generator>Hugo -- gohugo.io</generator>{{ range first 15 (where .Data.Pages "Type" "in" .Site.Params.mainSections) }}
<entry>
{{ `<title type="html"><![CDATA[` | safeHTML }}{{ .Title }}]]></title>
<link href="{{ .Permalink }}"/>
<id>{{ .Permalink }}</id>{{ with .Site.Params.Author }}
<author>
<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>
</entry>{{ end }}
</feed>

3
layouts/index.html Normal file
View File

@ -0,0 +1,3 @@
{{ define "content" }}
{{ partial "home.html" . }}
{{ end }}

8
layouts/page/single.html Normal file
View File

@ -0,0 +1,8 @@
{{ define "content" }}
<div class="post-warp archive">
<h2 class="post-title" style="text-align:right;padding-bottom:2em">{{ .Title }}</h2>
<div class="post-content">
{{ .Content }}
</div>
</div>
{{end }}

View File

@ -0,0 +1,5 @@
{{ $style := resources.Get "css/main.scss" | resources.ToCSS | resources.Minify}}
<link rel="stylesheet" href="{{ "/font/iconfont.css" | absURL}}">
<link rel="stylesheet" href="{{ $style.RelPermalink }}">

View File

@ -0,0 +1,22 @@
<footer class="footer">
<div class="copyright">
&copy;
{{ with .Site.Params.since }}
<span itemprop="copyrightYear">{{.}} - {{ now.Year }}</span>
{{ end }}
<span class="with-love">
<i class="iconfont icon-love"></i>
</span>
{{ if .Site.Params.author }}
<span class="author" itemprop="copyrightHolder"><a href="{{ .Site.BaseURL }}">{{ .Site.Params.author }}</a> | </span>
{{ end }}
{{ with .Site.Params.beian }}
<a href="http://www.miibeian.gov.cn/" target="_blank" rel="external nofollow">{{ . }} </a> |
{{ end }}
<a href="/privacy/"> Privacy </a> |
<span>Powered by <a href="https://gohugo.io/" target="_blank" rel="external nofollow">Hugo</a> & <a href="https://github.com/liuzc/leaveit" target="_blank" rel="external nofollow">LeaveIt</a></span>
</div>
</footer>
{{ partial "js.html" . }}

View File

@ -0,0 +1,44 @@
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="robots" content="noodp"/>
{{ with .Site.Params.author }}<meta name="author" content="{{ . }}">{{ end }}
{{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }}
{{ with .Site.Params.keywords }}<meta name="keywords" content="{{ . }}">{{ end }}
{{ with .Site.Params.google_verification }}<meta name="google-site-verification" content="{{ . }}" />{{ end }}
{{ if .PrevInSection }}<link rel="prev" href="{{.PrevInSection.Permalink}}" />{{end}}
{{ if .NextInSection}}<link rel="next" href="{{ .NextInSection.Permalink }}" />{{end}}
<link rel="canonical" href="{{ .Permalink }}" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<title>
{{ $url := replace .Permalink ( printf "%s" .Site.BaseURL) "" }}
{{ if .IsHome }}
{{ .Site.Title }}
{{ else if .Params.heading }}
{{ .Params.heading }}
{{ else }}
{{ .Title }} | {{ .Site.Title }}
{{ end }}
</title>
<meta name="title" content="{{ if .IsHome }}{{ .Site.Title }}{{ else if .Params.heading }}{{ .Params.heading }}{{ else }}{{ .Title }} | {{ .Site.Title }}{{ end}}">
{{ partial "css" . }}
{{ if .RSSLink }}
<link href="{{ .RSSLink }}" rel="alternate" type="application/rss+xml" title="{{ .Site.Title }}" />
<link href="{{ .RSSLink }}" rel="feed" type="application/rss+xml" title="{{ .Site.Title }}" />
{{ end }}
{{ partial "seo_schema" . }}
</head>
{{ $cdn_url := ""}}
{{ if eq ( getenv "HUGO_ENV" ) "production" }}
{{ with .Site.Params.cdn_url }}
{{ $cdn_url = .}}
{{ end }}
{{ end }}
{{ .Scratch.Set "cdn_url" $cdn_url }}

View File

@ -0,0 +1,13 @@
<nav class="navbar">
<div class="container">
<div class="navbar-header header-logo">
<a href="javascript:void(0);" class="theme-switch"><i class="iconfont icon-xihuan"></i></a>&nbsp;<a href="{{ .Site.BaseURL }}">{{ .Site.Title }}</a>
</div>
<div class="menu navbar-right">
{{ $currentPage := . }}
{{ range .Site.Menus.main }}
<a class="menu-item{{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) }} active{{end}}" href="{{ .URL }}" title="{{ .Title }}">{{ .Name }}</a>
{{ end }}
</div>
</div>
</nav>

View File

@ -0,0 +1,21 @@
<div class="intro">
{{ $cdn_url := .Scratch.Get "cdn_url" }}
{{ with .Site.Params.avatar}}
{{ $avatar := .}}
<div class="avatar">
<a href="/posts/"> <img src="{{ (printf "%s%s" $cdn_url $avatar)}}"> </a>
</div>
{{ end }}
{{ with .Site.Params.subtitle}}
<h2 class="description">
{{ . }}
</h2>
{{ end }}
<div class="social-links">
{{ partial "social.html" . }}
</div>
</div>
{{ if .IsHome }}
{{ partial "wechat.html" . }}
{{ end }}

42
layouts/partials/js.html Normal file
View File

@ -0,0 +1,42 @@
{{ $cdn_url := .Scratch.Get "cdn_url" }}
{{ $postHasImages := .Scratch.Get "postHasImages"}}
{{ if .IsPage }}
{{ $jquery := resources.Get "/js/jquery.min.js" }}
{{ $lazysizes := resources.Get "/js/lazysizes.min.js"}}
{{ $prettify := resources.Get "/js/prettify.min.js" }}
{{ $dynamic := resources.Get "/js/dynamic.to.top.min.js" }}
{{ $main := resources.Get "/js/main.js" }}
{{ $page := resources.Get "/js/page.js" }}
{{ $lihtGallery := resources.Get "/js/lightGallery-all.min.js" }}
{{ $lihtGallery_init := resources.Get "/js/lightGallery-init.js" }}
{{ if $postHasImages }}
<link href="//lib.baomitu.com/lightgallery/1.6.11/css/lightgallery.min.css" rel="stylesheet">
{{ $vendorscript := slice $jquery $lazysizes $prettify $dynamic $main $page $lihtGallery $lihtGallery_init | resources.Concat "/js/vendor0.js" | resources.Minify }}
<script src="{{ printf "%s%s" $cdn_url $vendorscript.RelPermalink }}" async="" ></script>
{{ else }}
{{ $vendorscript := slice $jquery $prettify $dynamic $main $page | resources.Concat "/js/vendor1.js" | resources.Minify }}
<script src="{{ printf "%s%s" $cdn_url $vendorscript.RelPermalink }}" async=""></script>
{{ end }}
{{ else }}
{{ $main := resources.Get "/js/main.js" | resources.Minify}}
<script src="{{ printf "%s%s" $cdn_url $main.RelPermalink }}" async=""></script>
{{ end }}
{{ if eq ( getenv "HUGO_ENV" ) "production" }}
{{ template "_internal/google_analytics_async.html" . }}
{{ with .Site.Params.baiduAnalytics}}
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?{{.}}";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
{{ end }}
{{ end }}

View File

@ -0,0 +1,50 @@
{{ $pag := $.Paginator }}
{{ if gt $pag.TotalPages 1 }}
<ul class="pagination">
{{ with $pag.First }}
<!-- <li class="page-item {{ if not $pag.HasPrev }}disabled{{ end }}">
<span class="page-link">
<a href="{{ .URL }}" aria-label="First"><span aria-hidden="true">&laquo;&laquo;</span></a>
</span>
</li> -->
{{ end }}
<!-- <li class="page-item {{ if not $pag.HasPrev }}disabled{{ end }}">
<span class="page-link">
<a href="{{ if $pag.HasPrev }}{{ $pag.Prev.URL }}{{ end }}" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a>
</span>
</li> -->
{{ $.Scratch.Set "__paginator.ellipsed" false }}
{{ range $pag.Pagers }}
{{ $right := sub .TotalPages .PageNumber }}
{{ $showNumber := or (le .PageNumber 1) (eq $right 0) }}
{{ $showNumber := or $showNumber (and (gt .PageNumber (sub $pag.PageNumber 3)) (lt .PageNumber (add $pag.PageNumber 3))) }}
{{ if $showNumber }}
{{ $.Scratch.Set "__paginator.ellipsed" false }}
{{ $.Scratch.Set "__paginator.shouldEllipse" false }}
{{ else }}
{{ $.Scratch.Set "__paginator.shouldEllipse" (not ($.Scratch.Get "__paginator.ellipsed") ) }}
{{ $.Scratch.Set "__paginator.ellipsed" true }}
{{ end }}
{{ if $showNumber }}
<li class="page-item {{ if eq . $pag }}active{{ end }}">
<span class="page-link">
<a href="{{ .URL }}">{{ .PageNumber }}</a></li>
</span>
{{ else if ($.Scratch.Get "__paginator.shouldEllipse") }}
<li class="page-item "><span class="page-link" aria-hidden="true">&hellip;</span></li>
{{ end }}
{{ end }}
<!-- <li class="page-item {{ if not $pag.HasNext }}disabled{{ end }}">
<span class="page-link">
<a href="{{ if $pag.HasNext }}{{ $pag.Next.URL }}{{ end }}" aria-label="Next"><span aria-hidden="true">&raquo;</span></a>
</span>
</li> -->
<!-- {{ with $pag.Last }}
<li class="page-item {{ if not $pag.HasNext }}disabled{{ end }}">
<span class="page-link">
<a href="{{ .URL }}" aria-label="Last"><span aria-hidden="true">&raquo;&raquo;</span></a>
</span>
</li>
{{ end }} -->
</ul>
{{ end }}

View File

@ -0,0 +1,9 @@
{{ $related := .Site.RegularPages.Related . | first 5 }}
{{ with $related }}
<h3>Similar articles:</h3>
<ul>
{{ range . }}
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
{{ end }}
</ul>
{{ end }}

View File

@ -0,0 +1,43 @@
<!-- JSON-LD -->
{{ if .IsHome }}
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"url": "{{ .Permalink }}",
"name": "{{ .Site.Title }}",
"author": {
"@type": "Person",
"name": "{{ .Site.Params.author }}"
},
"description": "{{ .Site.Params.description }}",
}
</script>
{{ end }}
{{ if .IsPage }}
<script type="application/ld+json">
"@context" : "http://schema.org",
"@type" : "BlogPosting",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "{{ .Site.BaseURL }}"
},
"articleSection" : "{{ .Section }}",
"name" : "{{ .Title }}",
"headline" : "{{ .Title }}",
"description" : "{{ if .Description }}{{ .Description }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ end }}{{ end }}",
"inLanguage" : "{{ .Site.LanguageCode }}",
"author" : "{{ if isset .Params "author" }}{{ .Params.author }}{{ else }}{{ .Site.Params.author }}{{ end }}",
"creator" : "{{ if isset .Params "author" }}{{ .Params.author }}{{ else }}{{ .Site.Params.author }}{{ end }}",
"publisher": "{{ if isset .Params "author" }}{{ .Params.author }}{{ else }}{{ .Site.Params.author }}{{ end }}",
"accountablePerson" : "{{ if isset .Params "author" }}{{ .Params.author }}{{ else }}{{ .Site.Params.author }}{{ end }}",
"copyrightHolder" : "{{ if isset .Params "author" }}{{ .Params.author }}{{ else }}{{ .Site.Params.author }}{{ end }}",
"copyrightYear" : "{{ .Date.Format "2006" }}",
"datePublished": "{{ .Date }}",
"dateModified" : "{{ .Date }}",
"url" : "{{ .Permalink }}",
"wordCount" : "{{ .WordCount }}",
"keywords" : [ {{ if isset .Params "tags" }}{{ range .Params.tags }}"{{ . }}",{{ end }}{{ end }} {{with .Site.Title}}"{{ .}}"{{ end }}]
}
</script>
{{ end }}

View File

@ -0,0 +1,27 @@
{{ with .Site.Params.Social.Github }}
<a href="https://github.com/{{.}}" target="_blank" rel="me noopener"><i class="iconfont icon-github"></i></a>
{{ end }}
{{ with .Site.Params.Social.Twitter }}
<a href="https://twitter.com/{{.}}" target="_blank" rel="me noopener"><i class="iconfont icon-twitter"></i></a>
{{ end }}
{{ with .Site.Params.Social.Instagram }}
<a href="https://www.instagram.com/{{.}}/" target="_blank" rel="me noopener"><i class="iconfont icon-instagram"></i></a>
{{ end }}
{{ with .Site.Params.Social.Wechat}}
<a href="javascript:void(0);" target="_blank" rel="me noopener" onclick="document.getElementById('lightbox').style.display='inline';"><i class="iconfont icon-wechat"></i></a>
{{end}}
{{ with .Site.Params.Social.Email}}
<a href="mailto:{{.}}" rel="me noopener"><i class="iconfont icon-mail01"></i></a>
{{ end }}
{{ with .Site.Params.Social.Facebook}}
<a href="https://facebook.com/{{.}}" rel="me noopener"><i class="iconfont icon-facebook"></i></a>
{{ end }}
{{ with .Site.Params.Social.Telegram}}
<a href="https://t.me/{{.}}" rel="me noopener"><i class="iconfont icon-telegram"></i></a>
{{ end }}
{{ with .Site.Params.Social.Dribbble}}
<a href="https://t.me/{{.}}" rel="me noopener"><i class="iconfont icon-dribbble"></i></a>
{{ end }}
{{ with .Site.Params.Social.Medium}}
<a href="https://t.me/{{.}}" rel="me noopener"><i class="iconfont icon-medium-circle-fill"></i></a>
{{ end }}

View File

@ -0,0 +1,46 @@
{{ $cdn_url := .Scratch.Get "cdn_url" }}
{{ with .Site.Params.Social.Wechat}}
{{ $wechat := .}}
<style type="text/css">
.lightbox {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, .8);
}
.center {
width: 220px;
height: 220px;
position: absolute;
top: 50%;
left: 50%;
margin: -150px 0 0 -110px;
}
.center img {
width: 220px;
}
.center i {
color: #fff;
font-size: 1.5em;
position: relative;
float: right;
top: 0px;
right: -20px;
cursor: pointer;
}
</style>
<!-- LIGHTBOX CODE BEGIN -->
<div id="lightbox" style="display: none" class="lightbox" onclick="document.getElementById('lightbox').style.display='none';">
<div class="center">
<i class="iconfont icon-close"></i>
<img src="{{ printf "%s%s" $cdn_url $wechat}}">
</div>
</div>
<!-- LIGHTBOX CODE END -->
{{ end }}

66
layouts/robots.txt Normal file
View File

@ -0,0 +1,66 @@
User-agent: *
Disallow: /images/
Disallow: /js/
Disallow: /css/
User-agent: MJ12bot
Disallow: /
User-agent: AhrefsBot
Disallow: /
User-agent: BLEXBot
Disallow: /
# Block SISTRIX
User-agent: SISTRIX Crawler
Disallow: /
User-agent: sistrix
Disallow: /
User-agent: 007ac9
Disallow: /
User-agent: 007ac9 Crawler
Disallow: /
# Block Uptime robot
User-agent: UptimeRobot/2.0
Disallow: /
# Block Ezooms Robot
User-agent: Ezooms Robot
Disallow: /
# Block Perl LWP
User-agent: Perl LWP
Disallow: /
# Block netEstate NE Crawler (+http://www.website-datenbank.de/)
User-agent: netEstate NE Crawler (+http://www.website-datenbank.de/)
Disallow: /
# Block WiseGuys Robot
User-agent: WiseGuys Robot
Disallow: /
# Block Turnitin Robot
User-agent: Turnitin Robot
Disallow: /
# Block Heritrix
User-agent: Heritrix
Disallow: /
# Block pricepi
User-agent: pimonster
Disallow: /
User-agent: Pimonster
Disallow: /
User-agent: SurdotlyBot
Disallow: /
User-agent: ZoominfoBot
Disallow: /
Sitemap: {{ "sitemap.xml" | absLangURL }}

24
layouts/rss.xml Normal file
View File

@ -0,0 +1,24 @@
<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>
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
<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="{{.URL}}" rel="self" type="application/rss+xml" />
{{ 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>
</item>
{{ end }}
</channel>
</rss>

31
layouts/sitemap.xml Normal file
View File

@ -0,0 +1,31 @@
<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 }}
</url>
{{ end }}
</urlset>

370
static/font/demo.css Normal file
View File

@ -0,0 +1,370 @@
*{margin: 0;padding: 0;list-style: none;}
/*
KISSY CSS Reset
理念1. reset 的目的不是清除浏览器的默认样式这仅是部分工作清除和重置是紧密不可分的
2. reset 的目的不是让默认样式在所有浏览器下一致而是减少默认样式有可能带来的问题
3. reset 期望提供一套普适通用的基础样式但没有银弹推荐根据具体需求裁剪和修改后再使用
特色1. 适应中文2. 基于最新主流浏览器
维护玉伯<lifesinger@gmail.com>, 正淳<ragecarrier@gmail.com>
*/
/** 清除内外边距 **/
body, h1, h2, h3, h4, h5, h6, hr, p, blockquote, /* structural elements 结构元素 */
dl, dt, dd, ul, ol, li, /* list elements 列表元素 */
pre, /* text formatting elements 文本格式元素 */
form, fieldset, legend, button, input, textarea, /* form elements 表单元素 */
th, td /* table elements 表格元素 */ {
margin: 0;
padding: 0;
}
/** 设置默认字体 **/
body,
button, input, select, textarea /* for ie */ {
font: 12px/1.5 tahoma, arial, \5b8b\4f53, sans-serif;
}
h1, h2, h3, h4, h5, h6 { font-size: 100%; }
address, cite, dfn, em, var { font-style: normal; } /* 将斜体扶正 */
code, kbd, pre, samp { font-family: courier new, courier, monospace; } /* 统一等宽字体 */
small { font-size: 12px; } /* 小于 12px 的中文很难阅读,让 small 正常化 */
/** 重置列表元素 **/
ul, ol { list-style: none; }
/** 重置文本格式元素 **/
a { text-decoration: none; }
a:hover { text-decoration: underline; }
/** 重置表单元素 **/
legend { color: #000; } /* for ie6 */
fieldset, img { border: 0; } /* img 搭车:让链接里的 img 无边框 */
button, input, select, textarea { font-size: 100%; } /* 使得表单元素在 ie 下能继承字体大小 */
/* 注optgroup 无法扶正 */
/** 重置表格元素 **/
table { border-collapse: collapse; border-spacing: 0; }
/* 清除浮动 */
.ks-clear:after, .clear:after {
content: '\20';
display: block;
height: 0;
clear: both;
}
.ks-clear, .clear {
*zoom: 1;
}
.main {
padding: 30px 100px;
width: 960px;
margin: 0 auto;
}
.main h1{font-size:36px; color:#333; text-align:left;margin-bottom:30px; border-bottom: 1px solid #eee;}
.helps{margin-top:40px;}
.helps pre{
padding:20px;
margin:10px 0;
border:solid 1px #e7e1cd;
background-color: #fffdef;
overflow: auto;
}
.icon_lists{
width: 100% !important;
}
.icon_lists li{
float:left;
width: 100px;
height:180px;
text-align: center;
list-style: none !important;
}
.icon_lists .icon{
font-size: 42px;
line-height: 100px;
margin: 10px 0;
color:#333;
-webkit-transition: font-size 0.25s ease-out 0s;
-moz-transition: font-size 0.25s ease-out 0s;
transition: font-size 0.25s ease-out 0s;
}
.icon_lists .icon:hover{
font-size: 100px;
}
.markdown {
color: #666;
font-size: 14px;
line-height: 1.8;
}
.highlight {
line-height: 1.5;
}
.markdown img {
vertical-align: middle;
max-width: 100%;
}
.markdown h1 {
color: #404040;
font-weight: 500;
line-height: 40px;
margin-bottom: 24px;
}
.markdown h2,
.markdown h3,
.markdown h4,
.markdown h5,
.markdown h6 {
color: #404040;
margin: 1.6em 0 0.6em 0;
font-weight: 500;
clear: both;
}
.markdown h1 {
font-size: 28px;
}
.markdown h2 {
font-size: 22px;
}
.markdown h3 {
font-size: 16px;
}
.markdown h4 {
font-size: 14px;
}
.markdown h5 {
font-size: 12px;
}
.markdown h6 {
font-size: 12px;
}
.markdown hr {
height: 1px;
border: 0;
background: #e9e9e9;
margin: 16px 0;
clear: both;
}
.markdown p,
.markdown pre {
margin: 1em 0;
}
.markdown > p,
.markdown > blockquote,
.markdown > .highlight,
.markdown > ol,
.markdown > ul {
width: 80%;
}
.markdown ul > li {
list-style: circle;
}
.markdown > ul li,
.markdown blockquote ul > li {
margin-left: 20px;
padding-left: 4px;
}
.markdown > ul li p,
.markdown > ol li p {
margin: 0.6em 0;
}
.markdown ol > li {
list-style: decimal;
}
.markdown > ol li,
.markdown blockquote ol > li {
margin-left: 20px;
padding-left: 4px;
}
.markdown code {
margin: 0 3px;
padding: 0 5px;
background: #eee;
border-radius: 3px;
}
.markdown pre {
border-radius: 6px;
background: #f7f7f7;
padding: 20px;
}
.markdown pre code {
border: none;
background: #f7f7f7;
margin: 0;
}
.markdown strong,
.markdown b {
font-weight: 600;
}
.markdown > table {
border-collapse: collapse;
border-spacing: 0px;
empty-cells: show;
border: 1px solid #e9e9e9;
width: 95%;
margin-bottom: 24px;
}
.markdown > table th {
white-space: nowrap;
color: #333;
font-weight: 600;
}
.markdown > table th,
.markdown > table td {
border: 1px solid #e9e9e9;
padding: 8px 16px;
text-align: left;
}
.markdown > table th {
background: #F7F7F7;
}
.markdown blockquote {
font-size: 90%;
color: #999;
border-left: 4px solid #e9e9e9;
padding-left: 0.8em;
margin: 1em 0;
font-style: italic;
}
.markdown blockquote p {
margin: 0;
}
.markdown .anchor {
opacity: 0;
transition: opacity 0.3s ease;
margin-left: 8px;
}
.markdown .waiting {
color: #ccc;
}
.markdown h1:hover .anchor,
.markdown h2:hover .anchor,
.markdown h3:hover .anchor,
.markdown h4:hover .anchor,
.markdown h5:hover .anchor,
.markdown h6:hover .anchor {
opacity: 1;
display: inline-block;
}
.markdown > br,
.markdown > p > br {
clear: both;
}
.hljs {
display: block;
background: white;
padding: 0.5em;
color: #333333;
overflow-x: auto;
}
.hljs-comment,
.hljs-meta {
color: #969896;
}
.hljs-string,
.hljs-variable,
.hljs-template-variable,
.hljs-strong,
.hljs-emphasis,
.hljs-quote {
color: #df5000;
}
.hljs-keyword,
.hljs-selector-tag,
.hljs-type {
color: #a71d5d;
}
.hljs-literal,
.hljs-symbol,
.hljs-bullet,
.hljs-attribute {
color: #0086b3;
}
.hljs-section,
.hljs-name {
color: #63a35c;
}
.hljs-tag {
color: #333333;
}
.hljs-title,
.hljs-attr,
.hljs-selector-id,
.hljs-selector-class,
.hljs-selector-attr,
.hljs-selector-pseudo {
color: #795da3;
}
.hljs-addition {
color: #55a532;
background-color: #eaffea;
}
.hljs-deletion {
color: #bd2c00;
background-color: #ffecec;
}
.hljs-link {
text-decoration: underline;
}
pre{
background: #fff;
}

59
static/font/iconfont.css Normal file

File diff suppressed because one or more lines are too long

BIN
static/font/iconfont.eot Normal file

Binary file not shown.

1
static/font/iconfont.js Normal file

File diff suppressed because one or more lines are too long

89
static/font/iconfont.svg Normal file
View File

@ -0,0 +1,89 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<!--
2013-9-30: Created.
-->
<svg>
<metadata>
Created by iconfont
</metadata>
<defs>
<font id="iconfont" horiz-adv-x="1024" >
<font-face
font-family="iconfont"
font-weight="500"
font-stretch="normal"
units-per-em="1024"
ascent="896"
descent="-128"
/>
<missing-glyph />
<glyph glyph-name="tag" unicode="&#59133;" d="M847.701 277.536 618.93 48.3c-11.182-10.716-26.558-17.239-42.398-17.239-15.842 0-31.218 6.523-41.934 17.239L201.46 381.903c-23.763 23.296-42.399 68.491-42.399 101.572L159.061 677.301c0 32.615 27.023 59.639 59.639 59.639l193.825 0c33.081 0 78.276-18.637 102.038-42.399l333.139-332.671c10.715-11.183 17.238-26.558 17.238-42.399S858.416 288.253 847.701 277.536zM308.157 647.481c-33.081 0-59.639-26.558-59.639-59.639s26.558-59.639 59.639-59.639 59.639 26.558 59.639 59.639S341.238 647.481 308.157 647.481z" horiz-adv-x="1024" />
<glyph glyph-name="linkedin" unicode="&#59032;" d="M0 896L0 896 0 896ZM512 875.52c-271.456 0-491.52-220.064-491.52-491.52s220.064-491.52 491.52-491.52 491.52 220.064 491.52 491.52-220.064 491.52-491.52 491.52zM391.68 180.288l-99.52 0 0 320.256 99.52 0 0-320.256zM341.312 539.8399999999999c-31.424 0-51.776 22.336-51.776 49.824 0 28.16 20.928 49.76 53.056 49.76s51.776-21.6 52.384-49.76c0.064-27.552-20.288-49.824-53.664-49.824zM755.136 180.288l-99.488 0 0 177.504c0 41.28-14.432 69.376-50.432 69.376-27.488 0-43.84-19.008-51.104-37.312-2.624-6.496-3.264-15.712-3.264-24.832l0-184.672-99.584 0 0 218.112c0 39.936-1.28 73.376-2.624 102.144l86.432 0 4.608-44.48 1.952 0c13.12 20.928 45.216 51.712 98.912 51.712 65.472 0 114.592-43.84 114.592-138.144l0-189.376z" horiz-adv-x="1024" />
<glyph glyph-name="mail" unicode="&#59225;" d="M512 896c-282.784 0-512-229.216-512-512s229.216-512 512-512 512 229.216 512 512-229.216 512-512 512zM256 640l512 0c9.152 0 18.016-1.952 26.144-5.664l-282.144-329.152-282.144 329.184c8.128 3.712 16.992 5.664 26.144 5.664zM192 192l0 384c0 1.344 0.064 2.688 0.128 4l187.648-218.944-185.6-185.6c-1.44 5.344-2.208 10.88-2.208 16.544zM768 128l-512 0c-5.664 0-11.2 0.768-16.544 2.208l182.112 182.112 90.432-105.504 90.432 105.504 182.112-182.112c-5.344-1.44-10.88-2.208-16.544-2.208zM832 192c0-5.664-0.768-11.2-2.208-16.544l-185.6 185.6 187.68 218.944c0.096-1.312 0.128-2.656 0.128-4l0-384z" horiz-adv-x="1024" />
<glyph glyph-name="mail01" unicode="&#58946;" d="M814.512 597.15h-603.558v-1.464h-4.395v-424.833h610.884v424.833h-4.395l1.464 1.464zM512.733 544.412h178.725l-77.642-77.642-101.081-104.012-102.547 104.012-76.177 77.642h178.723zM260.762 223.588h-2.931v320.823h2.931l112.802-114.266 45.412-46.879-43.948-43.948-114.266-115.73zM512.733 223.588h-178.725l77.642 79.108 39.553 41.019 42.486-41.021 19.044-19.044 17.58 19.044 41.019 43.948 42.484-43.948v-1.464l77.642-77.642h-178.725zM766.169 223.588h-2.931l-112.802 114.266-43.948 46.879 43.948 45.414 112.802 114.266h2.931v-320.825zM873.11 745.11c-92.291 93.757-219.742 150.89-360.376 150.89-142.1 0-269.552-57.133-361.843-150.89-93.757-92.291-150.89-219.742-150.89-361.843 0-140.634 57.133-268.085 150.89-360.378 92.291-93.755 219.742-150.888 361.843-150.888 140.634 0 268.085 57.133 360.378 150.89 93.757 92.291 150.89 219.742 150.89 360.378-0.002 142.098-57.135 269.55-150.893 361.841zM832.092 63.908c-82.037-82.037-194.839-131.846-319.359-131.846-125.985 0-238.787 49.807-320.823 131.846-82.037 82.037-131.846 194.839-131.846 319.359 0 125.985 49.807 238.787 131.846 320.823 82.037 82.037 194.839 131.846 320.823 131.846 124.52 0 237.322-49.807 319.359-131.846 82.037-82.037 131.846-194.839 131.846-320.823 0-124.52-49.809-237.32-131.846-319.359z" horiz-adv-x="1025" />
<glyph glyph-name="wechat" unicode="&#59019;" d="M692.313 548.73c11.13 0 22.261 0 35.617-2.226-31.165 144.696-186.991 253.774-365.078 253.774-198.122 0-360.626-135.791-360.626-307.2 0-100.174 53.426-180.313 144.696-242.643l-35.617-111.304 126.887 62.33c44.522-8.904 82.365-17.809 126.887-17.809 11.13 0 22.261 0 33.391 2.226-6.678 24.487-11.13 48.974-11.13 75.687-2.226 158.052 133.565 287.165 304.974 287.165v0zM498.643 646.678c26.713 0 44.522-17.809 44.522-44.522s-17.809-44.522-44.522-44.522c-26.713 0-53.426 17.809-53.426 44.522 0 26.713 26.713 44.522 53.426 44.522v0zM244.87 555.409c-26.713 0-53.426 17.809-53.426 44.522s26.713 44.522 53.426 44.522c26.713 0 44.522-17.809 44.522-44.522 2.226-26.713-15.583-44.522-44.522-44.522v0zM1021.774 266.017c0 144.696-144.696 262.678-307.2 262.678-171.409 0-307.2-117.983-307.2-262.678 0-144.696 135.791-262.678 307.2-262.678 35.617 0 71.235 8.904 109.078 17.809l97.948-53.426-26.713 91.27c73.461 53.426 126.887 126.887 126.887 207.026v0zM616.626 312.765c-17.809 0-35.617 17.809-35.617 35.617 0 17.809 17.809 35.617 35.617 35.617 26.713 0 44.522-17.809 44.522-35.617 0-17.809-17.809-35.617-44.522-35.617v0zM814.748 312.765c-17.809 0-35.617 17.809-35.617 35.617 0 17.809 17.809 35.617 35.617 35.617 26.713 0 44.522-17.809 44.522-35.617-0-17.809-17.809-35.617-44.522-35.617v0zM814.748 312.765z" horiz-adv-x="1024" />
<glyph glyph-name="facebook" unicode="&#58881;" d="M1024 384c0 282.763636-229.236364 512-512 512C229.236364 896 0 666.763636 0 384s229.236364-512 512-512C794.763636-128 1024 101.23636399999998 1024 384zM374.504727 384L374.504727 481.978182l60.043636 0L434.548364 541.230545c0 79.918545 23.877818 137.495273 111.383273 137.495273l104.075636 0 0-97.745455-73.262545 0c-36.724364 0-45.056-24.389818-45.056-49.943273l0-49.058909 112.919273 0L629.201455 384l-97.512727 0 0-295.517091L434.548364 88.48290899999995 434.548364 384 374.504727 384z" horiz-adv-x="1024" />
<glyph glyph-name="twitter" unicode="&#60202;" d="M958.293333 640C925.44 625.066667 890.026667 615.253333 853.333333 610.56 890.88 633.173333 919.893333 669.013333 933.546667 712.106667 898.133333 690.773333 858.88 675.84 817.493333 667.306667 783.786667 704 736.426667 725.333333 682.666667 725.333333 582.4 725.333333 500.48 643.413333 500.48 542.293333 500.48 527.786667 502.186667 513.706667 505.173333 500.48 353.28 508.16 218.026667 581.12 128 691.626667 112.213333 664.746667 103.253333 633.173333 103.253333 599.893333 103.253333 536.32 135.253333 480 184.746667 448 154.453333 448 126.293333 456.533333 101.546667 469.333333 101.546667 469.333333 101.546667 469.333333 101.546667 468.053333 101.546667 379.306667 164.693333 305.066667 248.32 288.426667 232.96 284.16 216.746667 282.026667 200.106667 282.026667 188.586667 282.026667 177.066667 283.306667 165.973333 285.44 189.013333 213.333333 256 159.573333 336.64 158.293333 274.346667 108.8 195.413333 79.786667 109.226667 79.786667 94.72 79.786667 80.213333 80.64 65.706667 82.346667 146.773333 30.293333 243.2 0 346.453333 0 682.666667 0 867.413333 279.04 867.413333 520.96 867.413333 529.066667 867.413333 536.746667 866.986667 544.853333 902.826667 570.453333 933.546667 602.88 958.293333 640Z" horiz-adv-x="1024" />
<glyph glyph-name="love" unicode="&#59205;" d="M513.401929 17.369855c-20.164249 0-207.085452 164.513868-289.018509 253.203816-46.00273 49.79715-91.849918 133.603881-91.849918 194.943924 0 130.201387 94.799086 236.113579 211.332173 236.113579 71.160713 0 131.555222-59.236126 168.815847-120.437 37.260625 61.200874 97.632621 120.437 168.814824 120.437 116.526947 0 211.32808-105.912192 211.32808-236.113579 0-61.476143-41.280172-148.617829-92.28073-195.33585C710.48047 187.678706 534.73991 17.369855 513.401929 17.369855z" horiz-adv-x="1024" />
<glyph glyph-name="github" unicode="&#59154;" d="M950.857143 384q0-143.428571-83.714286-258t-216.285714-158.571429q-15.428571-2.857143-22.571429 4t-7.142857 17.142857l0 120.571429q0 55.428571-29.714286 81.142857 32.571429 3.428571 58.571429 10.285714t53.714286 22.285714 46.285714 38 30.285714 60 11.714286 86q0 69.142857-45.142857 117.714286 21.142857 52-4.571429 116.571429-16 5.142857-46.285714-6.285714t-52.571429-25.142857l-21.714286-13.714286q-53.142857 14.857143-109.714286 14.857143t-109.714286-14.857143q-9.142857 6.285714-24.285714 15.428571t-47.714286 22-49.142857 7.714286q-25.142857-64.571429-4-116.571429-45.142857-48.571429-45.142857-117.714286 0-48.571429 11.714286-85.714286t30-60 46-38.285714 53.714286-22.285714 58.571429-10.285714q-22.857143-20.571429-28-58.857143-12-5.714286-25.714286-8.571429t-32.571429-2.857143-37.428571 12.285714-31.714286 35.714286q-10.857143 18.285714-27.714286 29.714286t-28.285714 13.714286l-11.428571 1.714286q-12 0-16.571429-2.571429t-2.857143-6.571429 5.142857-8 7.428571-6.857143l4-2.857143q12.571429-5.714286 24.857143-21.714286t18-29.142857l5.714286-13.142857q7.428571-21.714286 25.142857-35.142857t38.285714-17.142857 39.714286-4 31.714286 2l13.142857 2.285714q0-21.714286 2.857143-50.857143t2.857143-30.857143q0-10.285714-7.428571-17.142857t-22.857143-4q-132.571429 44-216.285714 158.571429t-83.714286 258q0 119.428571 58.857143 220.285714t159.714286 159.714286 220.285714 58.857143 220.285714-58.857143 159.714286-159.714286 58.857143-220.285714z" horiz-adv-x="1024" />
<glyph glyph-name="up" unicode="&#59216;" d="M371.812167 531.537218 150.102646 309.829743c-32.651654-32.652677-32.651654-85.591377 0-118.243031 32.652677-32.652677 85.591377-32.652677 118.244055 0L478.589053 402.272155c17.272385 15.095813 44.333718 17.229406 61.45363 0l211.132628-210.686467c32.652677-32.652677 85.590354-32.652677 118.242008 0 32.652677 32.652677 32.652677 85.591377 0 118.243031L647.712915 531.533125C552.787962 626.460124 471.375767 631.101841 371.812167 531.537218L371.812167 531.537218zM371.812167 531.537218" horiz-adv-x="1024" />
<glyph glyph-name="left" unicode="&#58890;" d="M691.908-53.511l75.37 89.491c10.964 12.998 10.285 32.865-1.499 44.379l-286.279 300.374 277.935 310.327c11.338 12.191 11.035 32.285-0.639 44.85l-80.467 86.565c-11.68 12.584-30.356 12.894-41.663 0.716l-377.433-421.426c-11.332-12.183-11.041-32.267 0.658-44.844l80.467-86.565c1.772-1.911 3.706-3.533 5.751-4.877l306.62-321.704c11.776-11.501 30.216-10.304 41.179 2.714z" horiz-adv-x="1024" />
<glyph glyph-name="folder" unicode="&#58936;" d="M170.666667 810.666667l213.333333 0 85.333333-128 384 0q52.992 0 90.496-37.504t37.504-90.496l0-469.333333q0-52.992-37.504-90.496t-90.496-37.504l-682.666667 0q-52.992 0-90.496 37.504t-37.504 90.496l0 597.333333q0 52.992 37.504 90.496t90.496 37.504zM423.68 597.333333l-82.346667 128-170.666667 0q-17.664 0-30.165333-12.501333t-12.501333-30.165333l0-597.333333q0-17.664 12.501333-30.165333t30.165333-12.501333l682.666667 0q17.664 0 30.165333 12.501333t12.501333 30.165333l0 469.333333q0 17.664-12.501333 30.165333t-30.165333 12.501333l-429.653333 0z" horiz-adv-x="1024" />
<glyph glyph-name="close" unicode="&#59093;" d="M887.2 121.8 624.8 385.2l263 260c10.8 10.8 10.8 28.4 0 39.2l-74.8 75.2c-5.2 5.2-12.2 8-19.6 8-7.4 0-14.4-3-19.6-8L512 500.4 249.8 759.4c-5.2 5.2-12.2 8-19.6 8-7.4 0-14.4-3-19.6-8L136 684.2c-10.8-10.8-10.8-28.4 0-39.2l263-260L136.8 121.8c-5.2-5.2-8.2-12.2-8.2-19.6 0-7.4 2.8-14.4 8.2-19.6l74.8-75.2c5.4-5.4 12.4-8.2 19.6-8.2 7 0 14.2 2.6 19.6 8.2L512 269.8l261.4-262.2c5.4-5.4 12.4-8.2 19.6-8.2 7 0 14.2 2.6 19.6 8.2l74.8 75.2c5.2 5.2 8.2 12.2 8.2 19.6C895.4 109.6 892.4 116.6 887.2 121.8z" horiz-adv-x="1024" />
<glyph glyph-name="dribbble" unicode="&#59030;" d="M748.076 24.048c-4.827 27.348-27.348 157.662-83.658 318.542 135.137 22.523 254.189-14.478 268.669-19.305-17.696-123.879-86.874-231.666-185.012-299.236zM506.757-53.175c-99.747 0-191.446 35.394-265.452 94.919 8.043 16.090 94.919 191.446 339.456 278.321 1.609 0 1.609 0 3.219 1.609 61.134-162.49 85.266-299.236 91.7-337.849-51.483-24.132-109.398-37.003-168.924-37.003zM73.989 394.070v12.87c19.305 0 228.449-3.219 444.029 62.742 12.87-25.741 24.132-49.872 35.394-75.615-6.434-1.609-11.263-3.219-17.696-4.827-223.622-74.004-341.065-276.714-352.325-294.411-65.962 80.441-109.398 185.012-109.398 299.236zM323.352 797.88c11.263-16.090 88.485-127.095 160.88-257.409-202.708-54.7-381.285-54.7-400.59-54.7 27.348 138.356 119.053 252.582 239.712 312.108zM506.757 839.71c109.398 0 210.752-41.828 286.366-112.617-8.043-11.263-72.396-101.356-226.841-160.88-70.787 133.531-149.619 244.537-160.88 260.625 32.174 8.043 65.962 12.87 101.356 12.87zM841.384 675.611c59.525-75.615 96.527-172.142 98.137-278.321-14.478 3.219-157.662 33.786-300.846 14.478-3.219 8.043-6.434 16.090-9.653 22.523-9.653 22.523-19.305 43.437-28.959 64.353 160.88 69.178 233.277 164.097 241.321 176.967z" horiz-adv-x="1024" />
<glyph glyph-name="instagram" unicode="&#59062;" d="M658.285714 384q0 60.571429-42.857143 103.428571t-103.428571 42.857143-103.428571-42.857143-42.857143-103.428571 42.857143-103.428571 103.428571-42.857143 103.428571 42.857143 42.857143 103.428571z m78.857143 0q0-93.714286-65.714286-159.428571t-159.428571-65.714286-159.428571 65.714286-65.714286 159.428571 65.714286 159.428571 159.428571 65.714286 159.428571-65.714286 65.714286-159.428571z m61.714286 234.285714q0-21.714286-15.428572-37.142857t-37.142857-15.428571-37.142857 15.428571-15.428571 37.142857 15.428571 37.142857 37.142857 15.428572 37.142857-15.428572 15.428572-37.142857zM512 744q-4 0-43.714286 0.285714t-60.285714 0-55.142857-1.714285-58.857143-5.714286T253.142857 726.285714q-28.571429-11.428571-50.285714-33.142857t-33.142857-50.285714q-6.285714-16.571429-10.571429-40.857143t-5.714286-58.857143-1.714285-55.142857 0-60.285714 0.285714-43.714286-0.285714-43.714286 0-60.285714 1.714285-55.142857 5.714286-58.857143T169.714286 125.142857q11.428571-28.571429 33.142857-50.285714t50.285714-33.142857q16.571429-6.285714 40.857143-10.571429t58.857143-5.714286 55.142857-1.714285 60.285714 0 43.714286 0.285714 43.714286-0.285714 60.285714 0 55.142857 1.714285 58.857143 5.714286 40.857143 10.571429q28.571429 11.428571 50.285714 33.142857t33.142857 50.285714q6.285714 16.571429 10.571429 40.857143t5.714286 58.857143 1.714285 55.142857 0 60.285714-0.285714 43.714286 0.285714 43.714286 0 60.285714-1.714285 55.142857-5.714286 58.857143T854.285714 642.857143q-11.428571 28.571429-33.142857 50.285714t-50.285714 33.142857q-16.571429 6.285714-40.857143 10.571429t-58.857143 5.714286-55.142857 1.714285-60.285714 0-43.714286-0.285714z m438.857143-360q0-130.857143-2.857143-181.142857-5.714286-118.857143-70.857143-184t-184-70.857143q-50.285714-2.857143-181.142857-2.857143t-181.142857 2.857143q-118.857143 5.714286-184 70.857143T76 202.857143q-2.857143 50.285714-2.857143 181.142857t2.857143 181.142857q5.714286 118.857143 70.857143 184t184 70.857143q50.285714 2.857143 181.142857 2.857143t181.142857-2.857143q118.857143-5.714286 184-70.857143t70.857143-184q2.857143-50.285714 2.857143-181.142857z" horiz-adv-x="1024" />
<glyph glyph-name="tumblr" unicode="&#58911;" d="M512-128c282.76736 0 512 229.23264 512 512S794.76736 896 512 896 0 666.76736 0 384s229.23264-512 512-512z m16.67072 821.57568v-157.77792h148.13184v-97.97632h-148.13184v-160.07168c0-36.18816 1.92512-59.43296 5.75488-69.69344 3.82976-10.28096 10.97728-18.47296 21.4016-24.61696 13.78304-8.27392 29.5936-12.41088 47.37024-12.41088 31.58016 0 63.01696 10.26048 94.3104 30.80192V103.42399999999998c-26.68544-12.57472-50.83136-21.4016-72.45824-26.46016-21.62688-5.05856-44.99456-7.5776-70.144-7.5776-28.52864 0-53.73952 3.60448-75.6736 10.81344-21.9136 7.18848-40.63232 17.46944-56.1152 30.80192-15.50336 13.35296-26.2144 27.52512-32.21504 42.55744-5.98016 15.03232-8.97024 36.80256-8.97024 65.3312v218.9312H312.9344V526.1312c24.53504 7.9872 45.54752 19.41504 63.01696 34.28352a171.4176 171.4176 0 0 1 42.10688 53.57568c10.56768 20.86912 17.85856 47.39072 21.83168 79.58528h88.7808z" horiz-adv-x="1024" />
<glyph glyph-name="telegram" unicode="&#59185;" d="M679.424 149.138286l84.004571 395.995428c7.424 34.852571-12.580571 48.566857-35.437714 40.009143l-493.714286-190.281143c-33.718857-13.129143-33.133714-32-5.705142-40.557714l126.281142-39.424 293.156572 184.576c13.714286 9.142857 26.294857 3.986286 16.018286-5.156571l-237.129143-214.272-9.142857-130.304c13.129143 0 18.870857 5.705143 25.709714 12.580571l61.696 59.428571 128-94.281142c23.442286-13.129143 40.009143-6.290286 46.299428 21.723428zM1024 384c0-282.843429-229.156571-512-512-512S0 101.156571 0 384 229.156571 896 512 896s512-229.156571 512-512z" horiz-adv-x="1024" />
<glyph glyph-name="xihuan" unicode="&#59503;" d="M669.781333 765.248c71.637333 11.093333 138.901333-11.477333 193.344-64.533333 55.317333-53.930667 81.834667-124.992 74.282667-199.530667-7.466667-73.642667-46.549333-146.368-112.32-210.474667-18.346667-17.898667-67.669333-66.218667-138.453333-135.637333-31.829333-31.232-65.706667-64.448-99.84-97.984L553.6 24.533333l-13.184-12.949333a40.554667 40.554667 0 0 0-56.832 0l-114.602667 112.64-24.213333 23.722667a677626.346667 677626.346667 0 0 1-145.856 142.762666C133.141333 354.816 94.08 427.52 86.613333 501.184c-7.552 74.538667 18.944 145.6 74.282667 199.530667 54.442667 53.056 121.706667 75.605333 193.344 64.533333 53.162667-8.213333 107.093333-34.688 157.781333-76.949333 50.709333 42.24 104.618667 68.736 157.781334 76.949333z" horiz-adv-x="1024" />
<glyph glyph-name="xihuan1" unicode="&#59504;" d="M523.733333 54.976l33.173334 32.576 99.690666 97.813333c70.976 69.632 120.32 117.973333 138.709334 135.893334 59.008 57.514667 93.248 121.28 99.626666 184.234666 6.250667 61.44-15.488 119.744-61.589333 164.672-44.992 43.84-98.88 61.909333-157.034667 52.906667-49.365333-7.616-101.034667-34.624-150.016-78.848a21.333333 21.333333 0 0 0-28.586666 0c-48.981333 44.224-100.650667 71.232-150.016 78.869333-58.154667 8.96-112.042667-9.088-157.034667-52.928-46.101333-44.928-67.84-103.210667-61.610667-164.693333 6.4-62.933333 40.64-126.72 99.648-184.213333a100207.573333 100207.573333 0 0 0 145.92-142.826667l24.256-23.765333L512 43.477333l11.733333 11.498667z m-11.733333-11.52l-1.493333-1.429333A2.133333 2.133333 0 0 0 512 42.666667c0.512 0 1.045333-0.213333 1.493333-0.64l-1.493333 1.450666z m157.781333 721.792c71.637333 11.093333 138.901333-11.477333 193.344-64.533333 55.317333-53.930667 81.834667-124.992 74.282667-199.530667-7.466667-73.642667-46.549333-146.368-112.32-210.474667-18.346667-17.898667-67.669333-66.218667-138.453333-135.637333-31.829333-31.232-65.706667-64.448-99.84-97.984L553.6 24.533333l-13.184-12.949333a40.554667 40.554667 0 0 0-56.832 0l-114.602667 112.64-24.213333 23.722667a677626.346667 677626.346667 0 0 1-145.856 142.762666C133.141333 354.816 94.08 427.52 86.613333 501.184c-7.552 74.538667 18.944 145.6 74.282667 199.530667 54.442667 53.056 121.706667 75.605333 193.344 64.533333 53.162667-8.213333 107.093333-34.688 157.781333-76.949333 50.709333 42.24 104.618667 68.736 157.781334 76.949333z" horiz-adv-x="1024" />
<glyph glyph-name="right" unicode="&#59101;" d="M803.758 381.983c-0.001 0.311-0.013 0.622-0.018 0.933-0.162 23.974-9.386 47.811-27.743 65.903-0.084 0.082-0.172 0.157-0.256 0.239-0.154 0.154-0.296 0.315-0.451 0.468L417.861 801.904c-37.685 37.153-99.034 37.476-136.331 0.718-37.297-36.758-36.979-97.231 0.707-134.384l290.361-286.257-290.362-286.257c-37.685-37.153-38.004-97.625-0.707-134.383 37.297-36.758 98.646-36.435 136.331 0.718l357.43 352.378c0.155 0.153 0.297 0.314 0.451 0.468 0.084 0.082 0.172 0.157 0.256 0.239 18.354 18.089 27.578 41.922 27.743 65.892 0.004 0.315 0.017 0.631 0.018 0.947z" horiz-adv-x="1024" />
<glyph glyph-name="medium-circle-fill" unicode="&#59527;" d="M512 832C264.6 832 64 631.4 64 384s200.6-448 448-448 448 200.6 448 448S759.4 832 512 832z m256-253.7l-40.8-39.1c-3.6-2.7-5.3-7.1-4.6-11.4v-287.7c-0.7-4.4 1-8.8 4.6-11.4l40-39.1v-8.7H566.4v8.3l41.3 40.1c4.1 4.1 4.1 5.3 4.1 11.4V473.5l-115-291.6h-15.5L347.5 473.5V278c-1.2-8.2 1.7-16.5 7.5-22.4l53.8-65.1v-8.7H256v8.7l53.8 65.1c5.8 5.9 8.3 14.3 7 22.4V504c0.7 6.3-1.7 12.4-6.5 16.7l-47.8 57.6V587H411l114.6-251.5 100.9 251.3H768v-8.5z" horiz-adv-x="1024" />
</font>
</defs></svg>

After

Width:  |  Height:  |  Size: 20 KiB

BIN
static/font/iconfont.ttf Normal file

Binary file not shown.

BIN
static/font/iconfont.woff Normal file

Binary file not shown.

30
theme.toml Normal file
View File

@ -0,0 +1,30 @@
# theme.toml template for a Hugo theme
# See https://github.com/gohugoio/hugoThemes#themetoml for an example
name = "Covey"
license = "MIT"
licenselink = "https://github.com/liuzc/LeaveIt/blob/master/LICENSE"
description = "A simple, clean blog theme for hugo."
homepage = "https://liuzhichao.com/"
tags = [
"blog",
"minimal",
"clean",
"responsive",
"gallery",
"dark",
"theme"
]
features = [
"cover-image",
"favicon",
"multilingual",
"pagination",
"social-menu",
"syntax-highlighting",
]
min_version = "0.41"
[author]
name = "LiuZhichao"
homepage = "https://liuzhichao.com/"