Update theme (LoveIt) + Add new fields

This commit is contained in:
Daniel Mason 2025-02-23 12:23:14 +13:00
parent ec90ebd36e
commit 49c98d8fb5
Signed by: idanoo
GPG key ID: 387387CDBC02F132
87 changed files with 6900 additions and 6013 deletions

View file

@ -3,7 +3,7 @@
[
"@babel/preset-env",
{
"targets": "> 0.25%, not dead"
"targets": "> 0.01%"
}
]
]

View file

@ -1,17 +1,37 @@
version: 2.1
executors:
hugo:
parameters:
version:
description: "version tag"
type: string
docker:
- image: cibuilds/hugo:<<parameters.version>>
jobs:
build-check:
docker:
- image: cibuilds/hugo:0.62
parameters:
version:
description: "version tag"
type: string
executor:
name: hugo
version: <<parameters.version>>
working_directory: ~/LoveIt
steps:
- checkout
- run: git submodule sync
- run: git submodule update --init
- run: hugo --source=exampleSite -v --gc
- run: htmlproofer exampleSite/public --check-html --allow-hash-href --empty-alt-ignore --disable-external
- run: hugo --source exampleSite --gc --minify --environment production
- run: htmlproofer exampleSite/public --disable-external true --ignore-missing-alt true
workflows:
build-check-exampleSite:
build-check:
jobs:
- build-check
- build-check:
name: build-check-min
version: 0.128.0
- build-check:
name: build-check-max
version: 0.144.2

View file

@ -1,4 +1,4 @@
#!/bin/zsh
. "$(dirname "$0")/_/husky.sh"
npm run build && npm run copy && git add resources assets/js
npm run compile && npm run compile-lunr-segmentit && npm run hugo-production && npm run copy-resources && git add resources assets

View file

@ -1,9 +1,9 @@
# LoveIt Theme | Hugo [![Netlify Status](https://api.netlify.com/api/v1/badges/e60303f2-862c-4342-bf59-7c9adb10812e/deploy-status)](https://app.netlify.com/sites/hugo-loveit/deploys)
# LoveIt Theme | Hugo
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/releases)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.62.0-ff4088?style=flat-square&logo=hugo)](https://gohugo.io/)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.128.0-ff4088?style=flat-square&logo=hugo)](https://gohugo.io/)
[![License](https://img.shields.io/github/license/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/blob/master/LICENSE)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dillonzq_LoveIt&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=dillonzq_LoveIt)
[![Netlify Status](https://api.netlify.com/api/v1/badges/e60303f2-862c-4342-bf59-7c9adb10812e/deploy-status)](https://app.netlify.com/sites/hugo-loveit/deploys)
[![CircleCI](https://circleci.com/gh/dillonzq/LoveIt/tree/master.svg?style=svg)](https://circleci.com/gh/dillonzq/LoveIt/tree/master)
English README | [简体中文说明](https://github.com/dillonzq/LoveIt/blob/master/README.zh-cn.md)
@ -85,7 +85,7 @@ I hope you will LoveIt ❤️!
* **Gravatar** supported by [Gravatar](https://gravatar.com)
* Local **Avatar** supported
* Up to **73** social links supported
* Up to **76** social links supported
* Up to **24** share sites supported
* **Disqus** comment system supported by [Disqus](https://disqus.com)
* **Gitalk** comment system supported by [Gitalk](https://github.com/gitalk/gitalk)
@ -137,7 +137,7 @@ LoveIt supports the following languages:
* Traditional Chinese
* French
* Polish
* Brazilian Portuguese
* Portuguese (Brazil)
* Italian
* Spanish
* German
@ -153,6 +153,8 @@ LoveIt supports the following languages:
* Turkish
* Korean
* Hindi
* Dutch
* Bengali
* [Contribute with a new language](https://github.com/dillonzq/LoveIt/pulls)
[Languages Compatibility](https://hugoloveit.com/theme-documentation-basics/#language-compatibility)

View file

@ -1,9 +1,9 @@
# LoveIt 主题 | Hugo [![Netlify Status](https://api.netlify.com/api/v1/badges/e60303f2-862c-4342-bf59-7c9adb10812e/deploy-status)](https://app.netlify.com/sites/hugo-loveit/deploys)
# LoveIt 主题 | Hugo
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/releases)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.62.0-ff4088?style=flat-square&logo=hugo)](https://gohugo.io/)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.128.0-ff4088?style=flat-square&logo=hugo)](https://gohugo.io/)
[![License](https://img.shields.io/github/license/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/blob/master/LICENSE)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=dillonzq_LoveIt&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=dillonzq_LoveIt)
[![Netlify Status](https://api.netlify.com/api/v1/badges/e60303f2-862c-4342-bf59-7c9adb10812e/deploy-status)](https://app.netlify.com/sites/hugo-loveit/deploys)
[![CircleCI](https://circleci.com/gh/dillonzq/LoveIt/tree/master.svg?style=svg)](https://circleci.com/gh/dillonzq/LoveIt/tree/master)
[English README](https://github.com/dillonzq/LoveIt/blob/master/README.md) | 简体中文说明
@ -62,7 +62,7 @@
* 支持 **[Fathom Analytics](https://usefathom.com/)**
* 支持 **[Plausible Analytics](https://plausible.io/)**
* 支持 **[Yandex Metrica](https://metrica.yandex.com/)**
* 支持搜索引擎的**网站验证** (Google, Bind, Yandex and Baidu)
* 支持搜索引擎的**网站验证** (Google, Bind, Yandex Baidu)
* 支持所有第三方库的 **CDN**
* 基于 [lazysizes](https://github.com/aFarkas/lazysizes) 自动转换图片为**懒加载**
@ -80,7 +80,7 @@
* 支持 **[Gravatar](https://gravatar.com)** 头像
* 支持本地**头像**
* 支持多达 **73** 种社交链接
* 支持多达 **76** 种社交链接
* 支持多达 **24** 种网站分享
* 支持 **[Disqus](https://disqus.com)** 评论系统
* 支持 **[Gitalk](https://github.com/gitalk/gitalk)** 评论系统
@ -132,7 +132,7 @@ LoveIt 支持下列语言:
* 繁体中文
* 法语
* 波兰语
* 巴西葡萄牙语
* 葡萄牙语(巴西)
* 意大利语
* 西班牙语
* 德语
@ -148,6 +148,8 @@ LoveIt 支持下列语言:
* 土耳其语
* 韩语
* 印地语
* 荷兰语
* 孟加拉语
* [贡献一种新的语言](https://github.com/dillonzq/LoveIt/pulls)
[语言兼容性](https://hugoloveit.com/zh-cn/theme-documentation-basics/#language-compatibility)

View file

@ -29,6 +29,7 @@ rssFullText: false
toc:
enable: true
auto: true
keepStatic: false
code:
copy: true
maxShownLines: 50

View file

@ -328,7 +328,7 @@ header {
&.open {
.header-wrapper {
margin-top: -var(--header-height);
margin-top: calc(0px - var(--header-height));
}
.menu {

View file

@ -1,10 +1,16 @@
@media only screen and (max-width: 1440px) {
.page {
width: 60%;
}
}
@media only screen and (max-width: 1440px) {
.page {
width: 56%;
}
}
@media only screen and (max-width: 1200px) {
@media only screen and (max-width: 1280px) {
.page {
width: 52%;
}

View file

@ -1,4 +1,6 @@
.home {
padding-bottom: 5rem;
.home-profile {
@include transform(translateY( 16vh));
padding: 0 0 .5rem;

View file

@ -1,7 +1,7 @@
.page {
position: relative;
max-width: 800px;
width: 60%;
max-width: 1080px;
width: 64%;
margin: 0 auto;
[data-header-desktop] & {

View file

@ -167,7 +167,13 @@
}
}
.table-wrapper {
table {
width: 100%;
max-width: 100%;
margin: .625rem 0;
border-spacing: 0;
background: $table-background-color;
border-collapse: collapse;
overflow-x: auto;
&::-webkit-scrollbar {
@ -178,33 +184,24 @@
}
}
> table {
width: 100%;
max-width: 100%;
margin: .625rem 0;
border-spacing: 0;
background: $table-background-color;
border-collapse: collapse;
[theme=dark] & {
background: $table-background-color-dark;
}
thead {
background: $table-thead-color;
[theme=dark] & {
background: $table-background-color-dark;
background-color: $table-thead-color-dark;
}
}
thead {
background: $table-thead-color;
th, td {
padding: .3rem 1rem;
border: 1px solid darken($table-thead-color, 2%);
[theme=dark] & {
background-color: $table-thead-color-dark;
}
}
th, td {
padding: .3rem 1rem;
border: 1px solid darken($table-thead-color, 2%);
[theme=dark] & {
border-color: darken($table-thead-color-dark, 2%);
}
[theme=dark] & {
border-color: darken($table-thead-color-dark, 2%);
}
}
}
@ -212,6 +209,7 @@
img {
max-width: 100%;
min-height: 1em;
height: auto;
}
figure {
@ -263,6 +261,7 @@
}
@import "../_partial/_single/code";
@import "../_partial/_single/gist";
@import "../_partial/_single/instagram";
@import "../_partial/_single/admonition";
@import "../_partial/_single/echarts";
@ -312,7 +311,7 @@
img {
vertical-align: -12%;
max-height: 1.1em;
margin-right: 0ex;
margin-right: 0;
border-radius: 50%;
}
}

View file

@ -2,11 +2,16 @@
display: none;
}
.fixed-button {
#fixed-buttons-hidden {
display: none;
}
.fixed-button {
display: block;
z-index: 100;
position: fixed;
right: 1.5rem;
bottom: 1.5rem;
font-size: 1rem;
line-height: 1.3rem;
padding: .6rem .6rem;
@ -34,13 +39,16 @@
color: $global-font-color-dark;
}
}
}
#back-to-top {
display: block;
bottom: 1.5rem;
}
&:nth-last-of-type(1) {
bottom: 1.5rem;
}
#view-comments {
bottom: 4.5rem;
&:nth-last-of-type(2) {
bottom: 4.5rem;
}
&:nth-last-of-type(3) {
bottom: 7.5rem;
}
}

View file

@ -1,5 +1,5 @@
code {
display:inline-block;
display: inline-block;
max-width: 100%;
padding: 0 .4rem;
@include overflow-wrap(break-word);
@ -15,7 +15,7 @@ code {
pre {
margin: 0;
padding: .25rem 0 .25rem .5rem;
padding: 8px;
@include tab-size(4);
code {
@ -29,106 +29,51 @@ pre {
}
}
code, pre, .highlight table, .highlight tr, .highlight td {
background: $code-background-color !important;
code, pre {
background: $code-background-color;
[theme=dark] & {
background: $code-background-color-dark !important;
background: $code-background-color-dark;
}
}
.highlight {
font-family: var(--code-font-family);
font-size: var(--code-font-size);
.code-block {
line-height: 1.4em;
margin: .5rem 0;
.table-wrapper {
> table,
> table thead,
> table tr,
> table td {
margin: 0;
padding: 0;
border: none !important;
.code-header {
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
width: 100%;
font-family: var(--global-font-family);
font-weight: bold;
color: $code-info-color;
background: darken($code-background-color, 8%);
span.c {
white-space: nowrap;
}
[theme=dark] & {
color: $code-info-color-dark;
background: darken($code-background-color-dark, 6%);
}
}
> .chroma {
position: relative;
&:hover {
cursor: pointer;
}
.code-header {
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
.code-title {
width: 100%;
font-family: var(--global-font-family);
font-weight: bold;
color: $code-info-color;
background: darken($code-background-color, 8%);
[theme=dark] & {
color: $code-info-color-dark;
background: darken($code-background-color-dark, 6%);
}
&:hover {
cursor: pointer;
}
.code-title {
width: 100%;
padding: .4rem;
}
.code-title::after {
padding-left: .2rem;
content: "Code";
}
@each $type, $text in $code-type-list {
&.#{$type} .code-title::after {
content: $text;
}
}
padding: .4rem;
}
.lntd:first-child {
min-width: 1.6rem;
text-align: right;
.code-title::after {
padding-left: .2rem;
content: "Code";
}
.lntd:last-child {
width: 100%;
pre {
@include max-content(min-width);
}
}
.ln {
padding-right: .75rem;
}
.hl {
display: block;
background-color: darken($code-background-color, 10%);
[theme=dark] & {
background-color: darken($code-background-color-dark, 5%);
}
}
.ln, .lnt {
color: $global-font-secondary-color;
[theme=dark] & {
color: $global-font-secondary-color-dark;
@each $type, $text in $code-type-list {
&.#{$type} .code-title::after {
content: $text;
}
}
@ -154,25 +99,57 @@ code, pre, .highlight table, .highlight tr, .highlight td {
}
}
}
}
.table-wrapper {
max-height: 0;
overflow-y: hidden;
@include details-transition-open;
.highlight {
position: relative;
max-height: 0;
overflow-y: hidden;
@include details-transition-open;
background: $code-background-color;
[theme=dark] & {
background: $code-background-color-dark;
}
&.open {
.code-header {
background: darken($code-background-color, 3%);
.hl {
background-color: darken($code-background-color, 10%);
[theme=dark] & {
background: darken($code-background-color-dark, 3%);
}
[theme=dark] & {
background-color: darken($code-background-color-dark, 5%);
}
}
.table-wrapper {
max-height: 10000px;
@include details-transition-close;
.c, /* Comment */
.ch /* CommentHashbang */,
.cm /* CommentMultiline */,
.c1 /* CommentSingle */,
.cs /* CommentSpecial */,
.cp /* CommentPreproc */,
.cpf /* CommentPreprocFile */ {
font-style: italic
}
.gl /* GenericUnderline */ {
text-decoration: underline
}
@each $class, $color in $code-highlight-color-map {
.#{$class} { color: $color; }
}
[theme=dark] & {
@each $class, $color in $code-highlight-color-map-dark {
.#{$class} { color: $color; }
}
}
}
&.open {
.code-header {
background: darken($code-background-color, 3%);
[theme=dark] & {
background: darken($code-background-color-dark, 3%);
}
.arrow {
@ -187,213 +164,29 @@ code, pre, .highlight table, .highlight tr, .highlight td {
display: inline;
}
}
}
/* Comment */ .c,
/* CommentHashbang */ .ch,
/* CommentMultiline */ .cm,
/* CommentSingle */ .c1,
/* CommentSpecial */ .cs,
/* CommentPreproc */ .cp,
/* CommentPreprocFile */ .cpf { font-style: italic }
/* GenericUnderline */ .gl { text-decoration: underline }
@each $class, $color in $code-highlight-color-map {
.#{$class} { color: $color; }
}
[theme=dark] & {
@each $class, $color in $code-highlight-color-map-dark {
.#{$class} { color: $color; }
}
}
}
.gist {
font-family: var(--code-font-family);
font-size: var(--code-font-size);
.table-wrapper {
> table,
> table thead,
> table tr,
> table td {
margin: 0;
padding: 0;
border: none !important;
}
}
.gist-file, .gist-data, .gist-meta {
border: none;
}
.gist-meta {
padding: .4rem .8rem;
background-color: darken($code-background-color, 5%);
@include link(false, false);
[theme=dark] & {
background-color: darken($code-background-color-dark, 5%);
}
}
[theme=dark] & {
// imported from https://github.com/lonekorean/gist-syntax-themes/blob/master/stylesheets/one-dark.css
.highlight {
background: #141414;
max-height: 10000px;
@include details-transition-close;
}
.blob-num,
.blob-code-inner,
.highlight,
.pl-enm,
.pl-ko,
.pl-mo,
.pl-mp1 .pl-sf,
.pl-ms,
.pl-pdc1,
.pl-scp,
.pl-smc,
.pl-som,
.pl-va,
.pl-vpf,
.pl-vpu,
.pl-mdr {
color: #aab1bf;
}
.pl-mb,
.pl-pdb {
font-weight: 700;
}
.pl-c,
.pl-c span,
.pl-pdc {
color: #5b6270;
font-style: italic;
}
.pl-sr .pl-cce {
color: #56b5c2;
font-weight: 400;
}
.pl-ef,
.pl-en,
.pl-enf,
.pl-eoai,
.pl-kos,
.pl-mh .pl-pdh,
.pl-mr {
color: #61afef;
}
.pl-ens,
.pl-vi {
color: #be5046;
}
.pl-enti,
.pl-mai .pl-sf,
.pl-ml,
.pl-sf,
.pl-sr,
.pl-sr .pl-sra,
.pl-src,
.pl-st,
.pl-vo {
color: #56b5c2;
}
.pl-eoi,
.pl-mri,
.pl-pds,
.pl-pse .pl-s1,
.pl-s,
.pl-s1 {
color: #97c279;
}
.pl-k,
.pl-kolp,
.pl-mc,
.pl-pde {
color: #c578dd;
}
.pl-mi,
.pl-pdi {
color: #c578dd;
font-style: italic;
}
.pl-mp,
.pl-stp {
color: #818896;
}
.pl-mdh,
.pl-mdi,
.pl-mdr {
font-weight: 400;
}
.pl-mdht,
.pl-mi1 {
color: #97c279;
background: #020;
}
.pl-md,
.pl-mdhf {
color: #df6b75;
background: #200;
}
.pl-corl {
color: #df6b75;
text-decoration: underline;
}
.pl-ib {
background: #df6b75;
}
.pl-ii {
background: #e0c184;
color: #fff;
}
.pl-iu {
background: #e05151;
}
.pl-ms1 {
color: #aab1bf;
background: #373b41;
}
.pl-c1,
.pl-cn,
.pl-e,
.pl-eoa,
.pl-eoac,
.pl-eoac .pl-pde,
.pl-kou,
.pl-mm,
.pl-mp .pl-s3,
.pl-mq,
.pl-s3,
.pl-sok,
.pl-sv,
.pl-mb {
color: #d19965;
}
.pl-enc,
.pl-entc,
.pl-pse .pl-s2,
.pl-s2,
.pl-sc,
.pl-smp,
.pl-sr .pl-sre,
.pl-stj,
.pl-v,
.pl-pdb {
color: #e4bf7a;
}
.pl-ent,
.pl-entl,
.pl-entm,
.pl-mh,
.pl-pdv,
.pl-smi,
.pl-sol,
.pl-mdh,
.pl-mdi {
color: #df6b75;
}
&.code-line-numbers {
span.line::before {
display: inline-block;
counter-increment: code-block;
content: counter(code-block);
min-width: 4ch;
text-align: right;
text-wrap: nowrap;
box-sizing: border-box;
border-width: 0;
margin-right: 1rem;
color: $code-info-color;
[theme=dark] & {
color: $code-info-color-dark;
}
}
}
}

View file

@ -0,0 +1,186 @@
.gist {
font-family: var(--code-font-family);
font-size: var(--code-font-size);
table,
table thead,
table tr,
table td {
margin: 0;
padding: 0;
border: none;
}
.gist-file, .gist-data, .gist-meta {
border: none;
}
.gist-meta {
padding: .4rem .8rem;
background-color: darken($code-background-color, 5%);
@include link(false, false);
[theme=dark] & {
background-color: darken($code-background-color-dark, 5%);
}
}
[theme=dark] & {
// imported from https://github.com/lonekorean/gist-syntax-themes/blob/master/stylesheets/one-dark.css
.highlight {
background: #141414;
}
.blob-num,
.blob-code-inner,
.highlight,
.pl-enm,
.pl-ko,
.pl-mo,
.pl-mp1 .pl-sf,
.pl-ms,
.pl-pdc1,
.pl-scp,
.pl-smc,
.pl-som,
.pl-va,
.pl-vpf,
.pl-vpu,
.pl-mdr {
color: #aab1bf;
}
.pl-mb,
.pl-pdb {
font-weight: 700;
}
.pl-c,
.pl-c span,
.pl-pdc {
color: #5b6270;
font-style: italic;
}
.pl-sr .pl-cce {
color: #56b5c2;
font-weight: 400;
}
.pl-ef,
.pl-en,
.pl-enf,
.pl-eoai,
.pl-kos,
.pl-mh .pl-pdh,
.pl-mr {
color: #61afef;
}
.pl-ens,
.pl-vi {
color: #be5046;
}
.pl-enti,
.pl-mai .pl-sf,
.pl-ml,
.pl-sf,
.pl-sr,
.pl-sr .pl-sra,
.pl-src,
.pl-st,
.pl-vo {
color: #56b5c2;
}
.pl-eoi,
.pl-mri,
.pl-pds,
.pl-pse .pl-s1,
.pl-s,
.pl-s1 {
color: #97c279;
}
.pl-k,
.pl-kolp,
.pl-mc,
.pl-pde {
color: #c578dd;
}
.pl-mi,
.pl-pdi {
color: #c578dd;
font-style: italic;
}
.pl-mp,
.pl-stp {
color: #818896;
}
.pl-mdh,
.pl-mdi,
.pl-mdr {
font-weight: 400;
}
.pl-mdht,
.pl-mi1 {
color: #97c279;
background: #020;
}
.pl-md,
.pl-mdhf {
color: #df6b75;
background: #200;
}
.pl-corl {
color: #df6b75;
text-decoration: underline;
}
.pl-ib {
background: #df6b75;
}
.pl-ii {
background: #e0c184;
color: #fff;
}
.pl-iu {
background: #e05151;
}
.pl-ms1 {
color: #aab1bf;
background: #373b41;
}
.pl-c1,
.pl-cn,
.pl-e,
.pl-eoa,
.pl-eoac,
.pl-eoac .pl-pde,
.pl-kou,
.pl-mm,
.pl-mp .pl-s3,
.pl-mq,
.pl-s3,
.pl-sok,
.pl-sv,
.pl-mb {
color: #d19965;
}
.pl-enc,
.pl-entc,
.pl-pse .pl-s2,
.pl-s2,
.pl-sc,
.pl-smp,
.pl-sr .pl-sre,
.pl-stj,
.pl-v,
.pl-pdb {
color: #e4bf7a;
}
.pl-ent,
.pl-entl,
.pl-entm,
.pl-mh,
.pl-pdv,
.pl-smi,
.pl-sol,
.pl-mdh,
.pl-mdi {
color: #df6b75;
}
}
}

View file

@ -78,7 +78,7 @@ $search-background-color-dark: #363636 !default;
// ========== Single Content ========== //
// Font size of the TOC
$toc-title-font-size: 1.2rem !default;
$toc-content-font-size: 1rem !default;
$toc-content-font-size: 0.875rem !default;
// Color of the single link
$single-link-color: #2d96bd !default;
@ -163,6 +163,7 @@ $code-type-list:
"language-perl" "Perl",
"language-powershell" "PowerShell",
"language-posh" "PowerShell",
"language-puppet" "Puppet",
"language-pwsh" "PowerShell",
"language-python" "Python",
"language-r" "R",

View file

@ -11,8 +11,8 @@ libFiles:
autocompleteJS: autocomplete.js/0.38.1/autocomplete.min.js
# lunr.js@2.3.9 https://lunrjs.com/
lunrJS: lunr.js/2.3.9/lunr.min.js
# algoliasearch@4.13.1 https://github.com/algolia/algoliasearch-client-javascript
algoliasearchJS: algoliasearch/4.13.1/algoliasearch-lite.umd.min.js
# algoliasearch@5.19.0 https://github.com/algolia/algoliasearch-client-javascript
algoliasearchJS: algoliasearch/5.19.0/lite/builds/browser.umd.min.js
# lazysizes@5.3.2 https://github.com/aFarkas/lazysizes
lazysizesJS: lazysizes/5.3.2/lazysizes.min.js
# object-fit-images@3.2.4 https://github.com/fregante/object-fit-images
@ -43,12 +43,12 @@ libFiles:
mapboxGLJS: mapbox-gl/2.9.1/mapbox-gl.min.js
# aplayer@1.10.1 https://github.com/MoePlayer/APlayer
aplayerCSS: aplayer/1.10.1/APlayer.min.css
aplayerJS: aplayer/1.10.1/APlayer.min.js
#aplayerJS: aplayer/1.10.1/APlayer.min.js
# gitalk@1.7.2 https://github.com/gitalk/gitalk
gitalkCSS: gitalk/1.7.2/gitalk.min.css
gitalkJS: gitalk/1.7.2/gitalk.min.js
# valine@1.5.0 https://valine.js.org/
valineJS: valine/1.5.0/Valine.min.js
# valine@1.5.3 https://valine.js.org/
valineJS: valine/1.5.3/Valine.min.js
# cookieconsent@3.1.1 https://github.com/osano/cookieconsent
cookieconsentCSS: cookieconsent/3.1.1/cookieconsent.min.css
cookieconsentJS: cookieconsent/3.1.1/cookieconsent.min.js

View file

@ -11,8 +11,8 @@ libFiles:
autocompleteJS: autocomplete.js@0.38.1/dist/autocomplete.min.js
# lunr.js@2.3.9 https://lunrjs.com/
lunrJS: lunr@2.3.9/lunr.min.js
# algoliasearch@4.13.1 https://github.com/algolia/algoliasearch-client-javascript
algoliasearchJS: algoliasearch@4.13.1/dist/algoliasearch-lite.umd.min.js
# algoliasearch@5.20.2 https://github.com/algolia/algoliasearch-client-javascript
algoliasearchJS: algoliasearch@5.20.2/dist/lite/builds/browser.umd.min.js
# lazysizes@5.3.2 https://github.com/aFarkas/lazysizes
lazysizesJS: lazysizes@5.3.2/lazysizes.min.js
# object-fit-images@3.2.4 https://github.com/fregante/object-fit-images
@ -45,14 +45,14 @@ libFiles:
mapboxGLJS: mapbox-gl@2.9.1/dist/mapbox-gl.min.js
# aplayer@1.10.1 https://github.com/MoePlayer/APlayer
aplayerCSS: aplayer@1.10.1/dist/APlayer.min.css
aplayerJS: aplayer@1.10.1/dist/APlayer.min.js
#aplayerJS: aplayer@1.10.1/dist/APlayer.min.js
# meting@2.0.1 https://github.com/metowolf/MetingJS
metingJS: meting@2.0.1/dist/Meting.min.js
# gitalk@1.7.2 https://github.com/gitalk/gitalk
gitalkCSS: gitalk@1.7.2/dist/gitalk.min.css
gitalkJS: gitalk@1.7.2/dist/gitalk.min.js
# valine@1.5.0 https://valine.js.org/
valineJS: valine@1.5.0/dist/Valine.min.js
# valine@1.5.3 https://valine.js.org/
valineJS: valine@1.5.3/dist/Valine.min.js
# cookieconsent@3.1.1 https://github.com/osano/cookieconsent
cookieconsentCSS: cookieconsent@3.1.1/build/cookieconsent.min.css
cookieconsentJS: cookieconsent@3.1.1/build/cookieconsent.min.js

View file

@ -49,7 +49,7 @@ telegram:
# 007: Medium
medium:
Weight: 7
Prefix: https://medium.com/
Prefix: https://medium.com/@
Title: Medium
Icon:
Class: fab fa-medium fa-fw
@ -569,13 +569,37 @@ rootme:
Icon:
Src: svg/icons/rootme.svg
# 073: Pixelfed
pixelfed:
# 073: Malt
malt:
Weight: 73
Title: Pixelfed
Newtab: true
Prefix: https://www.malt.fr/profile/
Title: Malt
Icon:
Class: fas fa-camera fa-fw
Src: svg/icons/malt.svg
# 074: TikTok
tiktok:
Weight: 74
Url: https://www.tiktok.com/
Title: TikTok
Icon:
Simpleicons: tiktok
# 075: TryHackMe
tryhackme:
Weight: 75
Title: TryHackMe
Prefix: https://tryhackme.com/p/
Icon:
Simpleicons: Tryhackme
# 076: Codeberg
codeberg:
Weight: 76
Title: Codeberg
Prefix: https://codeberg.org/
Icon:
Simpleicons: codeberg
# Phone
phone:

View file

@ -2,6 +2,14 @@
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
@ -27,7 +35,7 @@ var Util = /*#__PURE__*/function () {
_classCallCheck(this, Util);
}
_createClass(Util, [{
_createClass(Util, null, [{
key: "forEach",
value: function forEach(elements, handler) {
elements = elements || [];
@ -83,8 +91,7 @@ var Theme = /*#__PURE__*/function () {
this.config = window.config;
this.data = this.config.data;
this.isDark = document.body.getAttribute('theme') === 'dark';
this.util = new Util();
this.newScrollTop = this.util.getScrollTop();
this.newScrollTop = Util.getScrollTop();
this.oldScrollTop = this.newScrollTop;
this.scrollEventSet = new Set();
this.resizeEventSet = new Set();
@ -98,14 +105,14 @@ var Theme = /*#__PURE__*/function () {
value: function initRaw() {
var _this = this;
this.util.forEach(document.querySelectorAll('[data-raw]'), function ($raw) {
Util.forEach(document.querySelectorAll('[data-raw]'), function ($raw) {
$raw.innerHTML = _this.data[$raw.id];
});
}
}, {
key: "initSVGIcon",
value: function initSVGIcon() {
this.util.forEach(document.querySelectorAll('[data-svg-src]'), function ($icon) {
Util.forEach(document.querySelectorAll('[data-svg-src]'), function ($icon) {
fetch($icon.getAttribute('data-svg-src')).then(function (response) {
return response.text();
}).then(function (svg) {
@ -150,7 +157,7 @@ var Theme = /*#__PURE__*/function () {
value: function initSwitchTheme() {
var _this2 = this;
this.util.forEach(document.getElementsByClassName('theme-switch'), function ($themeSwitch) {
Util.forEach(document.getElementsByClassName('theme-switch'), function ($themeSwitch) {
$themeSwitch.addEventListener('click', function () {
if (document.body.getAttribute('theme') === 'dark') document.body.setAttribute('theme', 'light');else document.body.setAttribute('theme', 'dark');
_this2.isDark = !_this2.isDark;
@ -178,7 +185,7 @@ var Theme = /*#__PURE__*/function () {
var _this3 = this;
var searchConfig = this.config.search;
var isMobile = this.util.isMobile();
var isMobile = Util.isMobile();
if (!searchConfig || isMobile && this._searchMobileOnce || !isMobile && this._searchDesktopOnce) return;
var maxResultLength = searchConfig.maxResultLength ? searchConfig.maxResultLength : 10;
var snippetLength = searchConfig.snippetLength ? searchConfig.snippetLength : 50;
@ -291,10 +298,10 @@ var Theme = /*#__PURE__*/function () {
position -= snippetLength / 5;
if (position > 0) {
position += context.substr(position, 20).lastIndexOf(' ') + 1;
context = '...' + context.substr(position, snippetLength);
position += context.slice(position, position + 20).lastIndexOf(' ') + 1;
context = '...' + context.slice(position, position + snippetLength);
} else {
context = context.substr(0, snippetLength);
context = context.slice(0, snippetLength);
}
Object.keys(metadata).forEach(function (key) {
@ -349,17 +356,24 @@ var Theme = /*#__PURE__*/function () {
});
} else finish(search());
} else if (searchConfig.type === 'algolia') {
_this3._algoliaIndex = _this3._algoliaIndex || algoliasearch(searchConfig.algoliaAppID, searchConfig.algoliaSearchKey).initIndex(searchConfig.algoliaIndex);
var algoliasearch = window['algoliasearch/lite'].liteClient;
_this3._algoliaIndex = _this3._algoliaIndex || algoliasearch(searchConfig.algoliaAppID, searchConfig.algoliaSearchKey);
_this3._algoliaIndex.search(query, {
offset: 0,
length: maxResultLength * 8,
attributesToHighlight: ['title'],
attributesToSnippet: ["content:".concat(snippetLength)],
highlightPreTag: "<".concat(highlightTag, ">"),
highlightPostTag: "</".concat(highlightTag, ">")
_this3._algoliaIndex.search({
requests: [{
indexName: searchConfig.algoliaIndex,
query: query,
offset: 0,
length: maxResultLength * 8,
attributesToHighlight: ['title'],
attributesToSnippet: ["content:".concat(snippetLength)],
highlightPreTag: "<".concat(highlightTag, ">"),
highlightPostTag: "</".concat(highlightTag, ">")
}]
}).then(function (_ref3) {
var hits = _ref3.hits;
var _ref3$results = _slicedToArray(_ref3.results, 1),
hits = _ref3$results[0].hits;
var results = {};
hits.forEach(function (_ref4) {
var uri = _ref4.uri,
@ -427,7 +441,7 @@ var Theme = /*#__PURE__*/function () {
if (script.readyState) {
script.onreadystatechange = function () {
if (script.readyState == 'loaded' || script.readyState == 'complete') {
if (script.readyState === 'loaded' || script.readyState === 'complete') {
script.onreadystatechange = null;
initAutosearch();
}
@ -444,7 +458,7 @@ var Theme = /*#__PURE__*/function () {
}, {
key: "initDetails",
value: function initDetails() {
this.util.forEach(document.getElementsByClassName('details'), function ($details) {
Util.forEach(document.getElementsByClassName('details'), function ($details) {
var $summary = $details.getElementsByClassName('details-summary')[0];
$summary.addEventListener('click', function () {
$details.classList.toggle('open');
@ -471,78 +485,45 @@ var Theme = /*#__PURE__*/function () {
}, {
key: "initHighlight",
value: function initHighlight() {
var _this5 = this;
Util.forEach(document.querySelectorAll('.code-block'), function ($codeBlock) {
var $codeTitle = $codeBlock.querySelector('.code-header > .code-title');
this.util.forEach(document.querySelectorAll('.highlight > pre.chroma'), function ($preChroma) {
var $chroma = document.createElement('div');
$chroma.className = $preChroma.className;
var $table = document.createElement('table');
$chroma.appendChild($table);
var $tbody = document.createElement('tbody');
$table.appendChild($tbody);
var $tr = document.createElement('tr');
$tbody.appendChild($tr);
var $td = document.createElement('td');
$tr.appendChild($td);
$preChroma.parentElement.replaceChild($chroma, $preChroma);
$td.appendChild($preChroma);
});
this.util.forEach(document.querySelectorAll('.highlight > .chroma'), function ($chroma) {
var $codeElements = $chroma.querySelectorAll('pre.chroma > code');
if ($codeElements.length) {
var $code = $codeElements[$codeElements.length - 1];
var $header = document.createElement('div');
$header.className = 'code-header ' + $code.className.toLowerCase();
var $title = document.createElement('span');
$title.classList.add('code-title');
$title.insertAdjacentHTML('afterbegin', '<i class="arrow fas fa-chevron-right fa-fw" aria-hidden="true"></i>');
$title.addEventListener('click', function () {
$chroma.classList.toggle('open');
if ($codeTitle) {
$codeTitle.addEventListener('click', function () {
$codeBlock.classList.toggle('open');
}, false);
$header.appendChild($title);
var $ellipses = document.createElement('span');
$ellipses.insertAdjacentHTML('afterbegin', '<i class="fas fa-ellipsis-h fa-fw" aria-hidden="true"></i>');
$ellipses.classList.add('ellipses');
$ellipses.addEventListener('click', function () {
$chroma.classList.add('open');
}, false);
$header.appendChild($ellipses);
var $copy = document.createElement('span');
$copy.insertAdjacentHTML('afterbegin', '<i class="far fa-copy fa-fw" aria-hidden="true"></i>');
$copy.classList.add('copy');
var code = $code.innerText;
if (_this5.config.code.maxShownLines < 0 || code.split('\n').length < _this5.config.code.maxShownLines + 2) $chroma.classList.add('open');
if (_this5.config.code.copyTitle) {
$copy.setAttribute('data-clipboard-text', code);
$copy.title = _this5.config.code.copyTitle;
var clipboard = new ClipboardJS($copy);
clipboard.on('success', function (_e) {
_this5.util.animateCSS($code, 'animate__flash');
});
$header.appendChild($copy);
}
$chroma.insertBefore($header, $chroma.firstChild);
}
});
}
}, {
key: "initTable",
value: function initTable() {
this.util.forEach(document.querySelectorAll('.content table'), function ($table) {
var $wrapper = document.createElement('div');
$wrapper.className = 'table-wrapper';
$table.parentElement.replaceChild($wrapper, $table);
$wrapper.appendChild($table);
var $ellipses = $codeBlock.querySelector('.code-header .ellipses');
if ($ellipses) {
$ellipses.addEventListener('click', function () {
$codeBlock.classList.toggle('open');
}, false);
}
var $copy = $codeBlock.querySelector('.code-header .copy');
if ($copy) {
var $code = $codeBlock.querySelector('code');
$copy.setAttribute('data-clipboard-text', $code.innerText);
var clipboard = new ClipboardJS($copy);
var $codeLines = $code.querySelectorAll('span.cl');
clipboard.on('success', function (_e) {
if ($codeLines) {
Util.forEach($codeLines, function ($codeLine) {
return Util.animateCSS($codeLine, 'animate__flash');
});
}
});
}
});
}
}, {
key: "initHeaderLink",
value: function initHeaderLink() {
for (var num = 1; num <= 6; num++) {
this.util.forEach(document.querySelectorAll('.single .content > h' + num), function ($header) {
Util.forEach(document.querySelectorAll('.single .content > h' + num), function ($header) {
$header.classList.add('headerLink');
$header.insertAdjacentHTML('afterbegin', "<a href=\"#".concat($header.id, "\" class=\"header-mark\"></a>"));
});
@ -551,12 +532,12 @@ var Theme = /*#__PURE__*/function () {
}, {
key: "initToc",
value: function initToc() {
var _this6 = this;
var _this5 = this;
var $tocCore = document.getElementById('TableOfContents');
if ($tocCore === null) return;
if (document.getElementById('toc-static').getAttribute('data-kept') || this.util.isTocStatic()) {
if (document.getElementById('toc-static').getAttribute('data-kept') || Util.isTocStatic()) {
var $tocContentStatic = document.getElementById('toc-content-static');
if ($tocCore.parentElement !== $tocContentStatic) {
@ -593,10 +574,10 @@ var Theme = /*#__PURE__*/function () {
var maxTocTop = footerTop - $toc.getBoundingClientRect().height;
var maxScrollTop = maxTocTop - TOP_SPACING + (headerIsFixed ? 0 : headerHeight);
if (_this6.newScrollTop < minScrollTop) {
if (_this5.newScrollTop < minScrollTop) {
$toc.style.position = 'absolute';
$toc.style.top = "".concat(minTocTop, "px");
} else if (_this6.newScrollTop > maxScrollTop) {
} else if (_this5.newScrollTop > maxScrollTop) {
$toc.style.position = 'absolute';
$toc.style.top = "".concat(maxTocTop, "px");
} else {
@ -604,14 +585,12 @@ var Theme = /*#__PURE__*/function () {
$toc.style.top = "".concat(TOP_SPACING, "px");
}
_this6.util.forEach($tocLinkElements, function ($tocLink) {
Util.forEach($tocLinkElements, function ($tocLink) {
$tocLink.classList.remove('active');
});
_this6.util.forEach($tocLiElements, function ($tocLi) {
Util.forEach($tocLiElements, function ($tocLi) {
$tocLi.classList.remove('has-active');
});
var INDEX_SPACING = 20 + (headerIsFixed ? headerHeight : 0);
var activeTocIndex = $headerLinkElements.length - 1;
@ -619,7 +598,7 @@ var Theme = /*#__PURE__*/function () {
var thisTop = $headerLinkElements[i].getBoundingClientRect().top;
var nextTop = $headerLinkElements[i + 1].getBoundingClientRect().top;
if (i == 0 && thisTop > INDEX_SPACING || thisTop <= INDEX_SPACING && nextTop > INDEX_SPACING) {
if (i === 0 && thisTop > INDEX_SPACING || thisTop <= INDEX_SPACING && nextTop > INDEX_SPACING) {
activeTocIndex = i;
break;
}
@ -649,7 +628,7 @@ var Theme = /*#__PURE__*/function () {
}, {
key: "initMermaid",
value: function initMermaid() {
var _this7 = this;
var _this6 = this;
this._mermaidOnSwitchTheme = this._mermaidOnSwitchTheme || function () {
var $mermaidElements = document.getElementsByClassName('mermaid');
@ -657,12 +636,11 @@ var Theme = /*#__PURE__*/function () {
if ($mermaidElements.length) {
mermaid.initialize({
startOnLoad: false,
theme: _this7.isDark ? 'dark' : 'neutral',
theme: _this6.isDark ? 'dark' : 'neutral',
securityLevel: 'loose'
});
_this7.util.forEach($mermaidElements, function ($mermaid) {
mermaid.render('svg-' + $mermaid.id, _this7.data[$mermaid.id], function (svgCode) {
Util.forEach($mermaidElements, function ($mermaid) {
mermaid.render('svg-' + $mermaid.id, _this6.data[$mermaid.id], function (svgCode) {
$mermaid.innerHTML = svgCode;
}, $mermaid);
});
@ -676,28 +654,27 @@ var Theme = /*#__PURE__*/function () {
}, {
key: "initEcharts",
value: function initEcharts() {
var _this8 = this;
var _this7 = this;
if (this.config.echarts) {
echarts.registerTheme('light', this.config.echarts.lightTheme);
echarts.registerTheme('dark', this.config.echarts.darkTheme);
this._echartsOnSwitchTheme = this._echartsOnSwitchTheme || function () {
_this8._echartsArr = _this8._echartsArr || [];
_this7._echartsArr = _this7._echartsArr || [];
for (var i = 0; i < _this8._echartsArr.length; i++) {
_this8._echartsArr[i].dispose();
for (var i = 0; i < _this7._echartsArr.length; i++) {
_this7._echartsArr[i].dispose();
}
_this8._echartsArr = [];
_this8.util.forEach(document.getElementsByClassName('echarts'), function ($echarts) {
var chart = echarts.init($echarts, _this8.isDark ? 'dark' : 'light', {
_this7._echartsArr = [];
Util.forEach(document.getElementsByClassName('echarts'), function ($echarts) {
var chart = echarts.init($echarts, _this7.isDark ? 'dark' : 'light', {
renderer: 'svg'
});
chart.setOption(JSON.parse(_this8.data[$echarts.id]));
chart.setOption(JSON.parse(_this7.data[$echarts.id]));
_this8._echartsArr.push(chart);
_this7._echartsArr.push(chart);
});
};
@ -706,8 +683,8 @@ var Theme = /*#__PURE__*/function () {
this._echartsOnSwitchTheme();
this._echartsOnResize = this._echartsOnResize || function () {
for (var i = 0; i < _this8._echartsArr.length; i++) {
_this8._echartsArr[i].resize();
for (var i = 0; i < _this7._echartsArr.length; i++) {
_this7._echartsArr[i].resize();
}
};
@ -717,30 +694,30 @@ var Theme = /*#__PURE__*/function () {
}, {
key: "initMapbox",
value: function initMapbox() {
var _this9 = this;
var _this8 = this;
if (this.config.mapbox) {
mapboxgl.accessToken = this.config.mapbox.accessToken;
mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin);
this._mapboxArr = this._mapboxArr || [];
this.util.forEach(document.getElementsByClassName('mapbox'), function ($mapbox) {
var _this9$data$$mapbox$i = _this9.data[$mapbox.id],
lng = _this9$data$$mapbox$i.lng,
lat = _this9$data$$mapbox$i.lat,
zoom = _this9$data$$mapbox$i.zoom,
lightStyle = _this9$data$$mapbox$i.lightStyle,
darkStyle = _this9$data$$mapbox$i.darkStyle,
marked = _this9$data$$mapbox$i.marked,
navigation = _this9$data$$mapbox$i.navigation,
geolocate = _this9$data$$mapbox$i.geolocate,
scale = _this9$data$$mapbox$i.scale,
fullscreen = _this9$data$$mapbox$i.fullscreen;
Util.forEach(document.getElementsByClassName('mapbox'), function ($mapbox) {
var _this8$data$$mapbox$i = _this8.data[$mapbox.id],
lng = _this8$data$$mapbox$i.lng,
lat = _this8$data$$mapbox$i.lat,
zoom = _this8$data$$mapbox$i.zoom,
lightStyle = _this8$data$$mapbox$i.lightStyle,
darkStyle = _this8$data$$mapbox$i.darkStyle,
marked = _this8$data$$mapbox$i.marked,
navigation = _this8$data$$mapbox$i.navigation,
geolocate = _this8$data$$mapbox$i.geolocate,
scale = _this8$data$$mapbox$i.scale,
fullscreen = _this8$data$$mapbox$i.fullscreen;
var mapbox = new mapboxgl.Map({
container: $mapbox,
center: [lng, lat],
zoom: zoom,
minZoom: .2,
style: _this9.isDark ? darkStyle : lightStyle,
style: _this8.isDark ? darkStyle : lightStyle,
attributionControl: false
});
@ -772,16 +749,16 @@ var Theme = /*#__PURE__*/function () {
mapbox.addControl(new MapboxLanguage());
_this9._mapboxArr.push(mapbox);
_this8._mapboxArr.push(mapbox);
});
this._mapboxOnSwitchTheme = this._mapboxOnSwitchTheme || function () {
_this9.util.forEach(_this9._mapboxArr, function (mapbox) {
Util.forEach(_this8._mapboxArr, function (mapbox) {
var $mapbox = mapbox.getContainer();
var _this9$data$$mapbox$i2 = _this9.data[$mapbox.id],
lightStyle = _this9$data$$mapbox$i2.lightStyle,
darkStyle = _this9$data$$mapbox$i2.darkStyle;
mapbox.setStyle(_this9.isDark ? darkStyle : lightStyle);
var _this8$data$$mapbox$i2 = _this8.data[$mapbox.id],
lightStyle = _this8$data$$mapbox$i2.lightStyle,
darkStyle = _this8$data$$mapbox$i2.darkStyle;
mapbox.setStyle(_this8.isDark ? darkStyle : lightStyle);
mapbox.addControl(new MapboxLanguage());
});
};
@ -792,7 +769,7 @@ var Theme = /*#__PURE__*/function () {
}, {
key: "initTypeit",
value: function initTypeit() {
var _this10 = this;
var _this9 = this;
if (this.config.typeit) {
var typeitConfig = this.config.typeit;
@ -802,8 +779,8 @@ var Theme = /*#__PURE__*/function () {
Object.values(typeitConfig.data).forEach(function (group) {
var typeone = function typeone(i) {
var id = group[i];
var instance = new TypeIt("#".concat(id), {
strings: _this10.data[id],
new TypeIt("#".concat(id), {
strings: _this9.data[id],
speed: speed,
lifeLike: true,
cursorSpeed: cursorSpeed,
@ -830,7 +807,7 @@ var Theme = /*#__PURE__*/function () {
}, {
key: "initComment",
value: function initComment() {
var _this11 = this;
var _this10 = this;
if (this.config.comment) {
if (this.config.comment.gitalk) {
@ -857,7 +834,7 @@ var Theme = /*#__PURE__*/function () {
this._utterancesOnSwitchTheme = this._utterancesOnSwitchTheme || function () {
var message = {
type: 'set-theme',
theme: _this11.isDark ? utterancesConfig.darkTheme : utterancesConfig.lightTheme
theme: _this10.isDark ? utterancesConfig.darkTheme : utterancesConfig.lightTheme
};
var iframe = document.querySelector('.utterances-frame');
iframe.contentWindow.postMessage(message, 'https://utteranc.es');
@ -889,7 +866,7 @@ var Theme = /*#__PURE__*/function () {
this._giscusOnSwitchTheme = this._giscusOnSwitchTheme || function () {
var message = {
setConfig: {
theme: _this11.isDark ? giscusConfig.darkTheme : giscusConfig.lightTheme,
theme: _this10.isDark ? giscusConfig.darkTheme : giscusConfig.lightTheme,
reactionsEnabled: false
}
};
@ -912,7 +889,7 @@ var Theme = /*#__PURE__*/function () {
}, {
key: "onScroll",
value: function onScroll() {
var _this12 = this;
var _this11 = this;
var $headers = [];
if (document.body.getAttribute('data-header-desktop') === 'auto') $headers.push(document.getElementById('header-desktop'));
@ -921,52 +898,46 @@ var Theme = /*#__PURE__*/function () {
if (document.getElementById('comments')) {
var $viewComments = document.getElementById('view-comments');
$viewComments.href = "#comments";
$viewComments.style.display = 'block';
$viewComments.parentElement.removeChild($viewComments);
document.getElementById('fixed-buttons').appendChild($viewComments);
}
var $fixedButtons = document.getElementById('fixed-buttons');
var ACCURACY = 20,
MINIMUM = 100;
window.addEventListener('scroll', function () {
_this12.newScrollTop = _this12.util.getScrollTop();
var scroll = _this12.newScrollTop - _this12.oldScrollTop;
var isMobile = _this12.util.isMobile();
_this12.util.forEach($headers, function ($header) {
_this11.newScrollTop = Util.getScrollTop();
var scroll = _this11.newScrollTop - _this11.oldScrollTop;
var isMobile = Util.isMobile();
Util.forEach($headers, function ($header) {
if (scroll > ACCURACY) {
$header.classList.remove('animate__fadeInDown');
_this12.util.animateCSS($header, ['animate__fadeOutUp', 'animate__faster'], true);
Util.animateCSS($header, ['animate__fadeOutUp', 'animate__faster'], true);
} else if (scroll < -ACCURACY) {
$header.classList.remove('animate__fadeOutUp');
_this12.util.animateCSS($header, ['animate__fadeInDown', 'animate__faster'], true);
Util.animateCSS($header, ['animate__fadeInDown', 'animate__faster'], true);
}
});
if (_this12.newScrollTop > MINIMUM) {
if (_this11.newScrollTop > MINIMUM) {
if (isMobile && scroll > ACCURACY) {
$fixedButtons.classList.remove('animate__fadeIn');
_this12.util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true);
Util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true);
} else if (!isMobile || scroll < -ACCURACY) {
$fixedButtons.style.display = 'block';
$fixedButtons.classList.remove('animate__fadeOut');
_this12.util.animateCSS($fixedButtons, ['animate__fadeIn', 'animate__faster'], true);
Util.animateCSS($fixedButtons, ['animate__fadeIn', 'animate__faster'], true);
}
} else {
if (!isMobile) {
$fixedButtons.classList.remove('animate__fadeIn');
_this12.util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true);
Util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true);
}
$fixedButtons.style.display = 'none';
}
var _iterator2 = _createForOfIteratorHelper(_this12.scrollEventSet),
var _iterator2 = _createForOfIteratorHelper(_this11.scrollEventSet),
_step2;
try {
@ -980,20 +951,20 @@ var Theme = /*#__PURE__*/function () {
_iterator2.f();
}
_this12.oldScrollTop = _this12.newScrollTop;
_this11.oldScrollTop = _this11.newScrollTop;
}, false);
}
}, {
key: "onResize",
value: function onResize() {
var _this13 = this;
var _this12 = this;
window.addEventListener('resize', function () {
if (!_this13._resizeTimeout) {
_this13._resizeTimeout = window.setTimeout(function () {
_this13._resizeTimeout = null;
if (!_this12._resizeTimeout) {
_this12._resizeTimeout = window.setTimeout(function () {
_this12._resizeTimeout = null;
var _iterator3 = _createForOfIteratorHelper(_this13.resizeEventSet),
var _iterator3 = _createForOfIteratorHelper(_this12.resizeEventSet),
_step3;
try {
@ -1007,11 +978,11 @@ var Theme = /*#__PURE__*/function () {
_iterator3.f();
}
_this13.initToc();
_this12.initToc();
_this13.initMermaid();
_this12.initMermaid();
_this13.initSearch();
_this12.initSearch();
}, 100);
}
}, false);
@ -1019,10 +990,10 @@ var Theme = /*#__PURE__*/function () {
}, {
key: "onClickMask",
value: function onClickMask() {
var _this14 = this;
var _this13 = this;
document.getElementById('mask').addEventListener('click', function () {
var _iterator4 = _createForOfIteratorHelper(_this14.clickMaskEventSet),
var _iterator4 = _createForOfIteratorHelper(_this13.clickMaskEventSet),
_step4;
try {
@ -1042,7 +1013,7 @@ var Theme = /*#__PURE__*/function () {
}, {
key: "init",
value: function init() {
var _this15 = this;
var _this14 = this;
try {
this.initRaw();
@ -1054,7 +1025,6 @@ var Theme = /*#__PURE__*/function () {
this.initDetails();
this.initLightGallery();
this.initHighlight();
this.initTable();
this.initHeaderLink();
this.initMath();
this.initMermaid();
@ -1067,15 +1037,15 @@ var Theme = /*#__PURE__*/function () {
}
window.setTimeout(function () {
_this15.initToc();
_this14.initToc();
_this15.initComment();
_this14.initComment();
_this15.onScroll();
_this14.onScroll();
_this15.onResize();
_this14.onResize();
_this15.onClickMask();
_this14.onClickMask();
}, 100);
}
}]);

View file

@ -1,24 +0,0 @@
normalize.css@8.0.1 https://github.com/necolas/normalize.css
fontawesome-free@6.1.1 https://fontawesome.com/
simple-icons@7.3.0 https://github.com/simple-icons/simple-icons
animate.css@4.1.1 https://github.com/daneden/animate.css
autocomplete@0.38.1 https://github.com/algolia/autocomplete
lunr.js@2.3.9 https://lunrjs.com/
algoliasearch@4.13.1 https://github.com/algolia/algoliasearch-client-javascript
lazysizes@5.3.2 https://github.com/aFarkas/lazysizes
object-fit-images@3.2.4 https://github.com/fregante/object-fit-images
twemoji@14.0.2 https://github.com/twitter/twemoji
emoji-data@14.0.0 https://github.com/iamcal/emoji-data
lightgallery@2.5.0 https://github.com/sachinchoolur/lightgallery
clipboard.js@2.0.11 https://github.com/zenorocha/clipboard.js
sharer.js@0.5.1 https://github.com/ellisonleao/sharer.js
typeit@8.6.0 https://github.com/alexmacarthur/typeit
katex@0.16.0 https://katex.org/
mermaid@9.1.3 https://github.com/mermaid-js/mermaid
echarts@5.3.3 https://echarts.apache.org/
mapbox-gl@2.9.1 https://github.com/mapbox/mapbox-gl-js
aplayer@1.10.1 https://github.com/MoePlayer/APlayer
meting@2.0.1 https://github.com/metowolf/MetingJS
gitalk@1.7.2 https://github.com/gitalk/gitalk
valine@1.5.0 https://valine.js.org/
cookieconsent@3.1.1 https://github.com/osano/cookieconsent

View file

@ -0,0 +1,28 @@
# Dependency Libraries Version
| Dependency Library | Directory | Version |
|:------------------------------------------------------------------------------------|:------------------|--------:|
| [Algolia Search Client](https://github.com/algolia/algoliasearch-client-javascript) | algoliasearch | 5.20.2 |
| [Animate.css](https://github.com/daneden/animate.css) | animate | 4.1.1 |
| [APlayer](https://github.com/MoePlayer/APlayer) | aplayer | 1.10.1 |
| [Autocomplete](https://github.com/algolia/autocomplete) | autocomplete | 0.38.1 |
| [clipboard.js](https://github.com/zenorocha/clipboard.js) | clipboard | 2.0.11 |
| [Cookie Consent](https://github.com/osano/cookieconsent) | cookieconsent | 3.1.1 |
| [Apache ECharts](https://github.com/apache/echarts) | echarts | 5.3.3 |
| [emoji-data](https://github.com/iamcal/emoji-data) | emoji-data | 15.1.2 |
| [Font Awesome Free](https://github.com/FortAwesome/Font-Awesome) | fontawesome-free | 6.1.1 |
| [Gitalk](https://github.com/gitalk/gitalk) | gitalk | 1.7.2 |
| [KaTeX](https://github.com/KaTeX/KaTeX) | katex | 0.16.0 |
| [lazysizes](https://github.com/aFarkas/lazysizes) | lazysizes | 5.3.2 |
| [lightGallery](https://github.com/sachinchoolur/lightgallery) | lightgallery | 2.5.0 |
| [Lunr.js](https://github.com/olivernn/lunr.js) | lunr | 2.3.9 |
| [Mapbox GL JS](https://github.com/mapbox/mapbox-gl-js) | mapbox-gl | 2.9.1 |
| [Mermaid](https://github.com/mermaid-js/mermaid) | mermaid | 9.1.3 |
| [MetingJS](https://github.com/metowolf/MetingJS) | meting | 2.0.1 |
| [normalize.css](https://github.com/necolas/normalize.css) | normalize | 8.0.1 |
| [object-fit-images](https://github.com/fregante/object-fit-images) | object-fit-images | 3.2.4 |
| [sharer.js](https://github.com/ellisonleao/sharer.js) | sharer | 0.5.1 |
| [Simple Icons](https://github.com/simple-icons/simple-icons) | simple-icons | 7.3.0 |
| [Twemoji](https://github.com/twitter/twemoji) | twemoji | 14.0.2 |
| [TypeIt](https://github.com/alexmacarthur/typeit) | typeit | 8.6.0 |
| [Valine](https://github.com/xCss/Valine) | valine | 1.5.3 |

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

File diff suppressed because one or more lines are too long

View file

@ -1,4 +1,4 @@
emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-apple@14.0.0/img/apple/64/'
emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-apple@15.1.2/img/apple/64/'
emojiMaps:
'100': 1f4af.png
grinning: 1f600.png

View file

@ -1,4 +1,4 @@
emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-facebook@14.0.0/img/facebook/64/'
emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-facebook@15.1.2/img/facebook/64/'
emojiMaps:
'100': 1f4af.png
grinning: 1f600.png

View file

@ -1,4 +1,4 @@
emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-google@14.0.0/img/google/64/'
emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-google@15.1.2/img/google/64/'
emojiMaps:
'100': 1f4af.png
grinning: 1f600.png

View file

@ -1,4 +1,4 @@
emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-twitter@14.0.0/img/twitter/64/'
emojiCDN: 'https://cdn.jsdelivr.net/npm/emoji-datasource-twitter@15.1.2/img/twitter/64/'
emojiMaps:
'100': 1f4af.png
grinning: 1f600.png

View file

@ -29,6 +29,20 @@ $code-background-color-dark: #272C34 !default;
tab-size: $value;
}
@mixin transition($values...) {
-webkit-transition: $values;
-moz-transition: $values;
-o-transition: $values;
transition: $values;
}
@mixin transform($value) {
-webkit-transform: $value;
-ms-transform: $value;
-o-transform: $value;
transform: $value;
}
.v[data-class=v] {
.vcards .vcard .vcontent.expand {
&::before, &::after {
@ -66,4 +80,19 @@ $code-background-color-dark: #272C34 !default;
max-width: 1.5em;
vertical-align: text-bottom;
}
// fix valine.js inside css will be override pulse animate for page title
@keyframes pulse {
0% {
@include transform(scaleX(1));
}
50% {
@include transform(scale3d(1.05, 1.05, 1.05));
}
to {
@include transform(scaleX(1));
}
}
}

View file

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" aria-label="Malt" role="img" viewBox="0 0 512 512" fill="#000000"><g id="SVGRepo_bgCarrier" stroke-width="0"></g><g id="SVGRepo_tracerCarrier" stroke-linecap="round" stroke-linejoin="round"></g><g id="SVGRepo_iconCarrier"><rect width="512" height="512" rx="15%" fill="none"></rect> <path fill="#FC5656" d="m408.4 103.8c-32.5-32.4-67.1-11.4-88.8 10.2L114.8 318.8c-21.7 21.7-44.4 54.7-10.2 88.8c34.1 34.1 67 11.4 88.7-10.3l204.8-204.8c21.7-21.6 42.7-56.3 10.3-88.7zm-195.7-8.4 43.4 43.4 44.1-44.2c3-3 6-5.8 9.1-8.4c-4.6-23.3-17.9-44.4-53.3-44.4c-35.4 0-48.7 21.2-53.2 44.5c3.3 2.9 6.6 5.8 9.9 9.1zm87.5 322.1-44.1-44.1-43.4 43.3c-3.3 3.3-6.5 6.4-9.8 9.2c5 23.8 19 45.5 53.1 45.5c34.2 0 48.3-21.9 53.2-45.7c-3-2.6-6-5.2-9-8.2zm-105.9-217h-83.6c-30.7 0-70 9.7-70 55.5c0 34.3 21.9 48.3 45.8 53.2c2.8-3.2 107.8-108.7 107.8-108.7zm231.5 2.3c-2.6 3-107.9 108.8-107.9 108.8h82.4c30.7 0 70-7.3 70-55.6c0-35.3-21.1-48.6-44.5-53.2zm-204.1-29.7 14.9-14.9-43.3-43.4c-21.7-21.7-54.6-44.4-88.8-10.2c-25 25-19.4 49.4-6.2 69.1c4.1-.3 123.4-.6 123.4-.6zm68.7 165.9-15 15 44.2 44.1c21.7 21.7 56.3 42.7 88.7 10.3c24.2-24.2 18.7-49.7 5.3-70c-4.3.3-123.2.6-123.2.6z"></path> </g></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -13,7 +13,7 @@ math:
{{< style "img { height: 1.25rem; }" >}}
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/releases)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.62.0-ff4088?style=flat-square&logo=hugo)](https://gohugo.io/)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.128.0-ff4088?style=flat-square&logo=hugo)](https://gohugo.io/)
[![License](https://img.shields.io/github/license/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/blob/master/LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/dillonzq/LoveIt?style=social)](https://github.com/dillonzq/LoveIt)
[![GitHub forks](https://img.shields.io/github/forks/dillonzq/LoveIt?style=social)](https://github.com/dillonzq/LoveIt/fork)
@ -53,7 +53,7 @@ math:
* :(far fa-user fa-fw): **Gravatar** supported by [Gravatar](https://gravatar.com)
* :(fas fa-user-circle fa-fw): Local **Avatar** supported
* :(far fa-id-card fa-fw): Up to **73** social links supported
* :(far fa-id-card fa-fw): Up to **76** social links supported
* :(fas fa-share-square fa-fw): Up to **24** share sites supported
* :(far fa-comment fa-fw): **Disqus** comment system supported by [Disqus](https://disqus.com)
* :(far fa-comment-dots fa-fw): **Gitalk** comment system supported by [Gitalk](https://github.com/gitalk/gitalk)

View file

@ -13,7 +13,7 @@ math:
{{< style "img { height: 1.25rem; }" >}}
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/releases)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.62.0-ff4088?style=flat-square&logo=hugo)](https://gohugo.io/)
[![Hugo](https://img.shields.io/badge/Hugo-%5E0.128.0-ff4088?style=flat-square&logo=hugo)](https://gohugo.io/)
[![License](https://img.shields.io/github/license/dillonzq/LoveIt?style=flat-square)](https://github.com/dillonzq/LoveIt/blob/master/LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/dillonzq/LoveIt?style=social)](https://github.com/dillonzq/LoveIt)
[![GitHub forks](https://img.shields.io/github/forks/dillonzq/LoveIt?style=social)](https://github.com/dillonzq/LoveIt/fork)
@ -35,7 +35,7 @@ math:
* :(far fa-chart-bar fa-fw): 支持 **[Fathom Analytics](https://usefathom.com/)**
* :(fas fa-chart-column fa-fw): 支持 **[Plausible Analytics](https://plausible.io/)**
* :(fab fa-yandex-international fa-fw): 支持 **[Yandex Metrica](https://metrica.yandex.com/)**
* :(fas fa-sitemap fa-fw): 支持搜索引擎的**网站验证** (Google, Bind, Yandex and Baidu)
* :(fas fa-sitemap fa-fw): 支持搜索引擎的**网站验证** (Google, Bind, Yandex Baidu)
* :(fas fa-tachometer-alt fa-fw): 支持所有第三方库的 **CDN**
* :(fas fa-cloud-download-alt fa-fw): 基于 [lazysizes](https://github.com/aFarkas/lazysizes) 自动转换图片为**懒加载**
@ -53,7 +53,7 @@ math:
* :(far fa-user fa-fw): 支持 **[Gravatar](https://gravatar.com)** 头像
* :(fas fa-user-circle fa-fw): 支持本地**头像**
* :(far fa-id-card fa-fw): 支持多达 **73** 种社交链接
* :(far fa-id-card fa-fw): 支持多达 **76** 种社交链接
* :(fas fa-share-square fa-fw): 支持多达 **24** 种网站分享
* :(far fa-comment fa-fw): 支持 **[Disqus](https://disqus.com)** 评论系统
* :(far fa-comment-dots fa-fw): 支持 **[Gitalk](https://github.com/gitalk/gitalk)** 评论系统

View file

@ -23,7 +23,7 @@ This article offers a sample of basic Markdown syntax that can be used in Hugo c
<!--more-->
{{< admonition >}}
This article is a shameful copy of the great [Grav original page](http://learn.getgrav.org/content/markdown).
This article is a shameful copy of the great [Grav original page](https://learn.getgrav.org/content/markdown).
If you want to know about the extended Markdown syntax of **LoveIt** theme, please read [extended Markdown syntax page](../theme-documentation-content#extended-markdown-syntax).
{{< /admonition >}}

View file

@ -23,7 +23,7 @@ lightgallery: true
<!--more-->
{{< admonition >}}
这篇文章借鉴了一篇很棒的[来自 Grav 的文章](http://learn.getgrav.org/content/markdown).
这篇文章借鉴了一篇很棒的[来自 Grav 的文章](https://learn.getgrav.org/content/markdown).
如果你想了解 **Loveit** 主题的扩展 Markdown 语法, 请阅读[扩展 Markdown 语法页面](../theme-documentation-content#extended-markdown-syntax).
{{< /admonition >}}

Binary file not shown.

After

Width:  |  Height:  |  Size: 407 KiB

View file

@ -29,14 +29,12 @@ Discover what the Hugo - **LoveIt** theme is all about and the core-concepts beh
Thanks to the simplicity of Hugo, [Hugo](https://gohugo.io/) is the only dependency of this theme.
Just install latest version of [:(far fa-file-archive fa-fw): Hugo (> 0.62.0)](https://gohugo.io/getting-started/installing/) for your OS (**Windows**, **Linux**, **macOS**).
Just install latest edition of [:(far fa-file-archive fa-fw): Hugo](https://gohugo.io/getting-started/installing/) for your OS (**Windows**, **Linux**, **macOS**).
{{< admonition note "Why not support earlier versions of Hugo?" >}}
Since [Markdown Render Hooks](https://gohugo.io/getting-started/configuration-markup#markdown-render-hooks) was introduced in the [Hugo Christmas Edition](https://gohugo.io/news/0.62.0-relnotes/), this theme only supports Hugo versions above **0.62.0**.
{{< /admonition >}}
{{< admonition note "When you need to use Hugo extended edition?" false >}}
When you want [style customization](#style-customization), you need to use the Hugo **extended edition** for correct rendering.
{{< admonition tip "Hugo extended version is recommended" >}}
Since some features of this theme need to processes :(fab fa-sass fa-fw): SCSS to :(fab fa-css3 fa-fw): CSS, it is recommended to use Hugo **extended** version for better experience.
![Hugo extended edition](hugo-extended-edition.png "Hugo extended edition")
{{< /admonition >}}
## 2 Installation
@ -54,9 +52,9 @@ cd my_website
### 2.2 Install the Theme
The **LoveIt** themes repository is: [https://github.com/dillonzq/LoveIt](https://github.com/dillonzq/LoveIt).
The **LoveIt** theme's repository is: [https://github.com/dillonzq/LoveIt](https://github.com/dillonzq/LoveIt).
You can download the [latest release :(far fa-file-archive fa-fw): .zip file](https://github.com/dillonzq/LoveIt/releases) of the theme and extract it in the `themes` directory.
You can download the [release :(far fa-file-archive fa-fw): .zip file](https://github.com/dillonzq/LoveIt/releases) of the theme and extract it in the `themes` directory.
Alternatively, clone this repository to the `themes` directory:
@ -71,6 +69,16 @@ git init
git submodule add https://github.com/dillonzq/LoveIt.git themes/LoveIt
```
{{< admonition note "LoveIt theme's compatibility" >}}
| LoveIt branch or version | Supported Hugo versions |
|:-------------------------|:-----------------------:|
| master(Unstable) | ≥ 0.128.0 |
| **0.3.X(Recommended)** | 0.128.0 - 0.144.2 |
| 0.2.X(Outdated) | 0.68.0 - 0.127.0 |
{{< /admonition >}}
### 2.3 Basic Configuration {#basic-configuration}
The following is a basic configuration for the LoveIt theme:
@ -89,12 +97,6 @@ languageCode = "en"
# language name ["English", "简体中文", "Français", "Polski", ...]
languageName = "English"
# Author config
[author]
name = "xxxx"
email = ""
link = ""
# Menu config
[menu]
[[menu.main]]
@ -134,7 +136,7 @@ languageName = "English"
```
{{< admonition >}}
When building the website, you can set a theme by using `--theme` option. However, we suggest you modify the configuration file (**config.toml**) and set the theme as the default.
When building the website, you can set a theme by using `--theme` option. However, we suggest you modify the configuration file (**hugo.toml**) and set the theme as the default.
{{< /admonition >}}
### 2.4 Create Your First Post
@ -174,6 +176,7 @@ it is highly recommended that you add `--disableFastRender` parameter to `hugo s
```bash
hugo serve --disableFastRender
```
{{< /admonition >}}
### 2.6 Build the Website
@ -195,7 +198,7 @@ Alternatively, you can use [AWS Amplify](https://gohugo.io/hosting-and-deploymen
### 3.1 Site Configuration {#site-configuration}
In addition to [Hugo global configuration](https://gohugo.io/overview/configuration/) and [menu configuration](#basic-configuration), **LoveIt** lets you define the following parameters in your site configuration (here is a `config.toml`, whose values are default).
In addition to [Hugo global configuration](https://gohugo.io/overview/configuration/) and [menu configuration](#basic-configuration), **LoveIt** lets you define the following parameters in your site configuration (here is a `hugo.toml`, whose values are default).
Please open the code block below to view the complete sample configuration :(far fa-hand-point-down fa-fw)::
@ -215,10 +218,6 @@ languageName = "English"
# whether to include Chinese/Japanese/Korean
hasCJKLanguage = false
# default amount of posts in each pages
paginate = 12
# google analytics code [UA-XXXXXXXX-X]
googleAnalytics = ""
# copyright description used only for seo schema
copyright = ""
@ -232,11 +231,11 @@ enableEmoji = true
# ignore some build errors
ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# Author config
[author]
name = "xxxx"
email = ""
link = ""
# Pagination config
[pagination]
disableAliases = false
pagerSize = 10
path = "page"
# Menu config
[menu]
@ -285,6 +284,12 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# website images for Open Graph and Twitter Cards
images = ["/logo.png"]
# Author config
[params.author]
name = "xxxx"
email = ""
link = ""
# Header config
[params.header]
# desktop header mode ["fixed", "normal", "auto"]
@ -481,6 +486,10 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
Plume = ""
HackTheBox = ""
RootMe= ""
Malt = ""
TikTok = ""
TryHackMe = ""
Codeberg = ""
Phone = ""
Email = "xxxx@xxxx.com"
RSS = true # {{< version 0.2.0 >}}
@ -510,7 +519,7 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# whether to enable the table of the contents
enable = true
# {{< version 0.2.9 >}} whether to keep the static table of the contents in front of the post
keepStatic = true
keepStatic = false
# whether to make the table of the contents in the sidebar automatically collapsed
auto = true
# {{< version 0.2.0 changed >}} {{< link "https://katex.org/" KaTeX >}} mathematical formulas
@ -898,11 +907,12 @@ into `/static`. Theyre easily created via [https://realfavicongenerator.net/]
Customize `browserconfig.xml` and `site.webmanifest` to set theme-color and background-color.
### 3.3 Style Customization
### 3.3 Style Customization {#style-customization}
{{< version 0.2.8 changed >}}
{{< admonition >}}
{{< admonition note "Hugo extended version is necessary" >}}
Since Hugo need to processes :(fab fa-sass fa-fw): SCSS to :(fab fa-css3 fa-fw): CSS,
Hugo **extended** version is necessary for the style customization.
{{< /admonition >}}
@ -931,30 +941,32 @@ In `assets/css/_custom.scss`, you can add some css style code to customize the s
{{< version 0.2.10 changed >}}
| Language | Hugo Code | HTML `lang` Attribute | Theme Docs | Lunr.js Support |
|:-------------------- |:---------:|:---------------------:|:-----------------------------:|:-----------------------------:|
| English | `en` | `en` | :(far fa-check-square fa-fw): | :(far fa-check-square fa-fw): |
| Simplified Chinese | `zh-cn` | `zh-CN` | :(far fa-check-square fa-fw): | :(far fa-check-square fa-fw): |
| Traditional Chinese | `zh-tw` | `zh-TW` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| French | `fr` | `fr` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Polish | `pl` | `pl` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| Brazilian Portuguese | `pt-br` | `pt-BR` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Italian | `it` | `it` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Spanish | `es` | `es` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| German | `de` | `de` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| German | `de` | `de` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Serbian | `sr` | `sr` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| Russian | `ru` | `ru` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Romanian | `ro` | `ro` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Vietnamese | `vi` | `vi` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Arabic | `ar` | `ar` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Catalan | `ca` | `ca` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| Thai | `th` | `th` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Telugu | `te` | `te` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| Indonesian | `id` | `id` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| Turkish | `tr` | `tr` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Korean | `ko` | `ko` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| Hindi | `hi` | `hi` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| Language | Hugo Code | HTML `lang` Attribute | Theme Docs | Lunr.js Support |
|:--------------------|:---------:|:---------------------:|:-----------------------------:|:-----------------------------:|
| English | `en` | `en` | :(far fa-check-square fa-fw): | :(far fa-check-square fa-fw): |
| Simplified Chinese | `zh-cn` | `zh-CN` | :(far fa-check-square fa-fw): | :(far fa-check-square fa-fw): |
| Traditional Chinese | `zh-tw` | `zh-TW` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| French | `fr` | `fr` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Polish | `pl` | `pl` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| Portuguese (Brazil) | `pt-br` | `pt-BR` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Italian | `it` | `it` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Spanish | `es` | `es` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| German | `de` | `de` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| German | `de` | `de` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Serbian | `sr` | `sr` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| Russian | `ru` | `ru` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Romanian | `ro` | `ro` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Vietnamese | `vi` | `vi` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Arabic | `ar` | `ar` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Catalan | `ca` | `ca` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| Thai | `th` | `th` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Telugu | `te` | `te` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| Indonesian | `id` | `id` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| Turkish | `tr` | `tr` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Korean | `ko` | `ko` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| Hindi | `hi` | `hi` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| Dutch | `nl` | `nl` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| Bengali | `hi` | `hi` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
### 4.2 Basic Configuration

View file

@ -27,16 +27,14 @@ toc:
## 1 准备
由于 Hugo 提供的便利性, [Hugo](https://gohugo.io/) 本身是这个主题唯一的依赖.
由于 Hugo 提供的便利性, [Hugo](https://gohugo.io/) 是这个主题唯一的依赖.
直接安装满足你操作系统 (**Windows**, **Linux**, **macOS**) 的最新版本 [:(far fa-file-archive fa-fw): Hugo (> 0.62.0)](https://gohugo.io/getting-started/installing/).
直接安装满足你操作系统 (**Windows**, **Linux**, **macOS**) 的最新版本 [:(far fa-file-archive fa-fw): Hugo](https://gohugo.io/getting-started/installing/).
{{< admonition note "为什么不支持早期版本的 Hugo?" >}}
由于 [Markdown 渲染钩子函数](https://gohugo.io/getting-started/configuration-markup#markdown-render-hooks) 在 [Hugo 圣诞节版本](https://gohugo.io/news/0.62.0-relnotes/) 中被引入, 本主题只支持高于 **0.62.0** 的 Hugo 版本.
{{< /admonition >}}
{{< admonition note "什么时候需要使用 Hugo extended 版本?" false >}}
当你需要[自定义样式](#style-customization)时, 你要使用 Hugo **extended** 版本来获得正确的渲染效果.
{{< admonition tip "推荐使用 Hugo extended 版本" >}}
由于这个主题的一些特性需要将 :(fab fa-sass fa-fw): SCSS 转换为 :(fab fa-css3 fa-fw): CSS, 推荐使用 Hugo **extended** 版本来获得更好的使用体验.
![Hugo extended 版本](hugo-extended-edition.png "Hugo extended 版本")
{{< /admonition >}}
## 2 安装
@ -56,7 +54,7 @@ cd my_website
**LoveIt** 主题的仓库是: [https://github.com/dillonzq/LoveIt](https://github.com/dillonzq/LoveIt).
你可以下载主题的 [最新版本 :(far fa-file-archive fa-fw): .zip 文件](https://github.com/dillonzq/LoveIt/releases) 并且解压放到 `themes` 目录.
你可以下载主题的 [发布版本 :(far fa-file-archive fa-fw): .zip 文件](https://github.com/dillonzq/LoveIt/releases) 并且解压放到 `themes` 目录.
另外, 也可以直接把这个主题克隆到 `themes` 目录:
@ -71,6 +69,16 @@ git init
git submodule add https://github.com/dillonzq/LoveIt.git themes/LoveIt
```
{{< admonition note "主题的兼容性" >}}
| 分支或版本 | 支持的 Hugo 版本 |
|:--------------|:-----------------:|
| master(不稳定) | ≥ 0.128.0 |
| **0.3.X(推荐)** | 0.128.0 - 0.144.2 |
| 0.2.X(过时) | 0.68.0 - 0.127.0 |
{{< /admonition >}}
### 2.3 基础配置 {#basic-configuration}
以下是 LoveIt 主题的基本配置:
@ -91,12 +99,6 @@ languageName = "简体中文"
# 是否包括中日韩文字
hasCJKLanguage = true
# 作者配置
[author]
name = "xxxx"
email = ""
link = ""
# 菜单配置
[menu]
[[menu.main]]
@ -136,7 +138,7 @@ hasCJKLanguage = true
```
{{< admonition >}}
在构建网站时, 你可以使用 `--theme` 选项设置主题. 但是, 我建议你修改配置文件 (**config.toml**) 将本主题设置为默认主题.
在构建网站时, 你可以使用 `--theme` 选项设置主题. 但是, 我建议你修改配置文件 (**hugo.toml**) 将本主题设置为默认主题.
{{< /admonition >}}
### 2.4 创建你的第一篇文章
@ -176,6 +178,7 @@ hugo serve
```bash
hugo serve --disableFastRender
```
{{< /admonition >}}
### 2.6 构建网站
@ -197,7 +200,7 @@ hugo
### 3.1 网站配置 {#site-configuration}
除了 [Hugo 全局配置](https://gohugo.io/overview/configuration/) 和 [菜单配置](#basic-configuration) 之外, **LoveIt** 主题还允许您在网站配置中定义以下参数 (这是一个示例 `config.toml`, 其内容为默认值).
除了 [Hugo 全局配置](https://gohugo.io/overview/configuration/) 和 [菜单配置](#basic-configuration) 之外, **LoveIt** 主题还允许您在网站配置中定义以下参数 (这是一个示例 `hugo.toml`, 其内容为默认值).
请打开下面的代码块查看完整的示例配置 :(far fa-hand-point-down fa-fw)::
@ -217,10 +220,6 @@ languageName = "简体中文"
# 是否包括中日韩文字
hasCJKLanguage = true
# 默认每页列表显示的文章数目
paginate = 12
# 谷歌分析代号 [UA-XXXXXXXX-X]
googleAnalytics = ""
# 版权描述,仅仅用于 SEO
copyright = ""
@ -234,11 +233,11 @@ enableEmoji = true
# 忽略一些构建错误
ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# 作者配置
[author]
name = "xxxx"
email = ""
link = ""
# 分页配置
[pagination]
disableAliases = false
pagerSize = 10
path = "page"
# 菜单配置
[menu]
@ -287,6 +286,12 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# 网站图片, 用于 Open Graph 和 Twitter Cards
images = ["/logo.png"]
# 作者配置
[params.author]
name = "xxxx"
email = ""
link = ""
# 页面头部导航栏配置
[params.header]
# 桌面端导航栏模式 ["fixed", "normal", "auto"]
@ -483,6 +488,10 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
Plume = ""
HackTheBox = ""
RootMe= ""
Malt = ""
TikTok = ""
TryHackMe = ""
Codeberg = ""
Phone = ""
Email = "xxxx@xxxx.com"
RSS = true # {{< version 0.2.0 >}}
@ -512,7 +521,7 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# 是否使用目录
enable = true
# {{< version 0.2.9 >}} 是否保持使用文章前面的静态目录
keepStatic = true
keepStatic = false
# 是否使侧边目录自动折叠展开
auto = true
# {{< version 0.2.0 >}} 代码配置
@ -901,12 +910,12 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
可以自定义 `browserconfig.xml``site.webmanifest` 文件来设置 theme-color 和 background-color.
### 3.3 自定义样式
### 3.3 自定义样式 {#style-customization}
{{< version 0.2.8 changed >}}
{{< admonition >}}
Hugo **extended** 版本对于自定义样式是必需的.
{{< admonition note "Hugo extended 版本是必需的" >}}
由于需要将 :(fab fa-sass fa-fw): SCSS 转换为 :(fab fa-css3 fa-fw): CSS, Hugo **extended** 版本对于自定义样式是必需的.
{{< /admonition >}}
通过定义自定义 `.scss` 样式文件, **LoveIt** 主题支持可配置的样式.
@ -934,29 +943,31 @@ $code-font-family: Fira Mono, Source Code Pro, Menlo, Consolas, Monaco, monospac
{{< version 0.2.10 changed >}}
| 语言 | Hugo 代码 | HTML `lang` 属性 | 主题文档 | Lunr.js 支持 |
|:---- |:----:|:----:|:----:|:----:|
| 英语 | `en` | `en` | :(far fa-check-square fa-fw): | :(far fa-check-square fa-fw): |
| 简体中文 | `zh-cn` | `zh-CN` | :(far fa-check-square fa-fw): | :(far fa-check-square fa-fw): |
| 繁體中文 | `zh-tw` | `zh-TW` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 法语 | `fr` | `fr` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 波兰语 | `pl` | `pl` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| 巴西葡萄牙语 | `pt-br` | `pt-BR` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 意大利语 | `it` | `it` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 西班牙语 | `es` | `es` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 德语 | `de` | `de` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 塞尔维亚语 | `pl` | `pl` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| 俄语 | `ru` | `ru` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 罗马尼亚语 | `ro` | `ro` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 越南语 | `vi` | `vi` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 阿拉伯语 | `ar` | `ar` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 加泰罗尼亚语 | `ca` | `ca` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| 泰语 | `th` | `th` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 泰卢固语 | `te` | `te` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| 印尼语 | `id` | `id` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| 土耳其语 | `tr` | `tr` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 韩语 | `ko` | `ko` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| 印地语 | `hi` | `hi` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| 语言 | Hugo 代码 | HTML `lang` 属性 | 主题文档 | Lunr.js 支持 |
|:---------|:-------:|:--------------:|:-----------------------------:|:-----------------------------:|
| 英语 | `en` | `en` | :(far fa-check-square fa-fw): | :(far fa-check-square fa-fw): |
| 简体中文 | `zh-cn` | `zh-CN` | :(far fa-check-square fa-fw): | :(far fa-check-square fa-fw): |
| 繁体中文 | `zh-tw` | `zh-TW` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 法语 | `fr` | `fr` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 波兰语 | `pl` | `pl` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| 葡萄牙语(巴西) | `pt-br` | `pt-BR` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 意大利语 | `it` | `it` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 西班牙语 | `es` | `es` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 德语 | `de` | `de` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 塞尔维亚语 | `pl` | `pl` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| 俄语 | `ru` | `ru` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 罗马尼亚语 | `ro` | `ro` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 越南语 | `vi` | `vi` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 阿拉伯语 | `ar` | `ar` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 加泰罗尼亚语 | `ca` | `ca` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| 泰语 | `th` | `th` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 泰卢固语 | `te` | `te` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| 印尼语 | `id` | `id` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| 土耳其语 | `tr` | `tr` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 韩语 | `ko` | `ko` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| 印地语 | `hi` | `hi` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
| 荷兰语 | `nl` | `nl` | :(far fa-square fa-fw): | :(far fa-check-square fa-fw): |
| 孟加拉语 | `bn` | `bn` | :(far fa-square fa-fw): | :(far fa-square fa-fw): |
### 4.2 基本配置

Binary file not shown.

Before

Width:  |  Height:  |  Size: 280 KiB

After

Width:  |  Height:  |  Size: 425 KiB

Before After
Before After

View file

@ -143,12 +143,12 @@ The rendered output looks like this:
Example `tweet` input:
```markdown
{{</* tweet 917359331535966209 */>}}
{{</* tweet user=GoHugoIO id=917359331535966209 */>}}
```
The rendered output looks like this:
{{< tweet 917359331535966209 >}}
{{< tweet user=GoHugoIO id=917359331535966209 >}}
## 8 vimeo

View file

@ -144,12 +144,12 @@ For more information please have a look at GitHub issue [#7879](https://github.c
一个 `tweet` 示例:
```markdown
{{</* tweet 917359331535966209 */>}}
{{</* tweet user=GoHugoIO id=917359331535966209 */>}}
```
呈现的输出效果如下:
{{< tweet 917359331535966209 >}}
{{< tweet user=GoHugoIO id=917359331535966209 >}}
## 8 vimeo

View file

@ -278,13 +278,13 @@ which helps you write raw mathematical formula content.
Example `raw` input:
```markdown
Inline Formula: {{</* raw */>}}\(\mathbf{E}=\sum_{i} \mathbf{E}_{i}=\mathbf{E}_{1}+\mathbf{E}_{2}+\mathbf{E}_{3}+\cdots\){{</* /raw */>}}
Inline Formula: {?{}{< raw >}}\(\mathbf{E}=\sum_{i} \mathbf{E}_{i}=\mathbf{E}_{1}+\mathbf{E}_{2}+\mathbf{E}_{3}+\cdots\){?{}{< /raw >}}
Block Formula:
{{</* raw */>}}
{?{}{< raw >}}
\[ a=b+c \\ d+e=f \]
{{</* /raw */>}}
{?{}{< /raw >}}
```
The rendered output looks like this:
@ -293,7 +293,7 @@ Inline Formula: {{< raw >}}\(\mathbf{E}=\sum_{i} \mathbf{E}_{i}=\mathbf{E}_{1}+\
Block Formula:
{{< raw>}}
{{< raw >}}
\[ a=b+c \\ d+e=f \]
{{< /raw >}}
{{< /admonition >}}
@ -307,7 +307,7 @@ The default inline delimiters are:
For example:
```tex
```markdown
$c = \pm\sqrt{a^2 + b^2}$ and \\(f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^{2 \pi i \xi x} d \xi\\)
```
@ -329,7 +329,7 @@ The default block delimiters are:
For example:
```tex
```markdown
$$ c = \pm\sqrt{a^2 + b^2} $$
\\[ f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^{2 \pi i \xi x} d \xi \\]

View file

@ -276,13 +276,13 @@ resources:
一个 `raw` 示例:
```markdown
行内公式: {{</* raw */>}}\(\mathbf{E}=\sum_{i} \mathbf{E}_{i}=\mathbf{E}_{1}+\mathbf{E}_{2}+\mathbf{E}_{3}+\cdots\){{</* /raw */>}}
行内公式: {?{}{< raw >}}\(\mathbf{E}=\sum_{i} \mathbf{E}_{i}=\mathbf{E}_{1}+\mathbf{E}_{2}+\mathbf{E}_{3}+\cdots\){?{}{< /raw >}}
公式块:
{{</* raw */>}}
{?{}{< raw >}}
\[ a=b+c \\ d+e=f \]
{{</* /raw */>}}
{?{}{< /raw >}}
```
呈现的输出效果如下:
@ -291,7 +291,7 @@ resources:
公式块:
{{< raw>}}
{{< raw >}}
\[ a=b+c \\ d+e=f \]
{{< /raw >}}
{{< /admonition >}}
@ -305,7 +305,7 @@ resources:
例如:
```tex
```markdown
$c = \pm\sqrt{a^2 + b^2}$ 和 \\(f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^{2 \pi i \xi x} d \xi\\)
```
@ -327,7 +327,7 @@ $c = \pm\sqrt{a^2 + b^2}$ 和 \\(f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^{2
例如:
```tex
```markdown
$$ c = \pm\sqrt{a^2 + b^2} $$
\\[ f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^{2 \pi i \xi x} d \xi \\]

View file

@ -374,16 +374,11 @@ Block Formula:
\[ a=b+c \\ d+e=f \]
{{< /raw >}}
{{< script >}}
console.log('Hello LoveIt!');
{{< /script >}}
This renders as {{< person "https://dillonzq.com/" Dillon "author of the LoveIt theme" >}}.
Raw content using Markdown syntax: {{< raw >}}**Hello**{{< /raw >}}
## 13 person
`person` is a shortcode to insert a link to a personal webpage marked up as [h-card](http://microformats.org/wiki/h-card).
`person` is a shortcode to insert a link to a personal webpage marked up as [h-card](https://microformats.org/wiki/h-card).
The `person` shortcode has the following named parameters:

View file

@ -378,7 +378,7 @@ console.log('Hello LoveIt!');
## 13 person
`person` shortcode 用来在你的文章中以 [h-card](http://microformats.org/wiki/h-card) 的格式插入个人网站链接.
`person` shortcode 用来在你的文章中以 [h-card](https://microformats.org/wiki/h-card) 的格式插入个人网站链接.
`person` shortcode 有以下命名参数:

View file

@ -24,12 +24,6 @@ languageName = "English"
# 是否包括中日韩文字
hasCJKLanguage = false
# default amount of posts in each pages
# 默认每页列表显示的文章数目
paginate = 12
# google analytics code [UA-XXXXXXXX-X]
# 谷歌分析代号 [UA-XXXXXXXX-X]
googleAnalytics = ""
# copyright description used only for seo schema
# 版权描述,仅仅用于 SEO
copyright = ""
@ -48,12 +42,12 @@ enableEmoji = true
# 忽略一些构建错误
ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# Author config
# 作者配置
[author]
name = "xxxx"
email = ""
link = ""
# Pagination config
# 分页配置
[pagination]
disableAliases = false
pagerSize = 10
path = "page"
# Menu config
# 菜单配置
@ -114,6 +108,13 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# 网站图片, 用于 Open Graph 和 Twitter Cards
images = ["/logo.png"]
# Author config
# 作者配置
[params.author]
name = "xxxx"
email = ""
link = ""
# Header config
# 页面头部导航栏配置
[params.header]
@ -359,6 +360,10 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
Plume = ""
HackTheBox = ""
RootMe= ""
Malt = ""
TikTok = ""
TryHackMe = ""
Codeberg = ""
Email = ""
RSS = ""
@ -518,7 +523,7 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
recordIP = true
highlight = true
enableQQ = false
serverURLs = "https://leancloud.hugoloveit.com"
serverURLs = "https://valine.hugoloveit.com"
# emoji data file name, default is "google.yml"
# ["apple.yml", "google.yml", "facebook.yml", "twitter.yml"]
# located in "themes/LoveIt/assets/lib/valine/emoji/" directory
@ -747,7 +752,7 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
# Permalinks config (https://gohugo.io/content-management/urls/#permalinks)
# Permalinks 配置 (https://gohugo.io/content-management/urls/#permalinks)
[Permalinks]
[permalinks]
# posts = ":year/:month/:filename"
posts = ":filename"
@ -854,9 +859,9 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
highlightTag = "em"
absoluteURL = false
[languages.en.params.search.algolia]
index = "index.en"
appID = "PASDMWALPK"
searchKey = "b42948e51daaa93df92381c8e2ac0f93"
index = "index"
appID = "4D1IDY8JU6"
searchKey = "05332ac5ed76655a511f0da583a9afac"
[languages.en.params.home]
rss = 10
[languages.en.params.home.profile]
@ -947,9 +952,9 @@ ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
highlightTag = "em"
absoluteURL = false
[languages.zh-cn.params.search.algolia]
index = "index.zh-cn"
appID = "PASDMWALPK"
searchKey = "b42948e51daaa93df92381c8e2ac0f93"
index = "index"
appID = "GZT24PWKNT"
searchKey = "634ab679e825b815de2663de38908f9d"
[languages.zh-cn.params.home]
rss = 10
[languages.zh-cn.params.home.profile]

View file

@ -1,2 +1 @@
/zh-cn/* /zh-cn/404.html 404
/fr/* /fr/404.html 404

View file

@ -1,7 +1,6 @@
[module]
[module.hugoVersion]
extended = true
min = "0.62.0"
min = "0.128.0"
[params]
# site default theme ["auto", "light", "dark"]
@ -28,6 +27,13 @@
# 网站图片, 用于 Open Graph 和 Twitter Cards
images = []
# Author config
# 作者配置
[params.author]
name = "xxxx"
email = ""
link = ""
# Header config
# 页面头部导航栏配置
[params.header]
@ -273,6 +279,10 @@
Plume = ""
HackTheBox = ""
RootMe= ""
Malt = ""
TikTok = ""
TryHackMe = ""
Codeberg = ""
Email = ""
Phone = ""
RSS = ""

199
themes/LoveIt/i18n/bn.toml Normal file
View file

@ -0,0 +1,199 @@
# Translations for Bengali
# বাংলায় অনুবাদ
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
[backToTop]
other = "উপরে ফিরে যান"
[viewComments]
other = "মন্তব্যগুলো দেখুন"
# === baseof ==
# === Post ===
[posts]
other = "পোস্ট"
# === Post ===
# === Taxonomy ===
[allSome]
other = "সকল {{ .Some }}"
[tag]
other = "ট্যাগ"
[tags]
other = "ট্যাগ"
[category]
other = "ক্যাটাগরি"
[categories]
other = "ক্যাটাগরি"
# === Taxonomy ===
# === Pagination ===
[more]
other = "আরো"
# === Pagination ===
# === partials/header.html ===
[selectLanguage]
other = "ভাষা নির্বাচন"
[switchTheme]
other = "থিম পরিবর্তন"
# === partials/header.html ===
# === partials/footer.html ===
[poweredBySome]
other = "{{ .Hugo }} দ্বারা চালিত | থিম - {{ .Theme }}"
# === partials/footer.html ===
# === partials/comment.html ===
[valineLang]
other = "en"
[valinePlaceholder]
other = "আপনার মন্তব্য ..."
[facebookLanguageCode]
other = "bn_IN"
[giscusLang]
other = "en"
# === partials/comment.html ===
# === partials/assets.html ===
[search]
other = "খুঁজুন"
[searchPlaceholder]
other = "শিরোনাম অথবা কনটেন্ট খুঁজুন..."
[clear]
other = "পরিষ্কার করুন"
[cancel]
other = "বাতিল করুন"
[noResultsFound]
other = "কোনো ফলাফল পাওয়া যায় নি"
[lunrLanguageCode]
other = "en"
[copyToClipboard]
other = "ক্লিপবোর্ডে কপি করুন"
[cookieconsentMessage]
other = "এই ওয়েবসাইটটি আপনার ব্রাউজিং অভিজ্ঞতা সমৃদ্ধ করতে কুকিজ ব্যবহার করে।"
[cookieconsentDismiss]
other = "বুঝেছি!"
[cookieconsentLink]
other = "আরো জানুন"
# === partials/assets.html ===
# === partials/plugin/share.html ===
[shareOn]
other = "শেয়ার করুন"
# === partials/plugin/share.html ===
# === posts/single.html ===
[contents]
other = "বিষয়বস্তু"
[publishedOnDate]
other = "প্রকাশিত {{ .Date }}"
[includedInCategories]
other = "ক্যাটাগরি {{ .Categories }}"
[wordCount]
one = "একটি শব্দ"
other = "{{ .Count }}টি শব্দ"
[readingTime]
one = "এক মিনিট"
other = "{{ .Count }} মিনিট"
[views]
other = "ভিউ"
[author]
other = "লেখক"
[updatedOnDate]
other = "{{ .Date }} তারিখে আপডেট হয়েছে"
[readMarkdown]
other = "মার্কডাউন পড়ুন"
[back]
other = "পিছনে"
[home]
other = "হোম"
[readMore]
other = "আরো পড়ুন"
# === posts/single.html ===
# === 404.html ===
[pageNotFound]
other = "পেজটি খুঁজে পাওয়া যায় নি"
[pageNotFoundText]
other = "দুঃখিত, আপনি যে পেজটি খুঁজছেন তার কোনো অস্তিত্ব নেই।"
# === 404.html ===
# === shortcodes/admonition.html ===
[note]
other = "নোট"
[abstract]
other = "সারাংশ"
[info]
other = "তথ্য"
[tip]
other = "টিপ"
[success]
other = "সফল"
[question]
other = "প্রশ্ন"
[warning]
other = "সতর্কীকরণ"
[failure]
other = "ব্যর্থ"
[danger]
other = "বিপজ্জনক"
[bug]
other = "বাগ"
[example]
other = "উদাহরণ"
[quote]
other = "উক্তি"
# === shortcodes/admonition.html ===
# === shortcodes/version.html ===
[new]
other = "নতুন"
[changed]
other = "পরিবর্তিত"
[deleted]
other = "মুছে ফেলা হয়েছে"
# === shortcodes/version.html ===

View file

@ -69,7 +69,7 @@ other = "de"
other = "Suche"
[searchPlaceholder]
other = "Suche nach Titel und Inhalt..."
other = "Suche nach Titel und Inhalt ..."
[clear]
other = "Leeren"
@ -109,10 +109,10 @@ other = "Teilen auf"
other = "Inhalt"
[publishedOnDate]
other = "veröffentlicht an {{ .Date }}"
other = "Veröffentlicht am {{ .Date }}"
[includedInCategories]
other = "enthalten in {{ .Categories }}"
other = "Enthalten in {{ .Categories }}"
[wordCount]
one = "Ein Wort"
@ -141,7 +141,7 @@ other = "Zurück"
other = "Startseite"
[readMore]
other = "Mehr lesen"
other = "Weiterlesen"
# === posts/single.html ===
# === 404.html ===

View file

@ -4,10 +4,10 @@
# === baseof ==
[backToTop]
other = "Retour en Haut"
other = "Retour en haut"
[viewComments]
other = "Afficher les Commentaires"
other = "Afficher les commentaires"
# === baseof ==
# === Post ===
@ -17,7 +17,7 @@ other = "Posts"
# === Taxonomy ===
[allSome]
other = "Tous {{ .Some }}"
other = "Tous les {{ .Some }}"
[tag]
other = "Balise"
@ -34,7 +34,7 @@ other = "Catégories"
# === Pagination ===
[more]
other = "Plus"
other = "Voir plus"
# === Pagination ===
# === partials/header.html ===
@ -42,7 +42,7 @@ other = "Plus"
other = "Choisir la langue"
[switchTheme]
other = "Changer de Thème"
other = "Changer de thème"
# === partials/header.html ===
# === partials/footer.html ===
@ -72,7 +72,7 @@ other = "Chercher"
other = "Rechercher des titres, des contenus..."
[clear]
other = "Clair"
other = "Effacer"
[cancel]
other = "Annuler"
@ -93,10 +93,10 @@ other = "Copier dans le presse-papiers"
other = "Ce site Web utilise des Cookies pour améliorer votre expérience."
[cookieconsentDismiss]
other = "Se mettre d'accord"
other = "J'accepte"
[cookieconsentLink]
other = "Apprendre encore plus"
other = "En savoir plus"
# === partials/assets.html ===
# === partials/plugin/share.html ===
@ -132,7 +132,7 @@ other = "Auteur"
other = "Mis à jour le {{ .Date }}"
[readMarkdown]
other = "Lire Markdown"
other = "Lire en Markdown"
[back]
other = "Retour"
@ -157,7 +157,7 @@ other = "Désolé, la page recherchée n'existe pas."
other = "Remarque"
[abstract]
other = "Abstrait"
other = "Résumé"
[info]
other = "Info"
@ -195,8 +195,8 @@ other = "Citation"
other = "NOUVEAU"
[changed]
other = "CHANGE"
other = "CHANGÉ"
[deleted]
other = "EFFACE"
other = "EFFACÉ"
# === shortcodes/version.html ===

199
themes/LoveIt/i18n/nl.toml Normal file
View file

@ -0,0 +1,199 @@
# Translations for Dutch
# Vertalingen voor het Nederlands
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
[backToTop]
other = "Terug naar boven"
[viewComments]
other = "Bekijk opmerkingen"
# === baseof ==
# === Post ===
[posts]
other = "Berichten"
# === Post ===
# === Taxonomy ===
[allSome]
other = "Alle {{ .Some }}"
[tag]
other = "Tag"
[tags]
other = "Tags"
[category]
other = "Categorie"
[categories]
other = "Categorieën"
# === Taxonomy ===
# === Pagination ===
[more]
other = "Meer"
# === Pagination ===
# === partials/header.html ===
[selectLanguage]
other = "Selecteer Taal"
[switchTheme]
other = "Verander Thema"
# === partials/header.html ===
# === partials/footer.html ===
[poweredBySome]
other = "Aangedreven door {{ .Hugo }} | Thema - {{ .Theme }}"
# === partials/footer.html ===
# === partials/comment.html ===
[valineLang]
other = "nl"
[valinePlaceholder]
other = "Jouw opmerking"
[facebookLanguageCode]
other = "nl_nl"
[giscusLang]
other = "nl"
# === partials/comment.html ===
# === partials/assets.html ===
[search]
other = "Zoeken"
[searchPlaceholder]
other = "Zoek naar titels of andere inhoud..."
[clear]
other = "Wissen"
[cancel]
other = "Annuleren"
[noResultsFound]
other = "Geen resultaten gevonden"
[lunrLanguageCode]
other = "nl"
[copyToClipboard]
other = "Kopieer naar klembord"
[cookieconsentMessage]
other = "Deze website gebruikt cookies om de ervaring beter te maken."
[cookieconsentDismiss]
other = "Begrepen!"
[cookieconsentLink]
other = "Meer informatie"
# === partials/assets.html ===
# === partials/plugin/share.html ===
[shareOn]
other = "Delen op"
# === partials/plugin/share.html ===
# === posts/single.html ===
[contents]
other = "Content"
[publishedOnDate]
other = "gepubliceerd op {{ .Date }}"
[includedInCategories]
other = "inbegrepen in {{ .Categories }}"
[wordCount]
one = "Één woord"
other = "{{ .Count }} woorden"
[readingTime]
one = "Één minuut"
other = "{{ .Count }} minuten"
[views]
other = "Aantal keer bekeken"
[author]
other = "Auteur"
[updatedOnDate]
other = "Aangepast op {{ .Date }}"
[readMarkdown]
other = "Lees markdown"
[back]
other = "Terug"
[home]
other = "Homepagina"
[readMore]
other = "Lees Meer"
# === posts/single.html ===
# === 404.html ===
[pageNotFound]
other = "Pagina niet gevonden"
[pageNotFoundText]
other = "De pagina die je zocht bestaat niet, Sorry!"
# === 404.html ===
# === shortcodes/admonition.html ===
[note]
other = "Opmerking"
[abstract]
other = "Abstract"
[info]
other = "Info"
[tip]
other = "Tip"
[success]
other = "Gelukt"
[question]
other = "Vraag"
[warning]
other = "Waarschuwing"
[failure]
other = "Fout"
[danger]
other = "Gevaar"
[bug]
other = "Bug"
[example]
other = "Voorbeeld"
[quote]
other = "Citaat"
# === shortcodes/admonition.html ===
# === shortcodes/version.html ===
[new]
other = "NIEUW"
[changed]
other = "VERANDERD"
[deleted]
other = "VERWIJDERD"
# === shortcodes/version.html ===

198
themes/LoveIt/i18n/uk.toml Normal file
View file

@ -0,0 +1,198 @@
# Translations for Ukrainian
# https://gohugo.io/content-management/multilingual/#translation-of-strings
# === baseof ==
[backToTop]
other = "Повернутися до початку"
[viewComments]
other = "Переглянути коментарі"
# === baseof ==
# === Post ===
[posts]
other = "Публікації"
# === Post ===
# === Taxonomy ===
[allSome]
other = "Всі {{ .Some }}"
[tag]
other = "Тег"
[tags]
other = "Теги"
[category]
other = "Категорія"
[categories]
other = "Категорії"
# === Taxonomy ===
# === Pagination ===
[more]
other = "Більше"
# === Pagination ===
# === partials/header.html ===
[selectLanguage]
other = "Змінити мову"
[switchTheme]
other = "Змінити тему"
# === partials/header.html ===
# === partials/footer.html ===
[poweredBySome]
other = "Працює на основі {{ .Hugo }} | Theme - {{ .Theme }}"
# === partials/footer.html ===
# === partials/comment.html ===
[valineLang]
other = "en"
[valinePlaceholder]
other = "Ваш коментар ..."
[facebookLanguageCode]
other = "uk_UA"
[giscusLang]
other = "uk"
# === partials/comment.html ===
# === partials/assets.html ===
[search]
other = "Пошук"
[searchPlaceholder]
other = "Search titles or contents..."
[clear]
other = "Очистити"
[cancel]
other = "Скасувати"
[noResultsFound]
other = "Нічого не знайдено"
[lunrLanguageCode]
other = "uk"
[copyToClipboard]
other = "Скопіювати до буфера обміну"
[cookieconsentMessage]
other = "Цей веб-сайт використовує файли cookie, щоб покращити ваш досвід."
[cookieconsentDismiss]
other = "Зрозуміло!"
[cookieconsentLink]
other = "Дізнатися більше"
# === partials/assets.html ===
# === partials/plugin/share.html ===
[shareOn]
other = "Поділитися в"
# === partials/plugin/share.html ===
# === posts/single.html ===
[contents]
other = "Зміст"
[publishedOnDate]
other = "опубліковано {{ .Date }}"
[includedInCategories]
other = "включений в{{ .Categories }}"
[wordCount]
one = "Одне слово"
other = "{{ .Count }} слів"
[readingTime]
one = "Одна минута"
other = "{{ .Count }} минут"
[views]
other = "перегляди"
[author]
other = "Автор"
[updatedOnDate]
other = "Оновлено {{ .Date }}"
[readMarkdown]
other = "Читати Markdown"
[back]
other = "Повернутися"
[home]
other = "Головна"
[readMore]
other = "Детальніше"
# === posts/single.html ===
# === 404.html ===
[pageNotFound]
other = "Сторінку не знайдено"
[pageNotFoundText]
other = "Сторінка, яку ви шукаєте, не існує. Вибачте."
# === 404.html ===
# === shortcodes/admonition.html ===
[note]
other = "Примітка"
[abstract]
other = "Анотація"
[info]
other = "Інформація"
[tip]
other = "Порада"
[success]
other = "Успіх"
[question]
other = "Питання"
[warning]
other = "Попередження"
[failure]
other = "Невдача"
[danger]
other = "Небезпека"
[bug]
other = "Помилка"
[example]
other = "Приклад"
[quote]
other = "Цитата"
# === shortcodes/admonition.html ===
# === shortcodes/version.html ===
[new]
other = "НОВИЙ"
[changed]
other = "ЗМІНЕНИЙ"
[deleted]
other = "ВИДАЛЕНИЙ"
# === shortcodes/version.html ===

View file

@ -0,0 +1 @@
{{- dict "Content" .Inner "Lang" .Type "Options" .Options | partial "plugin/code-block.html" -}}

View file

@ -35,7 +35,9 @@
<a href="#" id="back-to-top" class="fixed-button" title="{{ T `backToTop` }}">
<i class="fas fa-arrow-up fa-fw" aria-hidden="true"></i>
</a>
</div>
<div id="fixed-buttons-hidden">
{{- /* comment button */ -}}
<a href="#" id="view-comments" class="fixed-button" title="{{ T `viewComments` }}">
<i class="fas fa-comment fa-fw" aria-hidden="true"></i>

View file

@ -24,8 +24,8 @@
{{- /* Meta */ -}}
<div class="post-meta">
{{- $author := $params.author | default .Site.Author.name | default (T "author") -}}
{{- $authorLink := $params.authorlink | default .Site.Author.link | default .Site.Home.RelPermalink -}}
{{- $author := $params.author | default .Site.Params.Author.name | default (T "author") -}}
{{- $authorLink := $params.authorlink | default .Site.Params.Author.link | default .Site.Home.RelPermalink -}}
<span class="post-author">
{{- $options := dict "Class" "author" "Destination" $authorLink "Title" "Author" "Rel" "author" "Icon" (dict "Class" "fas fa-user-circle fa-fw") "Content" $author -}}
{{- partial "plugin/a.html" $options -}}

View file

@ -15,12 +15,12 @@
{{- . -}}
</language>
{{- end -}}
{{- with .Site.Author.email -}}
{{- with .Site.Params.Author.email -}}
<managingEditor>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.Author.name }} ({{ . }}){{ end -}}
</managingEditor>
<webMaster>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.Author.name }} ({{ . }}){{ end -}}
</webMaster>
{{- end -}}
{{- with .Site.Copyright -}}

View file

@ -24,7 +24,7 @@
{{- dict "Source" (T "lunrLanguageLib") "Minify" true "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- end -}}
{{- else if eq $search.type "algolia" -}}
{{- $source := $cdn.algoliasearchJS | default "lib/algoliasearch/algoliasearch-lite.umd.min.js" -}}
{{- $source := $cdn.algoliasearchJS | default "lib/algoliasearch/lite/browser.umd.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "type" "algolia" "algoliaIndex" $search.algolia.index "algoliaAppID" $search.algolia.appID "algoliaSearchKey" $search.algolia.searchKey | dict "search" | merge $config -}}
{{- end -}}
@ -52,6 +52,7 @@
{{- $source := $cdn.lightgalleryZoomJS | default "lib/lightgallery/plugins/zoom/lg-zoom.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- $config = dict "lightgallery" true | merge $config -}}
{{- $_ := (resources.Get "lib/lightgallery/images/loading.gif").RelPermalink -}}
{{- end -}}
{{- $code := $params.code | default dict -}}
@ -152,7 +153,9 @@
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $options := dict "targetPath" "lib/aplayer/dark.min.css" "enableSourceMap" true -}}
{{- dict "Source" "lib/aplayer/dark.scss" "ToCSS" $options "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/style.html" -}}
{{- $source := $cdn.aplayerJS | default "lib/aplayer/APlayer.min.js" -}}
{{- /* To fix https://github.com/dillonzq/LoveIt/issues/869 */ -}}
{{- /* Local file from https://github.com/DIYgod/APlayer/pull/777, no CDN */ -}}
{{- $source := "lib/aplayer/APlayer.min.js" -}}
{{- dict "Source" $source "Fingerprint" $fingerprint | dict "Scratch" .Scratch "Data" | partial "scratch/script.html" -}}
{{- /* MetingJS */ -}}

View file

@ -32,7 +32,7 @@
{{- /* Author */ -}}
{{- if ne .Site.Params.footer.author false -}}
<span class="author" itemprop="copyrightHolder">&nbsp;<a href="{{ $.Site.Author.link | default .Site.Home.RelPermalink }}" target="_blank">{{ .Site.Author.name }}</a></span>
<span class="author" itemprop="copyrightHolder">&nbsp;<a href="{{ $.Site.Params.Author.link | default .Site.Home.RelPermalink }}" target="_blank">{{ .Site.Params.Author.name }}</a></span>
{{- end -}}
{{- /* License */ -}}

View file

@ -0,0 +1,18 @@
{{- /* To Bool */ -}}
{{- $bool := . -}}
{{- if eq . true -}}
{{- $bool = true -}}
{{- else if eq . false -}}
{{- $bool = false -}}
{{- else if eq . "true" -}}
{{- $bool = true -}}
{{- else if eq . "false" -}}
{{- $bool = false -}}
{{- else if eq . "1" -}}
{{- $bool = true -}}
{{- else if eq . "0" -}}
{{- $bool = false -}}
{{- end -}}
{{- return $bool -}}

View file

@ -0,0 +1,14 @@
{{- /* To Dict */ -}}
{{- /* "a=1, b=2" -> dict "a" "1" "b" "2" */ -}}
{{- $dict := dict -}}
{{- if reflect.IsMap . -}}
{{- $dict = . -}}
{{- else -}}
{{- range split . "," -}}
{{- $parts := split (trim . " ") "=" -}}
{{- $dict = dict (index $parts 0) (delimit (after 1 $parts) "") | merge $dict -}}
{{- end -}}}
{{- end -}}
{{- return $dict -}}

View file

@ -26,7 +26,7 @@
{{- with .Site.LanguageCode -}}
"inLanguage": "{{ . }}",
{{- end -}}
{{- with .Site.Author.name -}}
{{- with .Site.Params.Author.name -}}
"author": {
"@type": "Person",
"name": {{ . | safeHTML }}
@ -122,7 +122,7 @@
{{- with .Site.Copyright -}}
"license": {{ . | safeHTML }},
{{- end -}}
{{- $publisher := .Params.author | default .Site.Author.name | default (T "author") | dict "name" -}}
{{- $publisher := .Params.author | default .Site.Params.Author.name | default (T "author") | dict "name" -}}
{{- $publisher = $params.seo.publisher | default dict | merge $publisher -}}
"publisher": {
"@type": "Organization",
@ -141,7 +141,7 @@
{{- end -}}
{{- end -}}
},
{{- with .Params.author | default .Site.Author.name | default (T "author") -}}
{{- with .Params.author | default .Site.Params.Author.name | default (T "author") -}}
"author": {
"@type": "Person",
"name": {{ . | safeHTML }}
@ -150,4 +150,4 @@
"description": {{ .Description | safeHTML }}
}
</script>
{{- end -}}
{{- end -}}

View file

@ -57,9 +57,9 @@
<a href="javascript:void(0);" class="menu-item theme-switch" title="{{ T "switchTheme" }}">
<i class="fas fa-adjust fa-fw" aria-hidden="true"></i>
</a>
{{- if .Site.IsMultiLingual -}}
{{- if hugo.IsMultilingual -}}
<a href="javascript:void(0);" class="menu-item language" title="{{ T "selectLanguage" }}">
<i class="fa fa-globe" aria-hidden="true"></i>
<i class="fa fa-globe fa-fw" aria-hidden="true"></i>
<select class="language-select" id="language-select-desktop" onchange="location = this.value;">
{{- if eq .Kind "404" -}}
{{- /* https://github.com/dillonzq/LoveIt/issues/378 */ -}}
@ -149,7 +149,7 @@
<a href="javascript:void(0);" class="menu-item theme-switch" title="{{ T "switchTheme" }}">
<i class="fas fa-adjust fa-fw" aria-hidden="true"></i>
</a>
{{- if .Site.IsMultiLingual -}}
{{- if hugo.IsMultilingual -}}
<a href="javascript:void(0);" class="menu-item" title="{{ T "selectLanguage" }}">
<i class="fa fa-globe fa-fw" aria-hidden="true"></i>

View file

@ -1,4 +1,4 @@
{{- .Scratch.Set "version" "0.2.11" -}}
{{- .Scratch.Set "version" "0.3.0" -}}
{{- $params := .Params | merge .Site.Params.page -}}
@ -21,8 +21,9 @@
{{- else if eq .Params.comment false -}}
{{- .Scratch.Set "comment" dict -}}
{{- end -}}
{{- else if eq .Site .Sites.First -}}
{{- warnf "\n\nCurrent environment is \"development\". The \"comment system\", \"CDN\" and \"fingerprint\" will be disabled.\n当前运行环境是 \"development\". \"评论系统\", \"CDN\" 和 \"fingerprint\" 不会启用.\n" -}}
{{- else if eq .Site .Sites.Default -}}
{{- warnf "Current environment is \"development\". The \"comment system\", \"CDN\" and \"fingerprint\" will be disabled.\n" -}}
{{- warnf "当前运行环境是 \"development\". \"评论系统\", \"CDN\" 和 \"fingerprint\" 不会启用.\n" -}}
{{- end -}}
{{- .Scratch.Set "params" $params -}}

View file

@ -0,0 +1,17 @@
{{- $content := .Content -}}
{{- $lang := .Lang -}}
{{- $options := dict "lineNoStart" 1 "lineNos" true -}}
{{- $options = .Options | partial "function/dict.html" | merge $options -}}
{{- $lineNoStart := $options.lineNoStart | int -}}
{{- $lineNos := $options.lineNos | partial "function/bool.html" -}}
{{- $options = dict "noClasses" false "lineNos" false | merge $options -}}
{{- $result := transform.Highlight $content $lang $options -}}
<div class="code-block{{ if $lineNos }} code-line-numbers{{ end }} open" style="counter-reset: code-block {{ sub $lineNoStart 1 }}">
<div class="code-header language-bash">
<span class="code-title"><i class="arrow fas fa-chevron-right fa-fw" aria-hidden="true"></i></span>
<span class="ellipses"><i class="fas fa-ellipsis-h fa-fw" aria-hidden="true"></i></span>
<span class="copy" title="{{ T "copyToClipboard" }}"><i class="far fa-copy fa-fw" aria-hidden="true"></i></span>
</div>
{{- $result -}}
</div>

View file

@ -1,4 +1,4 @@
{{- $params := .Page.Params | merge .Site.Params.Page | merge (dict "author" .Site.Author.name) -}}
{{- $params := .Page.Params | merge .Site.Params.Page | merge (dict "author" .Site.Params.Author.name) -}}
<item>
<title>
{{- .Page.Title -}}

View file

@ -15,12 +15,12 @@
{{- . -}}
</language>
{{- end -}}
{{- with .Site.Author.email -}}
{{- with .Site.Params.Author.email -}}
<managingEditor>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.Author.name }} ({{ . }}){{ end -}}
</managingEditor>
<webMaster>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.Author.name }} ({{ . }}){{ end -}}
</webMaster>
{{- end -}}
{{- with .Site.Copyright -}}

View file

@ -30,8 +30,8 @@
{{- /* Meta */ -}}
<div class="post-meta">
<div class="post-meta-line">
{{- $author := $params.author | default .Site.Author.name | default (T "author") -}}
{{- $authorLink := $params.authorlink | default .Site.Author.link | default .Site.Home.RelPermalink -}}
{{- $author := $params.author | default .Site.Params.Author.name | default (T "author") -}}
{{- $authorLink := $params.authorlink | default .Site.Params.Author.link | default .Site.Home.RelPermalink -}}
<span class="post-author">
{{- $options := dict "Class" "author" "Destination" $authorLink "Title" "Author" "Rel" "author" "Icon" (dict "Class" "fas fa-user-circle fa-fw") "Content" $author -}}
{{- partial "plugin/a.html" $options -}}

View file

@ -0,0 +1,7 @@
{{- $content := trim .InnerDeindent "\n\r" -}}
{{- $lang := .Get 0 -}}
{{- $options := "" -}}
{{- if len .Params | eq 2 -}}
{{- $options = .Get 1 -}}
{{- end -}}
{{- dict "Content" $content "Lang" $lang "Options" $options | partial "plugin/code-block.html" -}}

View file

@ -3,7 +3,7 @@
{{- $type := .Get 1 | default "new" | lower -}}
{{- $label := T $type -}}
{{- $color := cond (eq $type "changed") "ff9101" "00b1ff" | cond (eq $type "deleted") "ff5252" -}}
{{- $pathTemplate := cond .Site.IsMultiLingual (printf "svg/version/%%v-%%v.%v.svg" .Page.Language.Lang) "svg/version/%v-%v.svg" -}}
{{- $pathTemplate := cond hugo.IsMultilingual (printf "svg/version/%%v-%%v.%v.svg" .Page.Language.Lang) "svg/version/%v-%v.svg" -}}
{{- $path := printf $pathTemplate $version $type -}}
{{- $resource := resources.Get "svg/version.template.svg" -}}
{{- $resource = $resource | resources.ExecuteAsTemplate $path (dict "version" $version "label" $label "color" $color) | minify -}}

View file

@ -15,12 +15,12 @@
{{- . -}}
</language>
{{- end -}}
{{- with .Site.Author.email -}}
{{- with .Site.Params.Author.email -}}
<managingEditor>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.Author.name }} ({{ . }}){{ end -}}
</managingEditor>
<webMaster>
{{- . }}{{ with $.Site.Author.name }} ({{ . }}){{ end -}}
{{- . }}{{ with $.Site.Params.Author.name }} ({{ . }}){{ end -}}
</webMaster>
{{- end -}}
{{- with .Site.Copyright -}}

View file

@ -0,0 +1,18 @@
[build]
publish = "exampleSite/public"
[build.environment]
HUGO_VERSION = "0.144.2"
HUGO_ENABLEGITINFO = "true"
[context.production]
command = "hugo --source exampleSite --theme repo --themesDir ../.. --baseURL ${URL} --gc --minify"
[context.production.environment]
HUGO_ENV = "production"
[context.deploy-preview]
command = "hugo --source exampleSite --theme repo --themesDir ../.. --baseURL ${DEPLOY_PRIME_URL} --gc --minify --buildDrafts"
[context.branch-deploy]
command = "hugo --source exampleSite --theme repo --themesDir ../.. --baseURL ${DEPLOY_PRIME_URL} --gc --minify"

File diff suppressed because it is too large Load diff

View file

@ -1,6 +1,6 @@
{
"name": "loveit-src",
"version": "0.2.0",
"version": "0.3.0",
"description": "LoveIt theme source file",
"private": true,
"devDependencies": {
@ -16,14 +16,15 @@
},
"scripts": {
"preinstall": "npx npm-force-resolutions",
"babel": "npx babel src/js --out-file assets/js/theme.js",
"build": "npm run babel && hugo -v --source=exampleSite --themesDir ../.. --gc",
"build-lunr-segmentit": "browserify src/lib/lunr/lunr.segmentit.js -o assets/lib/lunr/lunr.segmentit.js -t babelify --presets @babel/preset-env",
"start": "npm run babel && hugo server --source=exampleSite --themesDir ../.. -D --disableFastRender",
"start-production": "npm run babel && hugo server --source=exampleSite --themesDir ../.. -D --disableFastRender -e production",
"check": "htmlproofer exampleSite/public --check-html --allow-hash-href --empty-alt-ignore --disable-external",
"copy": "rm -rf resources && cp -rf exampleSite/resources resources",
"prepare": "husky install"
"prepare": "husky install",
"compile": "npx babel src/js --out-file assets/js/theme.js",
"compile-lunr-segmentit": "browserify src/lib/lunr/lunr.segmentit.js -o assets/lib/lunr/lunr.segmentit.js -t babelify --presets @babel/preset-env",
"hugo": "hugo --source exampleSite --buildDrafts --gc",
"hugo-production": "hugo --source exampleSite --gc --minify --environment production",
"hugo-server": "hugo server --source exampleSite --buildDrafts --disableFastRender",
"hugo-server-production": "hugo server --source exampleSite --minify --disableFastRender --environment production",
"htmlproofer": "htmlproofer exampleSite/public --disable-external true --ignore-missing-alt true",
"copy-resources": "cp -rf exampleSite/resources ."
},
"repository": {
"type": "git",

View file

@ -1,22 +1,22 @@
class Util {
forEach(elements, handler) {
static forEach(elements, handler) {
elements = elements || [];
for (let i = 0; i < elements.length; i++) handler(elements[i]);
}
getScrollTop() {
static getScrollTop() {
return (document.documentElement && document.documentElement.scrollTop) || document.body.scrollTop;
}
isMobile() {
static isMobile() {
return window.matchMedia('only screen and (max-width: 680px)').matches;
}
isTocStatic() {
static isTocStatic() {
return window.matchMedia('only screen and (max-width: 960px)').matches;
}
animateCSS(element, animation, reserved, callback) {
static animateCSS(element, animation, reserved, callback) {
if (!Array.isArray(animation)) animation = [animation];
element.classList.add('animate__animated', ...animation);
const handler = () => {
@ -33,8 +33,7 @@ class Theme {
this.config = window.config;
this.data = this.config.data;
this.isDark = document.body.getAttribute('theme') === 'dark';
this.util = new Util();
this.newScrollTop = this.util.getScrollTop();
this.newScrollTop = Util.getScrollTop();
this.oldScrollTop = this.newScrollTop;
this.scrollEventSet = new Set();
this.resizeEventSet = new Set();
@ -44,13 +43,13 @@ class Theme {
}
initRaw() {
this.util.forEach(document.querySelectorAll('[data-raw]'), $raw => {
Util.forEach(document.querySelectorAll('[data-raw]'), $raw => {
$raw.innerHTML = this.data[$raw.id];
});
}
initSVGIcon() {
this.util.forEach(document.querySelectorAll('[data-svg-src]'), $icon => {
Util.forEach(document.querySelectorAll('[data-svg-src]'), $icon => {
fetch($icon.getAttribute('data-svg-src'))
.then(response => response.text())
.then(svg => {
@ -87,7 +86,7 @@ class Theme {
}
initSwitchTheme() {
this.util.forEach(document.getElementsByClassName('theme-switch'), $themeSwitch => {
Util.forEach(document.getElementsByClassName('theme-switch'), $themeSwitch => {
$themeSwitch.addEventListener('click', () => {
if (document.body.getAttribute('theme') === 'dark') document.body.setAttribute('theme', 'light');
else document.body.setAttribute('theme', 'dark');
@ -100,7 +99,7 @@ class Theme {
initSearch() {
const searchConfig = this.config.search;
const isMobile = this.util.isMobile();
const isMobile = Util.isMobile();
if (!searchConfig || isMobile && this._searchMobileOnce || !isMobile && this._searchDesktopOnce) return;
const maxResultLength = searchConfig.maxResultLength ? searchConfig.maxResultLength : 10;
@ -198,10 +197,10 @@ class Theme {
});
position -= snippetLength / 5;
if (position > 0) {
position += context.substr(position, 20).lastIndexOf(' ') + 1;
context = '...' + context.substr(position, snippetLength);
position += context.slice(position, position + 20).lastIndexOf(' ') + 1;
context = '...' + context.slice(position, position + snippetLength);
} else {
context = context.substr(0, snippetLength);
context = context.slice(0, snippetLength);
}
Object.keys(metadata).forEach(key => {
title = title.replace(new RegExp(`(${key})`, 'gi'), `<${highlightTag}>$1</${highlightTag}>`);
@ -242,17 +241,24 @@ class Theme {
});
} else finish(search());
} else if (searchConfig.type === 'algolia') {
this._algoliaIndex = this._algoliaIndex || algoliasearch(searchConfig.algoliaAppID, searchConfig.algoliaSearchKey).initIndex(searchConfig.algoliaIndex);
const { liteClient: algoliasearch } = window['algoliasearch/lite'];
this._algoliaIndex = this._algoliaIndex || algoliasearch(searchConfig.algoliaAppID, searchConfig.algoliaSearchKey);
this._algoliaIndex
.search(query, {
offset: 0,
length: maxResultLength * 8,
attributesToHighlight: ['title'],
attributesToSnippet: [`content:${snippetLength}`],
highlightPreTag: `<${highlightTag}>`,
highlightPostTag: `</${highlightTag}>`,
.search({
requests: [
{
indexName: searchConfig.algoliaIndex,
query: query,
offset: 0,
length: maxResultLength * 8,
attributesToHighlight: ['title'],
attributesToSnippet: [`content:${snippetLength}`],
highlightPreTag: `<${highlightTag}>`,
highlightPostTag: `</${highlightTag}>`,
}
]
})
.then(({ hits }) => {
.then(({ results: [{ hits }] }) => {
const results = {};
hits.forEach(({ uri, date, _highlightResult: { title }, _snippetResult: { content } }) => {
if (results[uri] && results[uri].context.length > content.value) return;
@ -301,7 +307,7 @@ class Theme {
script.async = true;
if (script.readyState) {
script.onreadystatechange = () => {
if (script.readyState == 'loaded' || script.readyState == 'complete'){
if (script.readyState === 'loaded' || script.readyState === 'complete'){
script.onreadystatechange = null;
initAutosearch();
}
@ -316,7 +322,7 @@ class Theme {
}
initDetails() {
this.util.forEach(document.getElementsByClassName('details'), $details => {
Util.forEach(document.getElementsByClassName('details'), $details => {
const $summary = $details.getElementsByClassName('details-summary')[0];
$summary.addEventListener('click', () => {
$details.classList.toggle('open');
@ -341,71 +347,37 @@ class Theme {
}
initHighlight() {
this.util.forEach(document.querySelectorAll('.highlight > pre.chroma'), $preChroma => {
const $chroma = document.createElement('div');
$chroma.className = $preChroma.className;
const $table = document.createElement('table');
$chroma.appendChild($table);
const $tbody = document.createElement('tbody');
$table.appendChild($tbody);
const $tr = document.createElement('tr');
$tbody.appendChild($tr);
const $td = document.createElement('td');
$tr.appendChild($td);
$preChroma.parentElement.replaceChild($chroma, $preChroma);
$td.appendChild($preChroma);
});
this.util.forEach(document.querySelectorAll('.highlight > .chroma'), $chroma => {
const $codeElements = $chroma.querySelectorAll('pre.chroma > code');
if ($codeElements.length) {
const $code = $codeElements[$codeElements.length - 1];
const $header = document.createElement('div');
$header.className = 'code-header ' + $code.className.toLowerCase();
const $title = document.createElement('span');
$title.classList.add('code-title');
$title.insertAdjacentHTML('afterbegin', '<i class="arrow fas fa-chevron-right fa-fw" aria-hidden="true"></i>');
$title.addEventListener('click', () => {
$chroma.classList.toggle('open');
Util.forEach(document.querySelectorAll('.code-block'), $codeBlock => {
const $codeTitle = $codeBlock.querySelector('.code-header > .code-title');
if ($codeTitle) {
$codeTitle.addEventListener('click', () => {
$codeBlock.classList.toggle('open');
}, false);
$header.appendChild($title);
const $ellipses = document.createElement('span');
$ellipses.insertAdjacentHTML('afterbegin', '<i class="fas fa-ellipsis-h fa-fw" aria-hidden="true"></i>');
$ellipses.classList.add('ellipses');
$ellipses.addEventListener('click', () => {
$chroma.classList.add('open');
}, false);
$header.appendChild($ellipses);
const $copy = document.createElement('span');
$copy.insertAdjacentHTML('afterbegin', '<i class="far fa-copy fa-fw" aria-hidden="true"></i>');
$copy.classList.add('copy');
const code = $code.innerText;
if (this.config.code.maxShownLines < 0 || code.split('\n').length < this.config.code.maxShownLines + 2) $chroma.classList.add('open');
if (this.config.code.copyTitle) {
$copy.setAttribute('data-clipboard-text', code);
$copy.title = this.config.code.copyTitle;
const clipboard = new ClipboardJS($copy);
clipboard.on('success', _e => {
this.util.animateCSS($code, 'animate__flash');
});
$header.appendChild($copy);
}
$chroma.insertBefore($header, $chroma.firstChild);
}
});
}
initTable() {
this.util.forEach(document.querySelectorAll('.content table'), $table => {
const $wrapper = document.createElement('div');
$wrapper.className = 'table-wrapper';
$table.parentElement.replaceChild($wrapper, $table);
$wrapper.appendChild($table);
const $ellipses = $codeBlock.querySelector('.code-header .ellipses');
if ($ellipses) {
$ellipses.addEventListener('click', () => {
$codeBlock.classList.toggle('open');
}, false);
}
const $copy = $codeBlock.querySelector('.code-header .copy');
if ($copy) {
const $code = $codeBlock.querySelector('code');
$copy.setAttribute('data-clipboard-text', $code.innerText);
const clipboard = new ClipboardJS($copy);
const $codeLines = $code.querySelectorAll('span.cl');
clipboard.on('success', _e => {
if ($codeLines) {
Util.forEach($codeLines, $codeLine => Util.animateCSS($codeLine, 'animate__flash'))
}
});
}
});
}
initHeaderLink() {
for (let num = 1; num <= 6; num++) {
this.util.forEach(document.querySelectorAll('.single .content > h' + num), $header => {
Util.forEach(document.querySelectorAll('.single .content > h' + num), $header => {
$header.classList.add('headerLink');
$header.insertAdjacentHTML('afterbegin', `<a href="#${$header.id}" class="header-mark"></a>`);
});
@ -415,7 +387,7 @@ class Theme {
initToc() {
const $tocCore = document.getElementById('TableOfContents');
if ($tocCore === null) return;
if (document.getElementById('toc-static').getAttribute('data-kept') || this.util.isTocStatic()) {
if (document.getElementById('toc-static').getAttribute('data-kept') || Util.isTocStatic()) {
const $tocContentStatic = document.getElementById('toc-content-static');
if ($tocCore.parentElement !== $tocContentStatic) {
$tocCore.parentElement.removeChild($tocCore);
@ -457,14 +429,14 @@ class Theme {
$toc.style.top = `${TOP_SPACING}px`;
}
this.util.forEach($tocLinkElements, $tocLink => { $tocLink.classList.remove('active'); });
this.util.forEach($tocLiElements, $tocLi => { $tocLi.classList.remove('has-active'); });
Util.forEach($tocLinkElements, $tocLink => { $tocLink.classList.remove('active'); });
Util.forEach($tocLiElements, $tocLi => { $tocLi.classList.remove('has-active'); });
const INDEX_SPACING = 20 + (headerIsFixed ? headerHeight : 0);
let activeTocIndex = $headerLinkElements.length - 1;
for (let i = 0; i < $headerLinkElements.length - 1; i++) {
const thisTop = $headerLinkElements[i].getBoundingClientRect().top;
const nextTop = $headerLinkElements[i + 1].getBoundingClientRect().top;
if ((i == 0 && thisTop > INDEX_SPACING)
if ((i === 0 && thisTop > INDEX_SPACING)
|| (thisTop <= INDEX_SPACING && nextTop > INDEX_SPACING)) {
activeTocIndex = i;
break;
@ -493,7 +465,7 @@ class Theme {
const $mermaidElements = document.getElementsByClassName('mermaid');
if ($mermaidElements.length) {
mermaid.initialize({startOnLoad: false, theme: this.isDark ? 'dark' : 'neutral', securityLevel: 'loose'});
this.util.forEach($mermaidElements, $mermaid => {
Util.forEach($mermaidElements, $mermaid => {
mermaid.render('svg-' + $mermaid.id, this.data[$mermaid.id], svgCode => {
$mermaid.innerHTML = svgCode;
}, $mermaid);
@ -514,7 +486,7 @@ class Theme {
this._echartsArr[i].dispose();
}
this._echartsArr = [];
this.util.forEach(document.getElementsByClassName('echarts'), $echarts => {
Util.forEach(document.getElementsByClassName('echarts'), $echarts => {
const chart = echarts.init($echarts, this.isDark ? 'dark' : 'light', {renderer: 'svg'});
chart.setOption(JSON.parse(this.data[$echarts.id]));
this._echartsArr.push(chart);
@ -536,7 +508,7 @@ class Theme {
mapboxgl.accessToken = this.config.mapbox.accessToken;
mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin);
this._mapboxArr = this._mapboxArr || [];
this.util.forEach(document.getElementsByClassName('mapbox'), $mapbox => {
Util.forEach(document.getElementsByClassName('mapbox'), $mapbox => {
const { lng, lat, zoom, lightStyle, darkStyle, marked, navigation, geolocate, scale, fullscreen } = this.data[$mapbox.id];
const mapbox = new mapboxgl.Map({
container: $mapbox,
@ -571,7 +543,7 @@ class Theme {
this._mapboxArr.push(mapbox);
});
this._mapboxOnSwitchTheme = this._mapboxOnSwitchTheme || (() => {
this.util.forEach(this._mapboxArr, mapbox => {
Util.forEach(this._mapboxArr, mapbox => {
const $mapbox = mapbox.getContainer();
const { lightStyle, darkStyle } = this.data[$mapbox.id];
mapbox.setStyle(this.isDark ? darkStyle : lightStyle);
@ -591,7 +563,7 @@ class Theme {
Object.values(typeitConfig.data).forEach(group => {
const typeone = (i) => {
const id = group[i];
const instance = new TypeIt(`#${id}`, {
new TypeIt(`#${id}`, {
strings: this.data[id],
speed: speed,
lifeLike: true,
@ -692,36 +664,37 @@ class Theme {
if (document.getElementById('comments')) {
const $viewComments = document.getElementById('view-comments');
$viewComments.href = `#comments`;
$viewComments.style.display = 'block';
$viewComments.parentElement.removeChild($viewComments);
document.getElementById('fixed-buttons').appendChild($viewComments);
}
const $fixedButtons = document.getElementById('fixed-buttons');
const ACCURACY = 20, MINIMUM = 100;
window.addEventListener('scroll', () => {
this.newScrollTop = this.util.getScrollTop();
this.newScrollTop = Util.getScrollTop();
const scroll = this.newScrollTop - this.oldScrollTop;
const isMobile = this.util.isMobile();
this.util.forEach($headers, $header => {
const isMobile = Util.isMobile();
Util.forEach($headers, $header => {
if (scroll > ACCURACY) {
$header.classList.remove('animate__fadeInDown');
this.util.animateCSS($header, ['animate__fadeOutUp', 'animate__faster'], true);
Util.animateCSS($header, ['animate__fadeOutUp', 'animate__faster'], true);
} else if (scroll < - ACCURACY) {
$header.classList.remove('animate__fadeOutUp');
this.util.animateCSS($header, ['animate__fadeInDown', 'animate__faster'], true);
Util.animateCSS($header, ['animate__fadeInDown', 'animate__faster'], true);
}
});
if (this.newScrollTop > MINIMUM) {
if (isMobile && scroll > ACCURACY) {
$fixedButtons.classList.remove('animate__fadeIn');
this.util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true);
Util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true);
} else if (!isMobile || scroll < - ACCURACY) {
$fixedButtons.style.display = 'block';
$fixedButtons.classList.remove('animate__fadeOut');
this.util.animateCSS($fixedButtons, ['animate__fadeIn', 'animate__faster'], true);
Util.animateCSS($fixedButtons, ['animate__fadeIn', 'animate__faster'], true);
}
} else {
if (!isMobile) {
$fixedButtons.classList.remove('animate__fadeIn');
this.util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true);
Util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true);
}
$fixedButtons.style.display = 'none';
}
@ -762,7 +735,6 @@ class Theme {
this.initDetails();
this.initLightGallery();
this.initHighlight();
this.initTable();
this.initHeaderLink();
this.initMath();
this.initMermaid();

View file

@ -23,7 +23,7 @@ features = [
"SEO Optimized"
]
min_version = "0.62.0"
min_version = "0.128.0"
[author]
name = "Dillon"