feat(exampleSite): add some posts to exampleSite

This commit is contained in:
Dillon 2020-02-01 19:47:58 +08:00
parent 8aa4b6dce6
commit 437ef95e14
25 changed files with 343 additions and 142 deletions

View file

@ -1,35 +1,37 @@
html {
font-family: $global-font-family;
}
/* scrollbar, only support webkit */
&::-webkit-scrollbar {
width: 8px;
height: 8px;
}
/* scrollbar, only support webkit */
::-webkit-scrollbar {
width: 6px;
height: 6px;
}
&::-webkit-scrollbar-thumb {
height: 40px;
background-color: #87878D;
border-radius: 16px;
::-webkit-scrollbar-thumb {
background-color: $scrollbar-color;
&:hover {
background-color: #A9A9B3;
}
&:hover {
background-color: $scrollbar-hover-color;
}
}
::selection {
background: rgba(0, 149, 255, 0.1);
background: $selection-color;
.dark-theme & {
background: $selection-color-dark;
}
}
body {
font-size: 16px;
font-weight: 400;
line-height: 26px;
line-height: 1.5rem;
background-color: $global-background-color;
color: $global-font-color;
&:before {
&::before {
content: "";
background-repeat: no-repeat;
background-position: center;

View file

@ -2,17 +2,17 @@
.wrapper {
display: flex;
flex-direction: column;
min-height: 98vh;
min-height: 97.5vh;
width: 100%;
}
.main {
flex: 1 0 auto;
}
main {
flex: 1 0 auto;
.container {
padding-left: 1rem;
padding-right: 1rem;
.container {
padding-left: 1rem;
padding-right: 1rem;
}
}
}
.footer {
@ -27,4 +27,4 @@
font-size: 2rem;
transform: translateY(35vh);
text-align: center;
}
}

View file

@ -1,5 +1,5 @@
@media only screen and (max-width: 1800px) {
.warpper {
.page {
max-width: 780px;
.post-toc {
@ -10,7 +10,7 @@
}
@media only screen and (max-width: 1440px) {
.warpper {
.page {
max-width: 680px;
.post-toc {
@ -21,7 +21,7 @@
}
@media only screen and (max-width: 1200px) {
.warpper {
.page {
max-width: 560px;
.post-toc {
@ -38,7 +38,7 @@
}
}
.warpper {
.page {
max-width: 80%;
.post-toc {
@ -60,7 +60,7 @@
display: block;
}
.warpper {
.page {
max-width: 100%;
.categories-card {

View file

@ -1,6 +1,6 @@
@import "_home";
.warpper {
.page {
position: relative;
width: 100%;
max-width: 980px;

View file

@ -138,6 +138,14 @@
.table-wrapper {
overflow-x: auto;
&::-webkit-scrollbar {
background-color: $table-background-color;
.dark-theme & {
background-color: $table-background-color-dark;
}
}
> table {
width: 100%;
max-width: 100%;

View file

@ -1,19 +1,9 @@
code,
pre {
padding: 7px;
font-size: $code-font-size;
font-family: $code-font-family;
background: $code-background-color;
.dark-theme & {
background: $code-background-color-dark;
}
}
code {
padding: 3px 5px;
border-radius: 4px;
color: $code-color;
padding: 5px;
background: $code-background-color;
.dark-theme & {
@ -22,50 +12,46 @@ code {
}
}
p > code {
background: darken($code-background-color, 3%);
.dark-theme & {
color: $code-color-dark;
background: darken($code-background-color-dark, 3%);
}
.highlight > pre.chroma {
padding: 38px 7px 8px;
overflow-x: auto;
}
// chroma
.highlight > .chroma {
margin: 1em 0;
border-radius: 6px;
overflow-x: auto;
position: relative;
background: $code-background-color;
font-family: $code-font-family;
code {
padding: 0;
}
table {
position: relative;
pre {
margin: 0;
padding: 38px 7px 8px;
overflow-x: visible;
}
&::after {
position: absolute;
top: 0;
right: 0;
left: 0;
padding: 2px 7px;
font-size: $code-font-size;
font-weight: bold;
color: darken($code-info-color, 10%);
background: darken($code-background-color, 3%);
content: 'Code';
&::after {
position: absolute;
top: 0;
right: 0;
left: 0;
padding: 2px 7px;
font-size: $code-font-size;
font-weight: bold;
color: $code-info-color;
background: darken($code-background-color, 3%);
content: 'Code';
.dark-theme & {
background: darken($code-background-color-dark, 3%);
}
.dark-theme & {
color: $code-info-color-dark;
background: darken($code-background-color-dark, 3%);
}
}
@each $sign, $text in $code-type-list {
&.#{$sign} table::after {
&.#{$sign}::after {
content: $text;
}
}
@ -77,20 +63,10 @@ p > code {
&:first-child {
width: 10px;
pre {
margin: 0;
padding: 38px 7px 8px;
}
}
&:last-child {
vertical-align: top;
pre {
margin: 0;
padding: 38px 10px 8px;
}
}
}
@ -106,10 +82,14 @@ p > code {
}
}
/* LineNumbersTable */ .lnt { color: $code-info-color; }
/* LineHighlight */ .hl {
/* LineNumbersTable */
.lnt {
color: $code-info-color;
}
/* LineHighlight */
.hl {
display: block;
width: 100%;
background-color: darken($code-background-color, 5%);
.dark-theme & {

View file

@ -11,7 +11,7 @@ $global-font-family: Lato, -apple-system, BlinkMacSystemFont, PingFang-SC-Regula
$global-background-color: #fff !default;
$global-background-color-dark: #292a2d !default;
$navbar-background-color: #FAFAFA !default;
$navbar-background-color: #fafafa !default;
$navbar-background-color-dark: #252627 !default;
// Text color of the body.
@ -29,6 +29,12 @@ $global-link-hover-color-dark: #fff !default;
$global-border-color: #dcdcdc !default;
$global-border-color-dark: #4a4b50 !default;
$scrollbar-color: #87878d !default;
$scrollbar-hover-color: #a9a9b3 !default;
$selection-color: rgba(38, 139, 211, 0.2) !default;
$selection-color-dark: rgba(38, 139, 211, 0.3) !default;
$navbar-hover-color: #161209 !default;
$navbar-hover-color-dark: #fff !default;
@ -47,7 +53,7 @@ $table-background-color: #fff !default;
$table-background-color-dark: #272c34 !default;
// Color of the table thead.
$table-thead-color: #EDEDED !default;
$table-thead-color: #ededed !default;
$table-thead-color-dark: #20252b !default;
// ========== Code ========== //
@ -59,13 +65,16 @@ $code-color-dark: #E5BF78 !default;
$code-background-color: #f5f5f5 !default;
$code-background-color-dark: #272C34 !default;
$code-info-color: #cacaca !default;
$code-info-color: #b1b0b0 !default;
$code-info-color-dark: #b1b0b0 !default;
// Font size of code.
$code-font-size: 13px !default;
@import url('https://fonts.googleapis.com/css?family=Fira+Mono:400,700&display=swap&subset=latin-ext');
// Font family of the code.
$code-font-family: Source Code Pro, Consolas, Liberation Mono, Menlo, Courier, monospace !default;
$code-font-family: Fira Mono, Source Code Pro, Menlo, monospace !default;
// Code type list.
$code-type-list: (

View file

@ -1,4 +1,5 @@
@import "_variables";
@import "_custom";
@import "_core/normalize";
@import "_core/base";
@ -11,5 +12,3 @@
@import "_partial/pagination";
@import "_core/media";
@import "_custom";

View file

@ -1,25 +0,0 @@
---
title: "LoveIt Theme Preview and Documentation"
date: 2019-08-25T16:22:42+08:00
lastmod: 2019-08-25T16:22:42+08:00
draft: false
description: "This is a LoveIt theme preview and documentation page."
show_in_homepage: true
show_description: false
license: ""
tags: ["Hugo", "Theme"]
categories: ["Documentation"]
featured_image: ""
featured_image_preview: ""
comment: true
toc: true
auto_collapse_toc: true
math: true
---
This is a [LoveIt](https://github.com/dillonzq/LoveIt) theme preview and documentation page.
<!--more-->

View file

@ -0,0 +1,66 @@
---
author: "Hugo Authors"
author_link: "https://gohugo.io/"
title: "Emoji Support"
date: 2019-10-01T17:55:28+08:00
lastmod: 2019-10-01T17:55:28+08:00
draft: false
description: "Guide to emoji usage in Hugo"
show_in_homepage: true
show_description: false
license: ""
tags: [
"emoji",
]
categories: [
"theme",
]
featured_image: /images/emoji.jpg
featured_image_preview: ""
comment: true
toc: false
auto_collapse_toc: true
math: false
---
Emoji can be enabled in a Hugo project in a number of ways.
<!--more-->
The [`emojify`](https://gohugo.io/functions/emojify/) function can be called directly in templates or [Inline Shortcodes](https://gohugo.io/templates/shortcode-templates/#inline-shortcodes).
To enable emoji globally, set `enableEmoji` to `true` in your sites [configuration](https://gohugo.io/getting-started/configuration/) and then you can type emoji shorthand codes directly in content files; e.g.
<p><span class="nowrap"><span class="emojify">🙈</span> <code>:see_no_evil:</code></span> <span class="nowrap"><span class="emojify">🙉</span> <code>:hear_no_evil:</code></span> <span class="nowrap"><span class="emojify">🙊</span> <code>:speak_no_evil:</code></span></p>
<br>
The [Emoji cheat sheet](http://www.emoji-cheat-sheet.com/) is a useful reference for emoji shorthand codes.
***
**N.B.** The above steps enable Unicode Standard emoji characters and sequences in Hugo, however the rendering of these glyphs depends on the browser and the platform. To style the emoji you can either use a third party emoji font or a font stack; e.g.
{{< highlight html >}}
.emoji {
font-family: Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols;
}
{{< /highlight >}}
{{< css.inline >}}
<style>
.emojify {
font-family: Apple Color Emoji,Segoe UI Emoji,NotoColorEmoji,Segoe UI Symbol,Android Emoji,EmojiSymbols;
font-size: 2rem;
vertical-align: middle;
}
@media screen and (max-width:650px) {
.nowrap {
display: block;
margin: 25px 0;
}
}
</style>
{{< /css.inline >}}

View file

@ -2,8 +2,8 @@
author: "Hugo Authors"
author_link: "https://gohugo.io/"
title: "Markdown Syntax Guide"
date: 2020-01-30T21:57:40+08:00
lastmod: 2020-01-30T21:57:40+08:00
date: 2019-12-01T21:57:40+08:00
lastmod: 2020-01-01T16:45:40+08:00
draft: false
description: "Sample article showcasing basic Markdown syntax and formatting for HTML elements."
show_in_homepage: true
@ -14,10 +14,9 @@ tags: [
"markdown",
"css",
"html",
"themes",
]
categories: [
"themes",
"theme",
]
featured_image: /images/markdown.png
@ -26,7 +25,7 @@ featured_image_preview: ""
comment: true
toc: true
auto_collapse_toc: true
math: false
math: true
---
This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme.
@ -73,6 +72,8 @@ in-line changes such as annotations and abbreviations.
> Don't communicate by sharing memory, share memory by communicating.</p>
> — <cite>Rob Pike[^1]</cite>
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
## Tables
Tables aren't part of the core Markdown spec, but Hugo supports supports them out-of-the-box.
@ -88,11 +89,15 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
| ---------- | --------- | ----------------- | ---------- |
| *italics* | **bold** | ~~strikethrough~~&nbsp;&nbsp;&nbsp; | `code` |
## Code Blocks
## Code
### Inline code
Inline code: `print`
### Code block with backticks
```html
```html {hl_lines=["8-9"],linenostart=10}
<!DOCTYPE html>
<html lang="en">
<head>
@ -120,7 +125,7 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
### Code block with Hugo's internal highlight shortcode
{{< highlight html >}}
{{< highlight html "linenos=false" >}}
<!DOCTYPE html>
<html lang="en">
<head>
@ -155,15 +160,35 @@ Tables aren't part of the core Markdown spec, but Hugo supports supports them ou
## Other Elements — abbr, sub, sup, kbd, mark
<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.
* `abbr`
H<sub>2</sub>O
<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.
X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
* Or ruby annotation
Press <kbd><kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd></kbd> to end the session.
[GIF]^(Graphics Interchange Format) is a bitmap image format.
Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms,
and other small creatures.
* `sub`/`sup`
[^1]: The above quote is excerpted from Rob Pike's [talk](https://www.youtube.com/watch?v=PAAkCSZUG1c) during Gopherfest, November 18, 2015.
H<sub>2</sub>O
X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>
* Or `LaTex` formula
* Block
$$ H_2O $$
$$ X^n+Y^n=Z^n $$
* Inline: \\( H_2O \\) \\( X^n+Y^n=Z^n \\)
* `kbd`
Press <kbd><kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>Delete</kbd></kbd> to end the session.
* `mark`
Most <mark>salamanders</mark> are nocturnal, and hunt for insects, worms,
and other small creatures.

View file

@ -0,0 +1,76 @@
---
author: "Hugo Authors"
author_link: "https://gohugo.io/"
title: "Placeholder Text"
date: 2019-08-01T18:02:41+08:00
lastmod: 2019-08-01T18:02:41+08:00
draft: false
description: "Lorem Ipsum Dolor Si Amet"
show_in_homepage: true
show_description: false
license: ""
tags: [
"markdown",
"text",
]
categories: [
"theme",
]
featured_image: ""
featured_image_preview: ""
comment: true
toc: false
auto_collapse_toc: true
math: false
---
Lorem est tota propiore conpellat pectoribus de
pectora summo. <!--more-->Redit teque digerit hominumque toris verebor lumina non cervice
subde tollit usus habet Arctonque, furores quas nec ferunt. Quoque montibus nunc
caluere tempus inhospita parcite confusaque translucet patri vestro qui optatis
lumine cognoscere flos nubis! Fronde ipsamque patulos Dryopen deorum.
1. Exierant elisi ambit vivere dedere
2. Duce pollice
3. Eris modo
4. Spargitque ferrea quos palude
Rursus nulli murmur; hastile inridet ut ab gravi sententia! Nomine potitus
silentia flumen, sustinet placuit petis in dilapsa erat sunt. Atria
tractus malis.
1. Comas hunc haec pietate fetum procerum dixit
2. Post torum vates letum Tiresia
3. Flumen querellas
4. Arcanaque montibus omnes
5. Quidem et
## Vagus elidunt
<svg class="canon" xmlns="http://www.w3.org/2000/svg" overflow="visible" viewBox="0 0 496 373" height="373" width="496"><g fill="none"><path stroke="#000" stroke-width=".75" d="M.599 372.348L495.263 1.206M.312.633l494.95 370.853M.312 372.633L247.643.92M248.502.92l246.76 370.566M330.828 123.869V1.134M330.396 1.134L165.104 124.515"></path><path stroke="#ED1C24" stroke-width=".75" d="M275.73 41.616h166.224v249.05H275.73zM54.478 41.616h166.225v249.052H54.478z"></path><path stroke="#000" stroke-width=".75" d="M.479.375h495v372h-495zM247.979.875v372"></path><ellipse cx="498.729" cy="177.625" rx=".75" ry="1.25"></ellipse><ellipse cx="247.229" cy="377.375" rx=".75" ry="1.25"></ellipse></g></svg>
[The Van de Graaf Canon](https://en.wikipedia.org/wiki/Canons_of_page_construction#Van_de_Graaf_canon)
### Mane refeci capiebant unda mulcebat
Victa caducifer, malo vulnere contra
dicere aurato, ludit regale, voca! Retorsit colit est profanae esse virescere
furit nec; iaculi matertera et visa est, viribus. Divesque creatis, tecta novat collumque vulnus est, parvas. **Faces illo pepulere** tempus adest. Tendit flamma, ab opes virum sustinet, sidus sequendo urbis.
Iubar proles corpore raptos vero auctor imperium; sed et huic: manus caeli
Lelegas tu lux. Verbis obstitit intus oblectamina fixis linguisque ausus sperare
Echionides cornuaque tenent clausit possit. Omnia putatur. Praeteritae refert
ausus; ferebant e primus lora nutat, vici quae mea ipse. Et iter nil spectatae
vulnus haerentia iuste et exercebat, sui et.
Eurytus Hector, materna ipsumque ut Politen, nec, nate, ignari, vernum cohaesit sequitur. Vel **mitis temploque** vocatus, inque alis, *oculos nomen* non silvis corpore coniunx ne displicet illa. Crescunt non unus, vidit visa quantum inmiti flumina mortis facto sic: undique a alios vincula sunt iactata abdita! Suspenderat ego fuit tendit: luna, ante urbem
Propoetides **parte**.
{{< css.inline >}}
<style>
.canon { background: white; width: 100%; height: auto;}
</style>
{{< /css.inline >}}

View file

@ -0,0 +1,61 @@
---
author: "Hugo Authors"
author_link: "https://gohugo.io/"
title: "Rich Content"
date: 2019-09-01T18:06:32+08:00
lastmod: 2019-09-01T18:06:32+08:00
draft: false
description: "A brief description of Hugo Shortcodes"
show_in_homepage: true
show_description: false
license: ""
tags: [
"shortcodes",
"privacy",
]
categories: [
"theme",
]
featured_image: /images/hugo.png
featured_image_preview: ""
comment: true
toc: false
auto_collapse_toc: true
math: false
---
Hugo ships with several [Built-in Shortcodes](https://gohugo.io/content-management/shortcodes/#use-hugo-s-built-in-shortcodes) for rich content, along with a [Privacy Config](https://gohugo.io/about/hugo-and-gdpr/) and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds.
<!--more-->
---
## Instagram Simple Shortcode
{{< instagram_simple BGvuInzyFAe hidecaption >}}
<br>
---
## YouTube Privacy Enhanced Shortcode
{{< youtube ZJthWmvUzzc >}}
<br>
---
## Twitter Simple Shortcode
{{< twitter_simple 1085870671291310081 >}}
<br>
---
## Vimeo Simple Shortcode
{{< vimeo_simple 48912912 >}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View file

@ -6,5 +6,5 @@
target="_blank"
{{ end -}}
>
{{- .Text -}}
{{- .Text | safeHTML -}}
</a>

View file

@ -4,7 +4,7 @@
{{- define "content" -}}
{{- $data := .Data -}}
<div class="warpper archive">
<div class="page archive">
<h2 class="post-title animated pulse faster">
{{- T "all" | humanize}}{{ T .Section | default .Section | humanize -}}
</h2>

View file

@ -1,7 +1,7 @@
{{- define "title" }}{{ .Title }} | {{ .Site.Title }}{{ end -}}
{{- define "content" -}}
<div class="warpper single">
<div class="page single">
<h1 class="post-title animated pulse faster">
{{- .Title -}}
</h1>

View file

@ -28,7 +28,7 @@
{{- $name := . -}}
{{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}}
<i class="far fa-folder fa-fw"></i>
<a href="{{ .Permalink }}">{{ $name }}</a>
<a href="{{ .Permalink }}">{{ $name | humanize }}</a>
{{- end -}}
{{- end -}}
</span>

View file

@ -1,6 +1,6 @@
{{- define "content" -}}
{{- if eq .Site.Params.home_mode "post" -}}
<div class="warpper">
<div class="page">
{{- partial "home/profile.html" . -}}
{{- $paginator := where .Site.RegularPages "Type" "posts" -}}

View file

@ -5,7 +5,7 @@
{{- $author := .Params.author | default .Site.Author.name -}}
{{- $author_link := .Params.author_link | default .Site.Author.link | default .Site.BaseURL -}}
<article class="warpper">
<article class="page">
<h1 class="post-title animated flipInX">{{ .Title }}</h1>
<div class="post-meta">
@ -19,7 +19,7 @@
{{- range . -}}
{{- $name := . -}}
{{- with $.Site.GetPage "taxonomy" (printf "categories/%s" $name) | default ($.Site.GetPage "taxonomy" (printf "categories/%s" ($name | urlize))) -}}
<i class="far fa-folder fa-fw"></i><a href="{{ .Permalink }}">{{ $name }}</a>
<i class="far fa-folder fa-fw"></i><a href="{{ .Permalink }}">{{ $name | humanize }}</a>
{{- end -}}
{{- end -}}
</span>

View file

@ -3,13 +3,13 @@
{{- end -}}
{{- define "content" -}}
<div class="warpper archive">
<div class="page archive">
<h2 class="post-title animated pulse faster">
{{- $taxonomy := .Data.Singular -}}
{{- if eq $taxonomy "category" -}}
<i class="far fa-folder-open fa-fw"></i>&nbsp;{{ .Title }}
<i class="far fa-folder-open fa-fw"></i>&nbsp;{{ humanize .Title }}
{{- else if eq $taxonomy "tag" -}}
<i class="fas fa-tag fa-fw"></i>&nbsp;{{ .Title }}
<i class="fas fa-tag fa-fw"></i>&nbsp;{{ humanize .Title }}
{{- else -}}
{{- printf "%s - %s" (T $taxonomy | default (humanize $taxonomy)) .Title -}}
{{- end -}}

View file

@ -1,5 +1,5 @@
{{- define "title" -}}
{{- T "all" | humanize}}{{ T .Data.Plural | default .Data.Plural | humanize }} | {{ .Site.Title -}}
{{- T "all" | humanize }}{{ T .Data.Plural | default .Data.Plural | humanize }} | {{ .Site.Title -}}
{{- end -}}
{{- define "content" -}}
@ -7,7 +7,7 @@
{{- $terms := .Data.Terms.ByCount -}}
{{- $type := .Type -}}
<div class="warpper archive">
<div class="page archive">
<h2 class="post-title animated pulse faster">
{{- T "all" | humanize}}{{ T $taxonomies | default $taxonomies | humanize -}}
</h2>

File diff suppressed because one or more lines are too long

View file

@ -22,7 +22,7 @@ features = [
"syntax-highlighting",
"SEO Optimized"
]
min_version = "0.53"
min_version = "0.62.0"
[author]
name = "Dillon"