未验证 提交 e78ba137 编写于 作者: D Dillon 提交者: GitHub

Merge pull request #133 from dillonzq/develop

Release v0.1.1
...@@ -30,7 +30,7 @@ Compared to the original LeaveIt theme and the KeepIt theme, the LoveIt theme ha ...@@ -30,7 +30,7 @@ Compared to the original LeaveIt theme and the KeepIt theme, the LoveIt theme ha
* Easy-to-use and self-expanding **table of contents** * Easy-to-use and self-expanding **table of contents**
* Extended markdown syntax for **[Font Awesome](https://fontawesome.com/) icons** * Extended markdown syntax for **[Font Awesome](https://fontawesome.com/) icons**
* Extended markdown syntax for **ruby annotation** * Extended markdown syntax for **ruby annotation**
* **Mathematical formula** support by [Katex](https://katex.org/) * **Mathematical formula** support by [KaTeX](https://katex.org/)
* **Diagram syntax** shortcode support by [mermaid](https://github.com/knsv/mermaid) * **Diagram syntax** shortcode support by [mermaid](https://github.com/knsv/mermaid)
* **Interactive data visualization** shortcode supported by [ECharts](https://echarts.apache.org/) * **Interactive data visualization** shortcode supported by [ECharts](https://echarts.apache.org/)
* Embedded **music player** support by [APlayer](https://github.com/MoePlayer/APlayer) and [MetingJS](https://github.com/metowolf/MetingJS) * Embedded **music player** support by [APlayer](https://github.com/MoePlayer/APlayer) and [MetingJS](https://github.com/metowolf/MetingJS)
...@@ -86,7 +86,7 @@ I hope you will LoveIt ❤️! ...@@ -86,7 +86,7 @@ I hope you will LoveIt ❤️!
* **Images gallery** supported by [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js) * **Images gallery** supported by [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)
* Extended markdown syntax for **[Font Awesome](https://fontawesome.com/) icons** * Extended markdown syntax for **[Font Awesome](https://fontawesome.com/) icons**
* Extended markdown syntax for **ruby annotation** * Extended markdown syntax for **ruby annotation**
* **Mathematical formula** supported by [Katex](https://katex.org/) * **Mathematical formula** supported by [KaTeX](https://katex.org/)
* **Diagrams** shortcode supported by [mermaid](https://github.com/knsv/mermaid) * **Diagrams** shortcode supported by [mermaid](https://github.com/knsv/mermaid)
* **Interactive data visualization** shortcode supported by [ECharts](https://echarts.apache.org/) * **Interactive data visualization** shortcode supported by [ECharts](https://echarts.apache.org/)
* **Music player** shortcode supported by [APlayer](https://github.com/MoePlayer/APlayer) and [MetingJS](https://github.com/metowolf/MetingJS) * **Music player** shortcode supported by [APlayer](https://github.com/MoePlayer/APlayer) and [MetingJS](https://github.com/metowolf/MetingJS)
...@@ -123,7 +123,7 @@ Thanks to the authors of following resources included in the theme: ...@@ -123,7 +123,7 @@ Thanks to the authors of following resources included in the theme:
* [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js) * [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)
* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll) * [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
* [TypeIt](https://typeitjs.com/) * [TypeIt](https://typeitjs.com/)
* [Katex](https://katex.org/) * [KaTeX](https://katex.org/)
* [mermaid](https://github.com/knsv/mermaid) * [mermaid](https://github.com/knsv/mermaid)
* [ECharts](https://echarts.apache.org/) * [ECharts](https://echarts.apache.org/)
* [APlayer](https://github.com/MoePlayer/APlayer) * [APlayer](https://github.com/MoePlayer/APlayer)
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
* 易用和自动展开的**文章目录** * 易用和自动展开的**文章目录**
* 支持基于 **[Font Awesome](https://fontawesome.com/) 图标**的扩展 Markdown 语法 * 支持基于 **[Font Awesome](https://fontawesome.com/) 图标**的扩展 Markdown 语法
* 支持**上标注释**的扩展 Markdown 语法 * 支持**上标注释**的扩展 Markdown 语法
* 支持基于 [Katex](https://katex.org/)**数学公式** * 支持基于 [KaTeX](https://katex.org/)**数学公式**
* 支持基于 [mermaid](https://github.com/knsv/mermaid)**图表**生成功能 * 支持基于 [mermaid](https://github.com/knsv/mermaid)**图表**生成功能
* 支持基于 [ECharts](https://echarts.apache.org/)**交互式数据可视化**生成功能 * 支持基于 [ECharts](https://echarts.apache.org/)**交互式数据可视化**生成功能
* 支持基于 [APlayer](https://github.com/MoePlayer/APlayer)[MetingJS](https://github.com/metowolf/MetingJS) 的内嵌**音乐播放器** * 支持基于 [APlayer](https://github.com/MoePlayer/APlayer)[MetingJS](https://github.com/metowolf/MetingJS) 的内嵌**音乐播放器**
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
* 支持基于 [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)**图片画廊** * 支持基于 [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)**图片画廊**
* 支持 **[Font Awesome](https://fontawesome.com/) 图标**的扩展 Markdown 语法 * 支持 **[Font Awesome](https://fontawesome.com/) 图标**的扩展 Markdown 语法
* 支持**上标注释**的扩展 Markdown 语法 * 支持**上标注释**的扩展 Markdown 语法
* 支持基于 [Katex](https://katex.org/)**数学公式** * 支持基于 [KaTeX](https://katex.org/)**数学公式**
* 支持基于 [mermaid](https://github.com/knsv/mermaid)**图表** shortcode * 支持基于 [mermaid](https://github.com/knsv/mermaid)**图表** shortcode
* 支持基于 [ECharts](https://echarts.apache.org/)**交互式数据可视化** shortcode * 支持基于 [ECharts](https://echarts.apache.org/)**交互式数据可视化** shortcode
* 支持基于 [APlayer](https://github.com/MoePlayer/APlayer)[MetingJS](https://github.com/metowolf/MetingJS)**音乐播放器** shortcode * 支持基于 [APlayer](https://github.com/MoePlayer/APlayer)[MetingJS](https://github.com/metowolf/MetingJS)**音乐播放器** shortcode
...@@ -118,7 +118,7 @@ LoveIt 主题中用到了以下项目,感谢它们的作者: ...@@ -118,7 +118,7 @@ LoveIt 主题中用到了以下项目,感谢它们的作者:
* [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js) * [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)
* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll) * [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
* [TypeIt](https://typeitjs.com/) * [TypeIt](https://typeitjs.com/)
* [Katex](https://katex.org/) * [KaTeX](https://katex.org/)
* [mermaid](https://github.com/knsv/mermaid) * [mermaid](https://github.com/knsv/mermaid)
* [ECharts](https://echarts.apache.org/) * [ECharts](https://echarts.apache.org/)
* [APlayer](https://github.com/MoePlayer/APlayer) * [APlayer](https://github.com/MoePlayer/APlayer)
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
font-weight: bolder; font-weight: bolder;
} }
& > a:first-child::before { & > .header-mark::before {
content: "|"; content: "|";
margin-right: .3125rem; margin-right: .3125rem;
color: $single-link-color; color: $single-link-color;
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
} }
} }
h2 > a:first-child::before { h2 > .header-mark::before {
content: "#"; content: "#";
} }
...@@ -167,6 +167,11 @@ ...@@ -167,6 +167,11 @@
} }
} }
img {
max-width: 100%;
min-height: 1.2rem;
}
figure { figure {
text-align: center; text-align: center;
...@@ -184,15 +189,9 @@ ...@@ -184,15 +189,9 @@
img { img {
display: block; display: block;
max-width: 96%;
height: auto; height: auto;
margin: 0 auto; margin: 0 auto;
overflow: hidden; overflow: hidden;
transition: all 0.2s ease-in-out;
}
a.lightgallery:hover img {
transform: scale(1.02);
} }
} }
......
...@@ -11,7 +11,7 @@ header { ...@@ -11,7 +11,7 @@ header {
font-weight: bold; font-weight: bold;
} }
.select-language { .language-select {
font-weight: $global-font-weight; font-weight: $global-font-weight;
border: none; border: none;
box-shadow: none; box-shadow: none;
...@@ -32,6 +32,10 @@ header { ...@@ -32,6 +32,10 @@ header {
cursor: pointer; cursor: pointer;
} }
} }
.theme-switch i {
transform: rotate(225deg);
}
} }
#header-desktop { #header-desktop {
......
...@@ -83,7 +83,6 @@ ...@@ -83,7 +83,6 @@
display: block; display: block;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
font-size: 1.2em;
font-weight: bold; font-weight: bold;
line-height: 2em; line-height: 2em;
padding: 0 .625rem; padding: 0 .625rem;
...@@ -133,6 +132,14 @@ ...@@ -133,6 +132,14 @@
} }
.toc { .toc {
.toc-title {
font-size: $toc-title-font-size;
}
.toc-content {
font-size: $toc-content-font-size;
}
ruby { ruby {
background: $code-background-color; background: $code-background-color;
......
...@@ -71,6 +71,10 @@ $header-hover-color-dark: #fff !default; ...@@ -71,6 +71,10 @@ $header-hover-color-dark: #fff !default;
// ========== Header ========== // // ========== Header ========== //
// ========== Single Content ========== // // ========== Single Content ========== //
// Font size of the TOC
$toc-title-font-size: 1.2rem !default;
$toc-content-font-size: 0.9rem !default;
// Color of the single link // Color of the single link
$single-link-color: #2d96bd !default; $single-link-color: #2d96bd !default;
$single-link-color-dark: #eee !default; $single-link-color-dark: #eee !default;
......
"use strict";function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),a}(function(){'use strict';var a=/*#__PURE__*/function(){function a(){_classCallCheck(this,a)}return _createClass(a,[{key:"forEach",value:function forEach(a,b){a=a||[];for(var c=0;c<a.length;c++)b(a[c])}},{key:"getScrollTop",value:function getScrollTop(){return document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop}},{key:"isMobile",value:function isMobile(){return window.matchMedia("only screen and (max-width: 560px)").matches}},{key:"isTocStatic",value:function isTocStatic(){return window.matchMedia("only screen and (max-width: 960px)").matches}}]),a}(),b=/*#__PURE__*/function(){function b(){_classCallCheck(this,b),this.util=new a,this.newScrollTop=this.util.getScrollTop(),this.oldScrollTop=this.newScrollTop,this.scrollEventSet=new Set,this.resizeEventSet=new Set}return _createClass(b,[{key:"initMenuMobile",value:function initMenuMobile(){var a=document.getElementById("menu-toggle-mobile"),b=document.getElementById("menu-mobile");this._menuMobileOnScroll=this._menuMobileOnScroll||function(){a.classList.remove("active"),b.classList.remove("active")},this.util.isMobile()?(a.onclick=function(){a.classList.toggle("active"),b.classList.toggle("active")},this.scrollEventSet.add(this._menuMobileOnScroll)):this.scrollEventSet.delete(this._menuMobileOnScroll)}},{key:"initSwitchTheme",value:function initSwitchTheme(){var a=this;this.util.forEach(document.getElementsByClassName("theme-switch"),function(b){b.onclick=function(){document.body.classList.toggle("dark-theme"),window.isDark=!window.isDark,window.localStorage&&window.localStorage.setItem("theme",window.isDark?"dark":"light"),a.initEcharts()}})}},{key:"initHighlight",value:function initHighlight(){this.util.forEach(document.querySelectorAll(".highlight > .chroma"),function(a){var b=a.querySelectorAll("pre.chroma > code"),c=b[b.length-1],d=c?c.className.toLowerCase():"";a.className+=" "+d}),this.util.forEach(document.querySelectorAll(".highlight > pre.chroma"),function(a){var b=document.createElement("div");b.className=a.className;var c=document.createElement("table");b.appendChild(c);var d=document.createElement("tbody");c.appendChild(d);var e=document.createElement("tr");d.appendChild(e);var f=document.createElement("td");e.appendChild(f),a.parentElement.replaceChild(b,a),f.appendChild(a)})}},{key:"initTable",value:function initTable(){this.util.forEach(document.querySelectorAll(".content table"),function(a){var b=document.createElement("div");b.className="table-wrapper",a.parentElement.replaceChild(b,a),b.appendChild(a)})}},{key:"initHeaderLink",value:function initHeaderLink(){for(var a=1;6>=a;a++)this.util.forEach(document.querySelectorAll(".page.single .content > h"+a),function(a){a.classList.add("headerLink"),a.innerHTML="<a href=\"#".concat(a.id,"\"></a>").concat(a.innerHTML)})}},{key:"initToc",value:function initToc(){var a=this,b=document.getElementById("TableOfContents");if(null!==b)if(this.util.isTocStatic()){var k=document.getElementById("toc-content-static");b.parentElement!==k&&(b.parentElement.removeChild(b),k.appendChild(b)),this._tocOnScroll&&this.scrollEventSet.delete(this._tocOnScroll)}else{var l=document.getElementById("toc-content-auto");b.parentElement!==l&&(b.parentElement.removeChild(b),l.appendChild(b));var c=document.getElementById("toc-auto"),d=document.getElementsByClassName("page")[0];c.style.maxWidth="".concat(d.getBoundingClientRect().left-40,"px"),this._tocLinks=this._tocLinks||b.getElementsByTagName("a"),this._tocLis=this._tocLis||b.getElementsByTagName("li"),this._headerLinks=this._headerLinks||document.getElementsByClassName("headerLink")||[];var e="normal"!==window.desktopHeaderMode,f=document.getElementById("header-desktop").offsetHeight,g=20+(e?f:0),h=c.offsetTop,j=h-g+(e?0:f);this._tocOnScroll=this._tocOnScroll||function(){var d=document.getElementById("post-footer").offsetTop,k=d-c.getBoundingClientRect().height,l=k-g+(e?0:f);a.newScrollTop<j?(c.style.position="absolute",c.style.top="".concat(h,"px")):a.newScrollTop>l?(c.style.position="absolute",c.style.top="".concat(k,"px")):(c.style.position="fixed",c.style.top="".concat(g,"px")),a.util.forEach(a._tocLinks,function(a){a.classList.remove("active")}),a.util.forEach(a._tocLis,function(a){a.classList.remove("has-active")});for(var m=20+(e?f:0),n=a._headerLinks.length-1,o=0;o<a._headerLinks.length-1;o++){var p=a._headerLinks[o].getBoundingClientRect().top,q=a._headerLinks[o+1].getBoundingClientRect().top;if(0==o&&p>m||p<=m&&q>m){n=o;break}}if(-1!==n){a._tocLinks[n].classList.add("active");for(var r=a._tocLinks[n].parentElement;r!==b;)r.classList.add("has-active"),r=r.parentElement.parentElement}},this._tocOnScroll(),this.scrollEventSet.add(this._tocOnScroll)}}},{key:"initMermaid",value:function initMermaid(){window.mermaidArr&&(mermaid.initialize({startOnLoad:!1,theme:"null"}),this.util.forEach(window.mermaidArr,function(a){var b=document.getElementById(a);mermaid.mermaidAPI.render("svg-"+a,window.contentMap[a],function(a){b.innerHTML=a},b)}))}},{key:"initEcharts",value:function initEcharts(){var a=this;if(window.echartsArr){this._echartsArr=this._echartsArr||[];for(var b=0;b<this._echartsArr.length;b++)this._echartsArr[b].dispose();this._echartsArr=[],this.util.forEach(window.echartsArr,function(b){var c=echarts.init(document.getElementById(b),window.isDark?"dark":"macarons",{renderer:"svg"});c.setOption(JSON.parse(window.contentMap[b])),a._echartsArr.push(c)}),this._echartsOnResize=this._echartsOnResize||function(){for(var b=0;b<a._echartsArr.length;b++)a._echartsArr[b].resize()},this.resizeEventSet.add(this._echartsOnResize)}}},{key:"initTypeit",value:function initTypeit(){if(window.typeitArr)for(var a=function(a){var b=window.typeitArr[a];(function a(c){var d=b[c];if(c===b.length-1)return void new TypeIt("#".concat(d),{strings:window.contentMap[d]}).go();var e=new TypeIt("#".concat(d),{strings:window.contentMap[d],afterComplete:function afterComplete(){e.destroy(),a(c+1)}}).go()})(0)},b=0;b<window.typeitArr.length;b++)a(b)}},{key:"initSmoothScroll",value:function initSmoothScroll(){!this.util.isMobile()&&"normal"===window.desktopHeaderMode||this.util.isMobile()&&"normal"===window.mobileHeaderMode?new SmoothScroll("[href^=\"#\"]",{speed:300,speedAsDuration:!0}):new SmoothScroll("[href^=\"#\"]",{speed:300,speedAsDuration:!0,header:"#header-desktop"})}},{key:"onScroll",value:function onScroll(){var a=this,b=[];"auto"===window.desktopHeaderMode&&b.push(document.getElementById("header-desktop")),"auto"===window.mobileHeaderMode&&b.push(document.getElementById("header-mobile")),this.util.forEach(b,function(a){a.classList.add("animated"),a.classList.add("faster")});var c=document.getElementById("dynamic-to-top"),d=20;window.addEventListener("scroll",function(){a.newScrollTop=a.util.getScrollTop();var e=a.newScrollTop-a.oldScrollTop;a.util.forEach(b,function(a){e>d?(a.classList.remove("fadeInDown"),a.classList.add("fadeOutUp")):e<-d&&(a.classList.remove("fadeOutUp"),a.classList.add("fadeInDown"))}),400<a.newScrollTop?e>d?(c.classList.remove("fadeIn"),c.classList.add("fadeOut")):e<-d&&(c.style.display="block",c.classList.remove("fadeOut"),c.classList.add("fadeIn")):c.style.display="none",a._scrollTimeout||(a._scrollTimeout=window.setTimeout(function(){a._scrollTimeout=null;var b=!0,c=!1,d=void 0;try{for(var e,f,g=a.scrollEventSet[Symbol.iterator]();!(b=(e=g.next()).done);b=!0)f=e.value,f()}catch(a){c=!0,d=a}finally{try{b||null==g.return||g.return()}finally{if(c)throw d}}},10)),a.oldScrollTop=a.newScrollTop},!1)}},{key:"onResize",value:function onResize(){var a=this;window.addEventListener("resize",function(){a._resizeTimeout||(a._resizeTimeout=window.setTimeout(function(){a._resizeTimeout=null;var b=!0,c=!1,d=void 0;try{for(var e,f,g=a.resizeEventSet[Symbol.iterator]();!(b=(e=g.next()).done);b=!0)f=e.value,f()}catch(a){c=!0,d=a}finally{try{b||null==g.return||g.return()}finally{if(c)throw d}}a.initMenuMobile(),a.initToc(),a.initSmoothScroll(),a.initMermaid()},100))},!1)}},{key:"init",value:function init(){this.initMenuMobile(),this.initSwitchTheme(),this.initHighlight(),this.initTable(),this.initHeaderLink(),this.initMermaid(),this.initEcharts(),this.initTypeit(),this.initToc(),this.initSmoothScroll(),this.onScroll(),this.onResize()}}]),b}(),c=function(){var a=new b;a.init()};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",c,!1):c()})(); "use strict";function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperties(a,b){for(var c,d=0;d<b.length;d++)c=b[d],c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(a,c.key,c)}function _createClass(a,b,c){return b&&_defineProperties(a.prototype,b),c&&_defineProperties(a,c),a}(function(){'use strict';var a=/*#__PURE__*/function(){function a(){_classCallCheck(this,a)}return _createClass(a,[{key:"forEach",value:function forEach(a,b){a=a||[];for(var c=0;c<a.length;c++)b(a[c])}},{key:"getScrollTop",value:function getScrollTop(){return document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop}},{key:"isMobile",value:function isMobile(){return window.matchMedia("only screen and (max-width: 560px)").matches}},{key:"isTocStatic",value:function isTocStatic(){return window.matchMedia("only screen and (max-width: 960px)").matches}}]),a}(),b=/*#__PURE__*/function(){function b(){_classCallCheck(this,b),this.util=new a,this.newScrollTop=this.util.getScrollTop(),this.oldScrollTop=this.newScrollTop,this.scrollEventSet=new Set,this.resizeEventSet=new Set}return _createClass(b,[{key:"initMenuMobile",value:function initMenuMobile(){var a=document.getElementById("menu-toggle-mobile"),b=document.getElementById("menu-mobile");this._menuMobileOnScroll=this._menuMobileOnScroll||function(){a.classList.remove("active"),b.classList.remove("active")},this.util.isMobile()?(a.onclick=function(){a.classList.toggle("active"),b.classList.toggle("active")},this.scrollEventSet.add(this._menuMobileOnScroll)):this.scrollEventSet.delete(this._menuMobileOnScroll)}},{key:"initSwitchTheme",value:function initSwitchTheme(){var a=this;this.util.forEach(document.getElementsByClassName("theme-switch"),function(b){b.onclick=function(){document.body.classList.toggle("dark-theme"),window.isDark=!window.isDark,window.localStorage&&window.localStorage.setItem("theme",window.isDark?"dark":"light"),a.initEcharts()}})}},{key:"initHighlight",value:function initHighlight(){this.util.forEach(document.querySelectorAll(".highlight > .chroma"),function(a){var b=a.querySelectorAll("pre.chroma > code"),c=b[b.length-1],d=c?c.className.toLowerCase():"";a.className+=" "+d}),this.util.forEach(document.querySelectorAll(".highlight > pre.chroma"),function(a){var b=document.createElement("div");b.className=a.className;var c=document.createElement("table");b.appendChild(c);var d=document.createElement("tbody");c.appendChild(d);var e=document.createElement("tr");d.appendChild(e);var f=document.createElement("td");e.appendChild(f),a.parentElement.replaceChild(b,a),f.appendChild(a)})}},{key:"initTable",value:function initTable(){this.util.forEach(document.querySelectorAll(".content table"),function(a){var b=document.createElement("div");b.className="table-wrapper",a.parentElement.replaceChild(b,a),b.appendChild(a)})}},{key:"initHeaderLink",value:function initHeaderLink(){for(var a=1;6>=a;a++)this.util.forEach(document.querySelectorAll(".page.single .content > h"+a),function(a){a.classList.add("headerLink"),a.innerHTML="<a href=\"#".concat(a.id,"\" class=\"header-mark\"></a>").concat(a.innerHTML)})}},{key:"initToc",value:function initToc(){var a=this,b=document.getElementById("TableOfContents");if(null!==b)if(this.util.isTocStatic()){var k=document.getElementById("toc-content-static");b.parentElement!==k&&(b.parentElement.removeChild(b),k.appendChild(b)),this._tocOnScroll&&this.scrollEventSet.delete(this._tocOnScroll)}else{var l=document.getElementById("toc-content-auto");b.parentElement!==l&&(b.parentElement.removeChild(b),l.appendChild(b));var c=document.getElementById("toc-auto"),d=document.getElementsByClassName("page")[0];c.style.maxWidth="".concat(d.getBoundingClientRect().left-20,"px"),this._tocLinks=this._tocLinks||b.getElementsByTagName("a"),this._tocLis=this._tocLis||b.getElementsByTagName("li"),this._headerLinks=this._headerLinks||document.getElementsByClassName("headerLink")||[];var e="normal"!==window.desktopHeaderMode,f=document.getElementById("header-desktop").offsetHeight,g=20+(e?f:0),h=c.offsetTop,j=h-g+(e?0:f);this._tocOnScroll=this._tocOnScroll||function(){var d=document.getElementById("post-footer").offsetTop,k=d-c.getBoundingClientRect().height,l=k-g+(e?0:f);a.newScrollTop<j?(c.style.position="absolute",c.style.top="".concat(h,"px")):a.newScrollTop>l?(c.style.position="absolute",c.style.top="".concat(k,"px")):(c.style.position="fixed",c.style.top="".concat(g,"px")),a.util.forEach(a._tocLinks,function(a){a.classList.remove("active")}),a.util.forEach(a._tocLis,function(a){a.classList.remove("has-active")});for(var m=20+(e?f:0),n=a._headerLinks.length-1,o=0;o<a._headerLinks.length-1;o++){var p=a._headerLinks[o].getBoundingClientRect().top,q=a._headerLinks[o+1].getBoundingClientRect().top;if(0==o&&p>m||p<=m&&q>m){n=o;break}}if(-1!==n){a._tocLinks[n].classList.add("active");for(var r=a._tocLinks[n].parentElement;r!==b;)r.classList.add("has-active"),r=r.parentElement.parentElement}},this._tocOnScroll(),this.scrollEventSet.add(this._tocOnScroll)}}},{key:"initMermaid",value:function initMermaid(){window.mermaidArr&&(mermaid.initialize({startOnLoad:!1,theme:"null"}),this.util.forEach(window.mermaidArr,function(a){var b=document.getElementById(a);mermaid.mermaidAPI.render("svg-"+a,window.contentMap[a],function(a){b.innerHTML=a},b)}))}},{key:"initEcharts",value:function initEcharts(){var a=this;if(window.echartsArr){this._echartsArr=this._echartsArr||[];for(var b=0;b<this._echartsArr.length;b++)this._echartsArr[b].dispose();this._echartsArr=[],this.util.forEach(window.echartsArr,function(b){var c=echarts.init(document.getElementById(b),window.isDark?"dark":"macarons",{renderer:"svg"});c.setOption(JSON.parse(window.contentMap[b])),a._echartsArr.push(c)}),this._echartsOnResize=this._echartsOnResize||function(){for(var b=0;b<a._echartsArr.length;b++)a._echartsArr[b].resize()},this.resizeEventSet.add(this._echartsOnResize)}}},{key:"initTypeit",value:function initTypeit(){if(window.typeitArr)for(var a=function(a){var b=window.typeitArr[a];(function a(c){var d=b[c];if(c===b.length-1)return void new TypeIt("#".concat(d),{strings:window.contentMap[d]}).go();var e=new TypeIt("#".concat(d),{strings:window.contentMap[d],afterComplete:function afterComplete(){e.destroy(),a(c+1)}}).go()})(0)},b=0;b<window.typeitArr.length;b++)a(b)}},{key:"initSmoothScroll",value:function initSmoothScroll(){!this.util.isMobile()&&"normal"===window.desktopHeaderMode||this.util.isMobile()&&"normal"===window.mobileHeaderMode?new SmoothScroll("[href^=\"#\"]",{speed:300,speedAsDuration:!0}):new SmoothScroll("[href^=\"#\"]",{speed:300,speedAsDuration:!0,header:"#header-desktop"})}},{key:"onScroll",value:function onScroll(){var a=this,b=[];"auto"===window.desktopHeaderMode&&b.push(document.getElementById("header-desktop")),"auto"===window.mobileHeaderMode&&b.push(document.getElementById("header-mobile")),this.util.forEach(b,function(a){a.classList.add("animated"),a.classList.add("faster")});var c=document.getElementById("dynamic-to-top"),d=20;window.addEventListener("scroll",function(){a.newScrollTop=a.util.getScrollTop();var e=a.newScrollTop-a.oldScrollTop;a.util.forEach(b,function(a){e>d?(a.classList.remove("fadeInDown"),a.classList.add("fadeOutUp")):e<-d&&(a.classList.remove("fadeOutUp"),a.classList.add("fadeInDown"))}),400<a.newScrollTop?e>d?(c.classList.remove("fadeIn"),c.classList.add("fadeOut")):e<-d&&(c.style.display="block",c.classList.remove("fadeOut"),c.classList.add("fadeIn")):c.style.display="none",a._scrollTimeout||(a._scrollTimeout=window.setTimeout(function(){a._scrollTimeout=null;var b=!0,c=!1,d=void 0;try{for(var e,f,g=a.scrollEventSet[Symbol.iterator]();!(b=(e=g.next()).done);b=!0)f=e.value,f()}catch(a){c=!0,d=a}finally{try{b||null==g.return||g.return()}finally{if(c)throw d}}},10)),a.oldScrollTop=a.newScrollTop},!1)}},{key:"onResize",value:function onResize(){var a=this;window.addEventListener("resize",function(){a._resizeTimeout||(a._resizeTimeout=window.setTimeout(function(){a._resizeTimeout=null;var b=!0,c=!1,d=void 0;try{for(var e,f,g=a.resizeEventSet[Symbol.iterator]();!(b=(e=g.next()).done);b=!0)f=e.value,f()}catch(a){c=!0,d=a}finally{try{b||null==g.return||g.return()}finally{if(c)throw d}}a.initMenuMobile(),a.initToc(),a.initSmoothScroll(),a.initMermaid()},100))},!1)}},{key:"init",value:function init(){this.initMenuMobile(),this.initSwitchTheme(),this.initHighlight(),this.initTable(),this.initHeaderLink(),this.initMermaid(),this.initEcharts(),this.initTypeit(),this.initToc(),this.initSmoothScroll(),this.onScroll(),this.onResize()}}]),b}(),c=function(){var a=new b;a.init()};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",c,!1):c()})();
//# sourceMappingURL=theme.min.js.map //# sourceMappingURL=theme.min.js.map
\ No newline at end of file
此差异已折叠。
...@@ -11,6 +11,6 @@ mermaid@8.4.8 https://github.com/knsv/mermaid ...@@ -11,6 +11,6 @@ mermaid@8.4.8 https://github.com/knsv/mermaid
aplayer@1.10.1 https://github.com/MoePlayer/APlayer aplayer@1.10.1 https://github.com/MoePlayer/APlayer
meting@2.0.1 https://github.com/metowolf/MetingJS meting@2.0.1 https://github.com/metowolf/MetingJS
echarts@4.6.0 https://echarts.apache.org/ echarts@4.6.0 https://echarts.apache.org/
gitalk@1.6.0 https://github.com/gitalk/gitalk gitalk@1.6.2 https://github.com/gitalk/gitalk
valine@1.3.10 https://valine.js.org/ valine@1.3.10 https://valine.js.org/
iconfont https://www.iconfont.cn/ iconfont https://www.iconfont.cn/
...@@ -8,5 +8,4 @@ ...@@ -8,5 +8,4 @@
text-rendering: auto; // optimizelegibility throws things off #1094 text-rendering: auto; // optimizelegibility throws things off #1094
-webkit-font-smoothing: antialiased; -webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale; -moz-osx-font-smoothing: grayscale;
} }
...@@ -12,4 +12,5 @@ ...@@ -12,4 +12,5 @@
// src: url('#{$fa-font-path}/ForkAwesome.otf') format('opentype'); // used when developing fonts // src: url('#{$fa-font-path}/ForkAwesome.otf') format('opentype'); // used when developing fonts
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
font-display: swap;
} }
因为 它太大了无法显示 source diff 。你可以改为 查看blob
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
url('iconfont.woff?t=1581963134625') format('woff'), url('iconfont.woff?t=1581963134625') format('woff'),
url('iconfont.ttf?t=1581963134625') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ url('iconfont.ttf?t=1581963134625') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('iconfont.svg?t=1581963134625#loveit') format('svg'); /* iOS 4.1- */ url('iconfont.svg?t=1581963134625#loveit') format('svg'); /* iOS 4.1- */
font-display: swap;
} }
.loveit { .loveit {
......
此差异已折叠。
baseURL = "/" baseURL = "/"
# [en, zh-CN, fr, ...] determines default content language # [en, zh-cn, fr, ...] determines default content language
# [en, zh-CN, fr, ...] 设置默认的语言 # [en, zh-cn, fr, ...] 设置默认的语言
defaultContentLanguage = "en" defaultContentLanguage = "en"
# theme # theme
# 主题 # 主题
...@@ -208,8 +208,8 @@ enableEmoji = true ...@@ -208,8 +208,8 @@ enableEmoji = true
# Disqus Comment Config (https://disqus.com/) # Disqus Comment Config (https://disqus.com/)
[languages.en.params.comment.disqus] [languages.en.params.comment.disqus]
# Disqus shortname to use Disqus in posts # Disqus shortname to use Disqus in posts
shortname = "dillonzq" shortname = ""
# Gittalk Comment Config (https://github.com/gitalk/gitalk) # Gitalk Comment Config (https://github.com/gitalk/gitalk)
[languages.en.params.comment.gitalk] [languages.en.params.comment.gitalk]
owner = "" owner = ""
repo = "" repo = ""
...@@ -217,9 +217,9 @@ enableEmoji = true ...@@ -217,9 +217,9 @@ enableEmoji = true
clientSecret = "" clientSecret = ""
# Valine Comment Config (https://github.com/xCss/Valine) # Valine Comment Config (https://github.com/xCss/Valine)
[languages.en.params.comment.valine] [languages.en.params.comment.valine]
enable = false enable = true
appId = "" appId = "QGzwQXOqs5JOhN4RGPOkR2mR-MdYXbMMI"
appKey = "" appKey = "WBmoGyJtbqUswvfLh6L8iEBr"
placeholder = "Your comment ..." placeholder = "Your comment ..."
notify = false notify = false
verify = true verify = true
...@@ -237,9 +237,9 @@ enableEmoji = true ...@@ -237,9 +237,9 @@ enableEmoji = true
appId = "" appId = ""
languageCode = "en_US" languageCode = "en_US"
[languages.zh-CN] [languages.zh-cn]
weight = 2 weight = 2
# 网站语言 # 网站语言, 仅在这里 CN 大写
languageCode = "zh-CN" languageCode = "zh-CN"
# 网站标题 # 网站标题
title = "LoveIt 主题" title = "LoveIt 主题"
...@@ -256,43 +256,43 @@ enableEmoji = true ...@@ -256,43 +256,43 @@ enableEmoji = true
# 日期格式 # 日期格式
dateFormatToUse = "2006-01-02" dateFormatToUse = "2006-01-02"
# 菜单信息 # 菜单信息
[languages.zh-CN.menu] [languages.zh-cn.menu]
[[languages.zh-CN.menu.main]] [[languages.zh-cn.menu.main]]
identifier = "posts" identifier = "posts"
pre = "" pre = ""
name = "文章" name = "文章"
url = "/posts/" url = "/posts/"
title = "" title = ""
weight = 1 weight = 1
[[languages.zh-CN.menu.main]] [[languages.zh-cn.menu.main]]
identifier = "tags" identifier = "tags"
pre = "" pre = ""
name = "标签" name = "标签"
url = "/tags/" url = "/tags/"
title = "" title = ""
weight = 2 weight = 2
[[languages.zh-CN.menu.main]] [[languages.zh-cn.menu.main]]
identifier = "categories" identifier = "categories"
pre = "" pre = ""
name = "分类" name = "分类"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3 weight = 3
[[languages.zh-CN.menu.main]] [[languages.zh-cn.menu.main]]
identifier = "documentation" identifier = "documentation"
pre = "" pre = ""
name = "主题文档" name = "主题文档"
url = "/categories/documentation/" url = "/categories/documentation/"
title = "" title = ""
weight = 4 weight = 4
[[languages.zh-CN.menu.main]] [[languages.zh-cn.menu.main]]
identifier = "about" identifier = "about"
pre = "" pre = ""
name = "关于" name = "关于"
url = "/about/" url = "/about/"
title = "" title = ""
weight = 5 weight = 5
[languages.zh-CN.params] [languages.zh-cn.params]
# 网站描述 # 网站描述
description = "关于 LoveIt 主题" description = "关于 LoveIt 主题"
# 网站关键词 # 网站关键词
...@@ -300,9 +300,9 @@ enableEmoji = true ...@@ -300,9 +300,9 @@ enableEmoji = true
# 网站默认主题 ("light", "dark", "auto") # 网站默认主题 ("light", "dark", "auto")
defaultTheme = "auto" defaultTheme = "auto"
# 主页信息设置 # 主页信息设置
[languages.zh-CN.params.home] [languages.zh-cn.params.home]
# 主页个人信息 # 主页个人信息
[languages.zh-CN.params.home.profile] [languages.zh-cn.params.home.profile]
enable = true enable = true
# Gravatar 邮箱,用于优先在主页显示的头像 # Gravatar 邮箱,用于优先在主页显示的头像
gravatarEmail = "" gravatarEmail = ""
...@@ -315,14 +315,14 @@ enableEmoji = true ...@@ -315,14 +315,14 @@ enableEmoji = true
# 是否显示社交账号 # 是否显示社交账号
social = true social = true
# 主页文章列表 # 主页文章列表
[languages.zh-CN.params.home.posts] [languages.zh-cn.params.home.posts]
enable = true enable = true
# 主页每页显示文章数量 # 主页每页显示文章数量
paginate = 6 paginate = 6
# 当你没有在文章前面设置 "hiddenFromHomePage" 时的默认行为 # 当你没有在文章前面设置 "hiddenFromHomePage" 时的默认行为
defaultHiddenFromHomePage = false defaultHiddenFromHomePage = false
# 主页的社交信息设置 # 主页的社交信息设置
[languages.zh-CN.params.social] [languages.zh-cn.params.social]
GitHub = "xxxx" GitHub = "xxxx"
# Linkedin = "xxxx" # Linkedin = "xxxx"
Twitter = "xxxx" Twitter = "xxxx"
...@@ -388,7 +388,7 @@ enableEmoji = true ...@@ -388,7 +388,7 @@ enableEmoji = true
# Matrix = "xxxx" # Matrix = "xxxx"
Bilibili = "xxxx" Bilibili = "xxxx"
# 文章页面的分享信息设置 # 文章页面的分享信息设置
[languages.zh-CN.params.share] [languages.zh-cn.params.share]
enable = true enable = true
Twitter = true Twitter = true
Facebook = true Facebook = true
...@@ -418,23 +418,23 @@ enableEmoji = true ...@@ -418,23 +418,23 @@ enableEmoji = true
# Trello = true # Trello = true
# Mix = true # Mix = true
# 评论系统设置 # 评论系统设置
[languages.zh-CN.params.comment] [languages.zh-cn.params.comment]
enable = true enable = true
# Disqus 评论系统设置 (https://disqus.com/) # Disqus 评论系统设置 (https://disqus.com/)
[languages.zh-CN.params.comment.disqus] [languages.zh-cn.params.comment.disqus]
# Disqus 的用户名,用来在文章中启用 Disqus 评论系统 # Disqus 的 shortname,用来在文章中启用 Disqus 评论系统
shortname = "dillonzq" shortname = ""
# Gittalk 评论系统设置 (https://github.com/gitalk/gitalk) # Gitalk 评论系统设置 (https://github.com/gitalk/gitalk)
[languages.zh-CN.params.comment.gitalk] [languages.zh-cn.params.comment.gitalk]
owner = "" owner = ""
repo = "" repo = ""
clientId = "" clientId = ""
clientSecret = "" clientSecret = ""
# Valine 评论系统设置 (https://github.com/xCss/Valine) # Valine 评论系统设置 (https://github.com/xCss/Valine)
[languages.zh-CN.params.comment.valine] [languages.zh-cn.params.comment.valine]
enable = false enable = true
appId = "" appId = "QGzwQXOqs5JOhN4RGPOkR2mR-MdYXbMMI"
appKey = "" appKey = "WBmoGyJtbqUswvfLh6L8iEBr"
placeholder = "你的评论 ..." placeholder = "你的评论 ..."
notify = false notify = false
verify = true verify = true
...@@ -445,7 +445,7 @@ enableEmoji = true ...@@ -445,7 +445,7 @@ enableEmoji = true
visitor = true visitor = true
recordIP = true recordIP = true
# Facebook 评论系统设置 (https://developers.facebook.com/docs/plugins/comments) # Facebook 评论系统设置 (https://developers.facebook.com/docs/plugins/comments)
[languages.zh-CN.params.comment.facebook] [languages.zh-cn.params.comment.facebook]
enable = false enable = false
width = "100%" width = "100%"
numPosts = 10 numPosts = 10
...@@ -637,19 +637,21 @@ enableEmoji = true ...@@ -637,19 +637,21 @@ enableEmoji = true
enable = true enable = true
# Disqus Comment Config (https://disqus.com/) # Disqus Comment Config (https://disqus.com/)
[languages.fr.params.comment.disqus] [languages.fr.params.comment.disqus]
enable = false
# Disqus shortname to use Disqus in posts # Disqus shortname to use Disqus in posts
shortname = "dillonzq" shortname = ""
# Gittalk Comment Config (https://github.com/gitalk/gitalk) # Gitalk Comment Config (https://github.com/gitalk/gitalk)
[languages.fr.params.comment.gitalk] [languages.fr.params.comment.gitalk]
enable = false
owner = "" owner = ""
repo = "" repo = ""
clientId = "" clientId = ""
clientSecret = "" clientSecret = ""
# Valine Comment Config (https://github.com/xCss/Valine) # Valine Comment Config (https://github.com/xCss/Valine)
[languages.fr.params.comment.valine] [languages.fr.params.comment.valine]
enable = false enable = true
appId = "" appId = "QGzwQXOqs5JOhN4RGPOkR2mR-MdYXbMMI"
appKey = "" appKey = "WBmoGyJtbqUswvfLh6L8iEBr"
placeholder = "Votre commentaire ..." placeholder = "Votre commentaire ..."
notify = false notify = false
verify = true verify = true
...@@ -674,6 +676,9 @@ enableEmoji = true ...@@ -674,6 +676,9 @@ enableEmoji = true
# public git repo url only then enableGitInfo is true # public git repo url only then enableGitInfo is true
# 公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效 # 公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效
gitRepo = "https://github.com/dillonzq/LoveIt" gitRepo = "https://github.com/dillonzq/LoveIt"
# which hash function used for SRI, when empty, no SRI is used ("sha256", "sha384", "sha512", "md5")
# 哪种哈希函数用来 SRI, 为空时表示不使用 SRI ("sha256", "sha384", "sha512", "md5")
fingerprint = ""
# Header info # Header info
# 页面头部导航栏信息 # 页面头部导航栏信息
[params.header] [params.header]
...@@ -787,7 +792,7 @@ enableEmoji = true ...@@ -787,7 +792,7 @@ enableEmoji = true
# echarts@4.6.0 https://echarts.apache.org/ # echarts@4.6.0 https://echarts.apache.org/
echartsJS = '' echartsJS = ''
echartsMacaronsJS = '' echartsMacaronsJS = ''
# gitalk@1.6.0 https://github.com/gitalk/gitalk # gitalk@1.6.2 https://github.com/gitalk/gitalk
gitalkCSS = '' gitalkCSS = ''
gitalkJS = '' gitalkJS = ''
# valine@1.3.10 https://valine.js.org/ # valine@1.3.10 https://valine.js.org/
......
...@@ -3,19 +3,12 @@ title: "About LoveIt" ...@@ -3,19 +3,12 @@ title: "About LoveIt"
date: 2019-08-02T11:04:49+08:00 date: 2019-08-02T11:04:49+08:00
draft: false draft: false
math: true
lightgallery: true lightgallery: true
--- ---
<div class="badge">
[![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-blue?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 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-blue?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)
</div>
<style>
.badge img { height: 1.2rem; }
</style>
[LoveIt :(far fa-heart):](https://github.com/dillonzq/LoveIt) is a **clean**, **elegant** but **advanced** blog theme for [Hugo](https://gohugo.io/) developed by [Dillon](https://dillonzq.com). [LoveIt :(far fa-heart):](https://github.com/dillonzq/LoveIt) is a **clean**, **elegant** but **advanced** blog theme for [Hugo](https://gohugo.io/) developed by [Dillon](https://dillonzq.com).
It is based on the original [LeaveIt Theme](https://github.com/liuzc/LeaveIt/) and [KeepIt Theme](https://github.com/liuzc/LeaveIt/). It is based on the original [LeaveIt Theme](https://github.com/liuzc/LeaveIt/) and [KeepIt Theme](https://github.com/liuzc/LeaveIt/).
...@@ -60,7 +53,7 @@ It is based on the original [LeaveIt Theme](https://github.com/liuzc/LeaveIt/) a ...@@ -60,7 +53,7 @@ It is based on the original [LeaveIt Theme](https://github.com/liuzc/LeaveIt/) a
* :(far fa-images): **Images gallery** supported by [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js) * :(far fa-images): **Images gallery** supported by [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)
* :(fab fa-font-awesome): Extended markdown syntax for **[Font Awesome](https://fontawesome.com/) icons** * :(fab fa-font-awesome): Extended markdown syntax for **[Font Awesome](https://fontawesome.com/) icons**
* :(far fa-sticky-note): Extended markdown syntax for **ruby annotation** * :(far fa-sticky-note): Extended markdown syntax for **ruby annotation**
* :(fas fa-square-root-alt): **Mathematical formula** supported by [Katex](https://katex.org/) * :(fas fa-square-root-alt): **Mathematical formula** supported by [$ \KaTeX $](https://katex.org/)
* :(fas fa-project-diagram): **Diagrams** shortcode supported by [mermaid](https://github.com/knsv/mermaid) * :(fas fa-project-diagram): **Diagrams** shortcode supported by [mermaid](https://github.com/knsv/mermaid)
* :(fas fa-chart-pie): **Interactive data visualization** shortcode supported by [ECharts](https://echarts.apache.org/) * :(fas fa-chart-pie): **Interactive data visualization** shortcode supported by [ECharts](https://echarts.apache.org/)
* :(fas fa-music): **Music player** shortcode supported by [APlayer](https://github.com/MoePlayer/APlayer) and [MetingJS](https://github.com/metowolf/MetingJS) * :(fas fa-music): **Music player** shortcode supported by [APlayer](https://github.com/MoePlayer/APlayer) and [MetingJS](https://github.com/metowolf/MetingJS)
...@@ -86,7 +79,7 @@ Thanks to the authors of following resources included in the theme: ...@@ -86,7 +79,7 @@ Thanks to the authors of following resources included in the theme:
* [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js) * [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)
* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll) * [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
* [TypeIt](https://typeitjs.com/) * [TypeIt](https://typeitjs.com/)
* [Katex](https://katex.org/) * [$ \KaTeX $](https://katex.org/)
* [mermaid](https://github.com/knsv/mermaid) * [mermaid](https://github.com/knsv/mermaid)
* [ECharts](https://echarts.apache.org/) * [ECharts](https://echarts.apache.org/)
* [APlayer](https://github.com/MoePlayer/APlayer) * [APlayer](https://github.com/MoePlayer/APlayer)
......
...@@ -3,19 +3,12 @@ title: "À propos de LoveIt" ...@@ -3,19 +3,12 @@ title: "À propos de LoveIt"
date: 2019-08-02T11:04:49+08:00 date: 2019-08-02T11:04:49+08:00
draft: false draft: false
math: true
lightgallery: true lightgallery: true
--- ---
<div class="badge">
[![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-blue?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 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-blue?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)
</div>
<style>
.badge img { height: 1.2rem; }
</style>
{{< admonition warning >}} {{< admonition warning >}}
Sorry, this article has not been completely translated into **French**. Sorry, this article has not been completely translated into **French**.
Welcome to take the time to propose a translation by [making a PR](https://github.com/dillonzq/LoveIt/pulls) to the theme! Welcome to take the time to propose a translation by [making a PR](https://github.com/dillonzq/LoveIt/pulls) to the theme!
...@@ -65,7 +58,7 @@ It is based on the original [LeaveIt Theme](https://github.com/liuzc/LeaveIt/) a ...@@ -65,7 +58,7 @@ It is based on the original [LeaveIt Theme](https://github.com/liuzc/LeaveIt/) a
* :(far fa-images): **Images gallery** supported by [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js) * :(far fa-images): **Images gallery** supported by [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)
* :(fab fa-font-awesome): Extended markdown syntax for **[Font Awesome](https://fontawesome.com/) icons** * :(fab fa-font-awesome): Extended markdown syntax for **[Font Awesome](https://fontawesome.com/) icons**
* :(far fa-sticky-note): Extended markdown syntax for **ruby annotation** * :(far fa-sticky-note): Extended markdown syntax for **ruby annotation**
* :(fas fa-square-root-alt): **Mathematical formula** supported by [Katex](https://katex.org/) * :(fas fa-square-root-alt): **Mathematical formula** supported by [$ \KaTeX $](https://katex.org/)
* :(fas fa-project-diagram): **Diagrams** shortcode supported by [mermaid](https://github.com/knsv/mermaid) * :(fas fa-project-diagram): **Diagrams** shortcode supported by [mermaid](https://github.com/knsv/mermaid)
* :(fas fa-chart-pie): **Interactive data visualization** shortcode supported by [ECharts](https://echarts.apache.org/) * :(fas fa-chart-pie): **Interactive data visualization** shortcode supported by [ECharts](https://echarts.apache.org/)
* :(fas fa-music): **Music player** shortcode supported by [APlayer](https://github.com/MoePlayer/APlayer) and [MetingJS](https://github.com/metowolf/MetingJS) * :(fas fa-music): **Music player** shortcode supported by [APlayer](https://github.com/MoePlayer/APlayer) and [MetingJS](https://github.com/metowolf/MetingJS)
...@@ -91,7 +84,7 @@ Thanks to the authors of following resources included in the theme: ...@@ -91,7 +84,7 @@ Thanks to the authors of following resources included in the theme:
* [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js) * [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)
* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll) * [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
* [TypeIt](https://typeitjs.com/) * [TypeIt](https://typeitjs.com/)
* [Katex](https://katex.org/) * [$ \KaTeX $](https://katex.org/)
* [mermaid](https://github.com/knsv/mermaid) * [mermaid](https://github.com/knsv/mermaid)
* [ECharts](https://echarts.apache.org/) * [ECharts](https://echarts.apache.org/)
* [APlayer](https://github.com/MoePlayer/APlayer) * [APlayer](https://github.com/MoePlayer/APlayer)
......
...@@ -3,19 +3,12 @@ title: "关于 LoveIt" ...@@ -3,19 +3,12 @@ title: "关于 LoveIt"
date: 2019-08-02T11:04:49+08:00 date: 2019-08-02T11:04:49+08:00
draft: false draft: false
math: true
lightgallery: true lightgallery: true
--- ---
<div class="badge">
[![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-blue?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 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-blue?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)
</div>
<style>
.badge img { height: 1.2rem; }
</style>
[LoveIt :(far fa-heart):](https://github.com/dillonzq/LoveIt) 是一个由 [Dillon](https://dillonzq.com) 开发的**简洁****优雅****高效**[Hugo](https://gohugo.io/) 博客主题。 [LoveIt :(far fa-heart):](https://github.com/dillonzq/LoveIt) 是一个由 [Dillon](https://dillonzq.com) 开发的**简洁****优雅****高效**[Hugo](https://gohugo.io/) 博客主题。
它的原型基于 [LeaveIt 主题](https://github.com/liuzc/LeaveIt/)[KeepIt 主题](https://github.com/liuzc/LeaveIt/) 它的原型基于 [LeaveIt 主题](https://github.com/liuzc/LeaveIt/)[KeepIt 主题](https://github.com/liuzc/LeaveIt/)
...@@ -60,7 +53,7 @@ lightgallery: true ...@@ -60,7 +53,7 @@ lightgallery: true
* :(far fa-images): 支持基于 [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)**图片画廊** * :(far fa-images): 支持基于 [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)**图片画廊**
* :(fab fa-font-awesome): 支持 **[Font Awesome](https://fontawesome.com/) 图标**的扩展 Markdown 语法 * :(fab fa-font-awesome): 支持 **[Font Awesome](https://fontawesome.com/) 图标**的扩展 Markdown 语法
* :(far fa-sticky-note): 支持**上标注释**的扩展 Markdown 语法 * :(far fa-sticky-note): 支持**上标注释**的扩展 Markdown 语法
* :(fas fa-square-root-alt): 支持基于 [Katex](https://katex.org/)**数学公式** * :(fas fa-square-root-alt): 支持基于 [$ \KaTeX $](https://katex.org/)**数学公式**
* :(fas fa-project-diagram): 支持基于 [mermaid](https://github.com/knsv/mermaid)**图表** shortcode * :(fas fa-project-diagram): 支持基于 [mermaid](https://github.com/knsv/mermaid)**图表** shortcode
* :(fas fa-chart-pie): 支持基于 [ECharts](https://echarts.apache.org/)**交互式数据可视化** shortcode * :(fas fa-chart-pie): 支持基于 [ECharts](https://echarts.apache.org/)**交互式数据可视化** shortcode
* :(fas fa-music): 支持基于 [APlayer](https://github.com/MoePlayer/APlayer)[MetingJS](https://github.com/metowolf/MetingJS)**音乐播放器** shortcode * :(fas fa-music): 支持基于 [APlayer](https://github.com/MoePlayer/APlayer)[MetingJS](https://github.com/metowolf/MetingJS)**音乐播放器** shortcode
...@@ -86,7 +79,7 @@ LoveIt 主题中用到了以下项目,感谢它们的作者: ...@@ -86,7 +79,7 @@ LoveIt 主题中用到了以下项目,感谢它们的作者:
* [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js) * [lightgallery.js](https://github.com/sachinchoolur/lightgallery.js)
* [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll) * [Smooth Scroll](https://github.com/cferdinandi/smooth-scroll)
* [TypeIt](https://typeitjs.com/) * [TypeIt](https://typeitjs.com/)
* [Katex](https://katex.org/) * [$ \KaTeX $](https://katex.org/)
* [mermaid](https://github.com/knsv/mermaid) * [mermaid](https://github.com/knsv/mermaid)
* [ECharts](https://echarts.apache.org/) * [ECharts](https://echarts.apache.org/)
* [APlayer](https://github.com/MoePlayer/APlayer) * [APlayer](https://github.com/MoePlayer/APlayer)
......
...@@ -618,7 +618,7 @@ The HTML looks like this: ...@@ -618,7 +618,7 @@ The HTML looks like this:
</table> </table>
``` ```
{{< admonition "Right or center aligned text" >}} {{< admonition note "Right or center aligned text" >}}
Adding a colon on the right side of the dashes below any heading will right align text for that column. Adding a colon on the right side of the dashes below any heading will right align text for that column.
Adding colons on both sides of the dashes below any heading will center align text for that column. Adding colons on both sides of the dashes below any heading will center align text for that column.
......
...@@ -623,7 +623,7 @@ The HTML looks like this: ...@@ -623,7 +623,7 @@ The HTML looks like this:
</table> </table>
``` ```
{{< admonition "Right or center aligned text" >}} {{< admonition note "Right or center aligned text" >}}
Adding a colon on the right side of the dashes below any heading will right align text for that column. Adding a colon on the right side of the dashes below any heading will right align text for that column.
Adding colons on both sides of the dashes below any heading will center align text for that column. Adding colons on both sides of the dashes below any heading will center align text for that column.
......
...@@ -620,7 +620,7 @@ grunt.initConfig({ ...@@ -620,7 +620,7 @@ grunt.initConfig({
</table> </table>
``` ```
{{< admonition "文本右对齐或居中对齐" >}} {{< admonition note "文本右对齐或居中对齐" >}}
在任何标题下方的破折号右侧添加冒号将使该列的文本右对齐. 在任何标题下方的破折号右侧添加冒号将使该列的文本右对齐.
在任何标题下方的破折号两边添加冒号将使该列的对齐文本居中. 在任何标题下方的破折号两边添加冒号将使该列的对齐文本居中.
......
...@@ -78,6 +78,8 @@ The following is a basic configuration for the LoveIt theme: ...@@ -78,6 +78,8 @@ The following is a basic configuration for the LoveIt theme:
```toml ```toml
baseURL = "http://example.org/" baseURL = "http://example.org/"
# [en, zh-cn, fr, ...] determines default content language
defaultContentLanguage = "en"
# language code # language code
languageCode = "en" languageCode = "en"
title = "My New Hugo Site" title = "My New Hugo Site"
...@@ -113,13 +115,6 @@ theme = "LoveIt" ...@@ -113,13 +115,6 @@ theme = "LoveIt"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3 weight = 3
[[menu.main]]
identifier = "about"
pre = ""
name = "About"
url = "/about/"
title = ""
weight = 4
``` ```
{{< admonition >}} {{< admonition >}}
...@@ -186,13 +181,16 @@ Note that some of these parameters are explained in details in other sections of ...@@ -186,13 +181,16 @@ Note that some of these parameters are explained in details in other sections of
# LoveIt theme version # LoveIt theme version
version = "0.1.X" version = "0.1.X"
# site description # site description
description = "About LoveIt Theme" description = "This is My New Hugo Site"
# site keywords # site keywords
keywords = ["Theme", "Hugo"] keywords = ["Theme", "Hugo"]
# site default theme ("light", "dark", "auto") # site default theme ("light", "dark", "auto")
defaultTheme = "auto" defaultTheme = "auto"
# public git repo url only then enableGitInfo is true # public git repo url only then enableGitInfo is true
gitRepo = "" gitRepo = ""
# LoveIt :(fas fa-greater-than-equal): :(far fa-file-archive): v0.1.1
# which hash function used for SRI, when empty, no SRI is used ("sha256", "sha384", "sha512", "md5")
fingerprint = ""
# Header info # Header info
[params.header] [params.header]
# desktop header mode ("fixed", "normal", "auto") # desktop header mode ("fixed", "normal", "auto")
...@@ -217,7 +215,7 @@ Note that some of these parameters are explained in details in other sections of ...@@ -217,7 +215,7 @@ Note that some of these parameters are explained in details in other sections of
# URL of avatar shown in home page # URL of avatar shown in home page
avatarURL = "/images/avatar.png" avatarURL = "/images/avatar.png"
# subtitle shown in home page # subtitle shown in home page
subtitle = "This is my new hugo site" subtitle = "This is My New Hugo Site"
# whether to use typeit animation for subtitle # whether to use typeit animation for subtitle
typeit = true typeit = true
# whether to show social links # whether to show social links
...@@ -350,10 +348,14 @@ Note that some of these parameters are explained in details in other sections of ...@@ -350,10 +348,14 @@ Note that some of these parameters are explained in details in other sections of
enable = true enable = true
# Disqus Comment Config (https://disqus.com/) # Disqus Comment Config (https://disqus.com/)
[params.comment.disqus] [params.comment.disqus]
# LoveIt :(fas fa-greater-than-equal): :(far fa-file-archive): v0.1.1
enable = false
# Disqus shortname to use Disqus in posts # Disqus shortname to use Disqus in posts
shortname = "dillonzq" shortname = ""
# Gittalk Comment Config (https://github.com/gitalk/gitalk) # Gitalk Comment Config (https://github.com/gitalk/gitalk)
[params.comment.gitalk] [params.comment.gitalk]
# LoveIt :(fas fa-greater-than-equal): :(far fa-file-archive): v0.1.1
enable = false
owner = "" owner = ""
repo = "" repo = ""
clientId = "" clientId = ""
...@@ -440,7 +442,7 @@ Note that some of these parameters are explained in details in other sections of ...@@ -440,7 +442,7 @@ Note that some of these parameters are explained in details in other sections of
# echarts@4.6.0 https://echarts.apache.org/ # echarts@4.6.0 https://echarts.apache.org/
echartsJS = '' echartsJS = ''
echartsMacaronsJS = '' echartsMacaronsJS = ''
# gitalk@1.6.0 https://github.com/gitalk/gitalk # gitalk@1.6.2 https://github.com/gitalk/gitalk
gitalkCSS = '' gitalkCSS = ''
gitalkJS = '' gitalkJS = ''
# valine@1.3.10 https://valine.js.org/ # valine@1.3.10 https://valine.js.org/
...@@ -520,7 +522,7 @@ Note that some of these parameters are explained in details in other sections of ...@@ -520,7 +522,7 @@ Note that some of these parameters are explained in details in other sections of
taxonomyTerm = ["HTML"] taxonomyTerm = ["HTML"]
``` ```
![Complete configuration preview](/images/theme-documentation-basics/complete-configuration-preview.gif "Complete configuration preview") ![Complete configuration preview](/images/theme-documentation-basics/complete-configuration-preview.png "Complete configuration preview")
### 3.2 Favicons, Browserconfig, Manifest ### 3.2 Favicons, Browserconfig, Manifest
...@@ -576,7 +578,7 @@ After learning [how Hugo handle multilingual websites](https://gohugo.io/content ...@@ -576,7 +578,7 @@ After learning [how Hugo handle multilingual websites](https://gohugo.io/content
For example with English, Chinese and French website: For example with English, Chinese and French website:
```toml ```toml
# [en, zh-CN, fr, ...] determines default content language # [en, zh-cn, fr, ...] determines default content language
defaultContentLanguage = "en" defaultContentLanguage = "en"
[languages] [languages]
...@@ -606,49 +608,36 @@ defaultContentLanguage = "en" ...@@ -606,49 +608,36 @@ defaultContentLanguage = "en"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3 weight = 3
[[languages.en.menu.main]]
identifier = "about"
pre = ""
name = "About"
url = "/about/"
title = ""
weight = 4
[languages.zh-CN] [languages.zh-cn]
weight = 2 weight = 2
title = "我的全新 Hugo 网站" title = "我的全新 Hugo 网站"
# language code, CN only here
languageCode = "zh-CN" languageCode = "zh-CN"
languageName = "简体中文" languageName = "简体中文"
# whether to include Chinese/Japanese/Korean # whether to include Chinese/Japanese/Korean
hasCJKLanguage = true hasCJKLanguage = true
[[languages.zh-CN.menu.main]] [[languages.zh-cn.menu.main]]
identifier = "posts" identifier = "posts"
pre = "" pre = ""
name = "文章" name = "文章"
url = "/posts/" url = "/posts/"
title = "" title = ""
weight = 1 weight = 1
[[languages.zh-CN.menu.main]] [[languages.zh-cn.menu.main]]
identifier = "tags" identifier = "tags"
pre = "" pre = ""
name = "标签" name = "标签"
url = "/tags/" url = "/tags/"
title = "" title = ""
weight = 2 weight = 2
[[languages.zh-CN.menu.main]] [[languages.zh-cn.menu.main]]
identifier = "categories" identifier = "categories"
pre = "" pre = ""
name = "分类" name = "分类"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3 weight = 3
[[languages.zh-CN.menu.main]]
identifier = "about"
pre = ""
name = "关于"
url = "/about/"
title = ""
weight = 4
[languages.fr] [languages.fr]
weight = 3 weight = 3
...@@ -676,13 +665,6 @@ defaultContentLanguage = "en" ...@@ -676,13 +665,6 @@ defaultContentLanguage = "en"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3 weight = 3
[[languages.fr.menu.main]]
identifier = "about"
pre = ""
name = "À propos"
url = "/about/"
title = ""
weight = 4
``` ```
Then, for each new page, append the language code to the file name. Then, for each new page, append the language code to the file name.
......
...@@ -83,6 +83,8 @@ The following is a basic configuration for the LoveIt theme: ...@@ -83,6 +83,8 @@ The following is a basic configuration for the LoveIt theme:
```toml ```toml
baseURL = "http://example.org/" baseURL = "http://example.org/"
# [en, zh-cn, fr, ...] determines default content language
defaultContentLanguage = "en"
# language code # language code
languageCode = "en" languageCode = "en"
title = "My New Hugo Site" title = "My New Hugo Site"
...@@ -118,13 +120,6 @@ theme = "LoveIt" ...@@ -118,13 +120,6 @@ theme = "LoveIt"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3 weight = 3
[[menu.main]]
identifier = "about"
pre = ""
name = "About"
url = "/about/"
title = ""
weight = 4
``` ```
{{< admonition >}} {{< admonition >}}
...@@ -136,7 +131,7 @@ When building the website, you can set a theme by using `--theme` option. Howeve ...@@ -136,7 +131,7 @@ When building the website, you can set a theme by using `--theme` option. Howeve
Here is the way to create your first post: Here is the way to create your first post:
```bash ```bash
hugo new posts/first_post.md hugo new posts/first_post.md
``` ```
Feel free to edit the post file by adding some sample content and replacing the title value in the beginning of the file. Feel free to edit the post file by adding some sample content and replacing the title value in the beginning of the file.
...@@ -191,13 +186,16 @@ Note that some of these parameters are explained in details in other sections of ...@@ -191,13 +186,16 @@ Note that some of these parameters are explained in details in other sections of
# LoveIt theme version # LoveIt theme version
version = "0.1.X" version = "0.1.X"
# site description # site description
description = "About LoveIt Theme" description = "This is My New Hugo Site"
# site keywords # site keywords
keywords = ["Theme", "Hugo"] keywords = ["Theme", "Hugo"]
# site default theme ("light", "dark", "auto") # site default theme ("light", "dark", "auto")
defaultTheme = "auto" defaultTheme = "auto"
# public git repo url only then enableGitInfo is true # public git repo url only then enableGitInfo is true
gitRepo = "" gitRepo = ""
# LoveIt :(fas fa-greater-than-equal): :(far fa-file-archive): v0.1.1
# which hash function used for SRI, when empty, no SRI is used ("sha256", "sha384", "sha512", "md5")
fingerprint = ""
# Header info # Header info
[params.header] [params.header]
# desktop header mode ("fixed", "normal", "auto") # desktop header mode ("fixed", "normal", "auto")
...@@ -222,7 +220,7 @@ Note that some of these parameters are explained in details in other sections of ...@@ -222,7 +220,7 @@ Note that some of these parameters are explained in details in other sections of
# URL of avatar shown in home page # URL of avatar shown in home page
avatarURL = "/images/avatar.png" avatarURL = "/images/avatar.png"
# subtitle shown in home page # subtitle shown in home page
subtitle = "This is my new hugo site" subtitle = "This is My New Hugo Site"
# whether to use typeit animation for subtitle # whether to use typeit animation for subtitle
typeit = true typeit = true
# whether to show social links # whether to show social links
...@@ -355,10 +353,14 @@ Note that some of these parameters are explained in details in other sections of ...@@ -355,10 +353,14 @@ Note that some of these parameters are explained in details in other sections of
enable = true enable = true
# Disqus Comment Config (https://disqus.com/) # Disqus Comment Config (https://disqus.com/)
[params.comment.disqus] [params.comment.disqus]
# LoveIt :(fas fa-greater-than-equal): :(far fa-file-archive): v0.1.1
enable = false
# Disqus shortname to use Disqus in posts # Disqus shortname to use Disqus in posts
shortname = "dillonzq" shortname = ""
# Gittalk Comment Config (https://github.com/gitalk/gitalk) # Gitalk Comment Config (https://github.com/gitalk/gitalk)
[params.comment.gitalk] [params.comment.gitalk]
# LoveIt :(fas fa-greater-than-equal): :(far fa-file-archive): v0.1.1
enable = false
owner = "" owner = ""
repo = "" repo = ""
clientId = "" clientId = ""
...@@ -445,7 +447,7 @@ Note that some of these parameters are explained in details in other sections of ...@@ -445,7 +447,7 @@ Note that some of these parameters are explained in details in other sections of
# echarts@4.6.0 https://echarts.apache.org/ # echarts@4.6.0 https://echarts.apache.org/
echartsJS = '' echartsJS = ''
echartsMacaronsJS = '' echartsMacaronsJS = ''
# gitalk@1.6.0 https://github.com/gitalk/gitalk # gitalk@1.6.2 https://github.com/gitalk/gitalk
gitalkCSS = '' gitalkCSS = ''
gitalkJS = '' gitalkJS = ''
# valine@1.3.10 https://valine.js.org/ # valine@1.3.10 https://valine.js.org/
...@@ -525,7 +527,7 @@ Note that some of these parameters are explained in details in other sections of ...@@ -525,7 +527,7 @@ Note that some of these parameters are explained in details in other sections of
taxonomyTerm = ["HTML"] taxonomyTerm = ["HTML"]
``` ```
![Complete configuration preview](/images/theme-documentation-basics/complete-configuration-preview.gif "Complete configuration preview") ![Complete configuration preview](/images/theme-documentation-basics/complete-configuration-preview.png "Complete configuration preview")
### 3.2 Favicons, Browserconfig, Manifest ### 3.2 Favicons, Browserconfig, Manifest
...@@ -581,7 +583,7 @@ After learning [how Hugo handle multilingual websites](https://gohugo.io/content ...@@ -581,7 +583,7 @@ After learning [how Hugo handle multilingual websites](https://gohugo.io/content
For example with English, Chinese and French website: For example with English, Chinese and French website:
```toml ```toml
# [en, zh-CN, fr, ...] determines default content language # [en, zh-cn, fr, ...] determines default content language
defaultContentLanguage = "en" defaultContentLanguage = "en"
[languages] [languages]
...@@ -611,49 +613,36 @@ defaultContentLanguage = "en" ...@@ -611,49 +613,36 @@ defaultContentLanguage = "en"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3 weight = 3
[[languages.en.menu.main]]
identifier = "about"
pre = ""
name = "About"
url = "/about/"
title = ""
weight = 4
[languages.zh-CN] [languages.zh-cn]
weight = 2 weight = 2
title = "我的全新 Hugo 网站" title = "我的全新 Hugo 网站"
# language code, CN only here
languageCode = "zh-CN" languageCode = "zh-CN"
languageName = "简体中文" languageName = "简体中文"
# whether to include Chinese/Japanese/Korean # whether to include Chinese/Japanese/Korean
hasCJKLanguage = true hasCJKLanguage = true
[[languages.zh-CN.menu.main]] [[languages.zh-cn.menu.main]]
identifier = "posts" identifier = "posts"
pre = "" pre = ""
name = "文章" name = "文章"
url = "/posts/" url = "/posts/"
title = "" title = ""
weight = 1 weight = 1
[[languages.zh-CN.menu.main]] [[languages.zh-cn.menu.main]]
identifier = "tags" identifier = "tags"
pre = "" pre = ""
name = "标签" name = "标签"
url = "/tags/" url = "/tags/"
title = "" title = ""
weight = 2 weight = 2
[[languages.zh-CN.menu.main]] [[languages.zh-cn.menu.main]]
identifier = "categories" identifier = "categories"
pre = "" pre = ""
name = "分类" name = "分类"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3 weight = 3
[[languages.zh-CN.menu.main]]
identifier = "about"
pre = ""
name = "关于"
url = "/about/"
title = ""
weight = 4
[languages.fr] [languages.fr]
weight = 3 weight = 3
...@@ -681,13 +670,6 @@ defaultContentLanguage = "en" ...@@ -681,13 +670,6 @@ defaultContentLanguage = "en"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3 weight = 3
[[languages.fr.menu.main]]
identifier = "about"
pre = ""
name = "À propos"
url = "/about/"
title = ""
weight = 4
``` ```
Then, for each new page, append the language code to the file name. Then, for each new page, append the language code to the file name.
......
...@@ -78,9 +78,14 @@ git submodule -b master add https://github.com/dillonzq/LoveIt.git themes/LoveIt ...@@ -78,9 +78,14 @@ git submodule -b master add https://github.com/dillonzq/LoveIt.git themes/LoveIt
```toml ```toml
baseURL = "http://example.org/" baseURL = "http://example.org/"
# 语言代码 # [en, zh-cn, fr, ...] 设置默认的语言
languageCode = "en" defaultContentLanguage = "zh-cn"
title = "My New Hugo Site" # 网站语言, 仅在这里 CN 大写
languageCode = "zh-CN"
# 是否包括中日韩文字
hasCJKLanguage = true
# 网站标题
title = "我的全新 Hugo 网站"
# 更改使用 Hugo 构建网站时使用的默认主题 # 更改使用 Hugo 构建网站时使用的默认主题
theme = "LoveIt" theme = "LoveIt"
...@@ -94,7 +99,7 @@ theme = "LoveIt" ...@@ -94,7 +99,7 @@ theme = "LoveIt"
identifier = "posts" identifier = "posts"
# 你可以在名称 (允许 HTML 格式) 之前添加其他信息, 例如图标 # 你可以在名称 (允许 HTML 格式) 之前添加其他信息, 例如图标
pre = "" pre = ""
name = "Posts" name = "文章"
url = "/posts/" url = "/posts/"
# 当你将鼠标悬停在此菜单链接上时, 将显示的标题 # 当你将鼠标悬停在此菜单链接上时, 将显示的标题
title = "" title = ""
...@@ -102,24 +107,17 @@ theme = "LoveIt" ...@@ -102,24 +107,17 @@ theme = "LoveIt"
[[menu.main]] [[menu.main]]
identifier = "tags" identifier = "tags"
pre = "" pre = ""
name = "Tags" name = "标签"
url = "/tags/" url = "/tags/"
title = "" title = ""
weight = 2 weight = 2
[[menu.main]] [[menu.main]]
identifier = "categories" identifier = "categories"
pre = "" pre = ""
name = "Categories" name = "分类"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3 weight = 3
[[menu.main]]
identifier = "about"
pre = ""
name = "About"
url = "/about/"
title = ""
weight = 4
``` ```
{{< admonition >}} {{< admonition >}}
...@@ -150,7 +148,7 @@ hugo serve ...@@ -150,7 +148,7 @@ hugo serve
去查看 `http://localhost:1313`. 去查看 `http://localhost:1313`.
![基本配置下的预览](/images/theme-documentation-basics/basic-configuration-preview.png "基本配置下的预览") ![基本配置下的预览](/images/theme-documentation-basics/basic-configuration-preview.zh-cn.png "基本配置下的预览")
{{< admonition tip >}} {{< admonition tip >}}
当你运行 `hugo serve` 时, 当文件内容更改时, 页面会随着更改自动刷新. 当你运行 `hugo serve` 时, 当文件内容更改时, 页面会随着更改自动刷新.
...@@ -186,13 +184,16 @@ hugo ...@@ -186,13 +184,16 @@ hugo
# LoveIt 主题版本 # LoveIt 主题版本
version = "0.1.X" version = "0.1.X"
# 网站描述 # 网站描述
description = "About LoveIt Theme" description = "这是我的全新 Hugo 网站"
# 网站关键词 # 网站关键词
keywords = ["Theme", "Hugo"] keywords = ["Theme", "Hugo"]
# 网站默认主题样式 ("light", "dark", "auto") # 网站默认主题样式 ("light", "dark", "auto")
defaultTheme = "auto" defaultTheme = "auto"
# 公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效 # 公共 git 仓库路径,仅在 enableGitInfo 设为 true 时有效
gitRepo = "" gitRepo = ""
# LoveIt :(fas fa-greater-than-equal): :(far fa-file-archive): v0.1.1
# 哪种哈希函数用来 SRI, 为空时表示不使用 SRI ("sha256", "sha384", "sha512", "md5")
fingerprint = ""
# 页面头部导航栏信息 # 页面头部导航栏信息
[params.header] [params.header]
# 桌面端导航栏模式 ("fixed", "normal", "auto") # 桌面端导航栏模式 ("fixed", "normal", "auto")
...@@ -217,7 +218,7 @@ hugo ...@@ -217,7 +218,7 @@ hugo
# 主页显示头像的 URL # 主页显示头像的 URL
avatarURL = "/images/avatar.png" avatarURL = "/images/avatar.png"
# 主页显示的网站副标题 # 主页显示的网站副标题
subtitle = "This is my new hugo site" subtitle = "这是我的全新 Hugo 网站"
# 是否为副标题显示打字机动画 # 是否为副标题显示打字机动画
typeit = true typeit = true
# 是否显示社交账号 # 是否显示社交账号
...@@ -232,15 +233,15 @@ hugo ...@@ -232,15 +233,15 @@ hugo
# 主页的社交信息设置 # 主页的社交信息设置
[params.social] [params.social]
GitHub = "xxxx" GitHub = "xxxx"
Linkedin = "xxxx" # Linkedin = "xxxx"
Twitter = "xxxx" # Twitter = "xxxx"
Instagram = "xxxx" # Instagram = "xxxx"
Email = "xxxx@xxxx.com" Email = "xxxx@xxxx.com"
Facebook = "xxxx" # Facebook = "xxxx"
Telegram = "xxxx" # Telegram = "xxxx"
# Medium = "xxxx" # Medium = "xxxx"
# Gitlab = "xxxx" # Gitlab = "xxxx"
Youtubelegacy = "xxxx" # Youtubelegacy = "xxxx"
# Youtubecustom = "xxxx" # Youtubecustom = "xxxx"
# Youtubechannel = "xxxx" # Youtubechannel = "xxxx"
# Tumblr ="xxxx" # Tumblr ="xxxx"
...@@ -252,7 +253,7 @@ hugo ...@@ -252,7 +253,7 @@ hugo
# FreeCodeCamp = "xxxx" # FreeCodeCamp = "xxxx"
# Bitbucket = "xxxx" # Bitbucket = "xxxx"
# Stackoverflow = "xxxx" # Stackoverflow = "xxxx"
# Weibo = "xxxx" Weibo = "xxxx"
# Odnoklassniki = "xxxx" # Odnoklassniki = "xxxx"
# VK = "xxxx" # VK = "xxxx"
# Flickr = "xxxx" # Flickr = "xxxx"
...@@ -275,8 +276,8 @@ hugo ...@@ -275,8 +276,8 @@ hugo
# Strava = "xxxx" # Strava = "xxxx"
# Skype = "xxxx" # Skype = "xxxx"
# Whatsapp = "xxxx" # Whatsapp = "xxxx"
# Zhihu = "xxxx" Zhihu = "xxxx"
# Douban = "xxxx" Douban = "xxxx"
# Angellist = "xxxx" # Angellist = "xxxx"
# Slidershare = "xxxx" # Slidershare = "xxxx"
# Jsfiddle = "xxxx" # Jsfiddle = "xxxx"
...@@ -294,8 +295,7 @@ hugo ...@@ -294,8 +295,7 @@ hugo
# Gitea = "xxxx" # Gitea = "xxxx"
# XMPP = "xxxx" # XMPP = "xxxx"
# Matrix = "xxxx" # Matrix = "xxxx"
# Bilibili = "xxxx" Bilibili = "xxxx"
# 文章页面配置 # 文章页面配置
[params.page] [params.page]
# 是否在文章页面使用 lightgallery # 是否在文章页面使用 lightgallery
...@@ -320,11 +320,11 @@ hugo ...@@ -320,11 +320,11 @@ hugo
enable = true enable = true
Twitter = true Twitter = true
Facebook = true Facebook = true
Linkedin = true # Linkedin = true
Whatsapp = true # Whatsapp = true
Pinterest = true # Pinterest = true
# Tumblr = true # Tumblr = true
HackerNews = true # HackerNews = true
# Reddit = true # Reddit = true
# VK = true # VK = true
# Buffer = true # Buffer = true
...@@ -335,13 +335,13 @@ hugo ...@@ -335,13 +335,13 @@ hugo
# Digg = true # Digg = true
# Stumbleupon = true # Stumbleupon = true
# Flipboard = true # Flipboard = true
# Weibo = true Weibo = true
# Renren = true # Renren = true
# Myspace = true # Myspace = true
# Blogger = true # Blogger = true
# Baidu = true # Baidu = true
# Odnoklassniki = true # Odnoklassniki = true
# Evernote = true Evernote = true
# Skype = true # Skype = true
# Trello = true # Trello = true
# Mix = true # Mix = true
...@@ -350,10 +350,14 @@ hugo ...@@ -350,10 +350,14 @@ hugo
enable = true enable = true
# Disqus 评论系统设置 (https://disqus.com/) # Disqus 评论系统设置 (https://disqus.com/)
[params.comment.disqus] [params.comment.disqus]
# Disqus 的用户名,用来在文章中启用 Disqus 评论系统 # LoveIt :(fas fa-greater-than-equal): :(far fa-file-archive): v0.1.1
shortname = "dillonzq" enable = false
# Gittalk 评论系统设置 (https://github.com/gitalk/gitalk) # Disqus 的 shortname,用来在文章中启用 Disqus 评论系统
shortname = ""
# Gitalk 评论系统设置 (https://github.com/gitalk/gitalk)
[params.comment.gitalk] [params.comment.gitalk]
# LoveIt :(fas fa-greater-than-equal): :(far fa-file-archive): v0.1.1
enable = false
owner = "" owner = ""
repo = "" repo = ""
clientId = "" clientId = ""
...@@ -440,7 +444,7 @@ hugo ...@@ -440,7 +444,7 @@ hugo
# echarts@4.6.0 https://echarts.apache.org/ # echarts@4.6.0 https://echarts.apache.org/
echartsJS = '' echartsJS = ''
echartsMacaronsJS = '' echartsMacaronsJS = ''
# gitalk@1.6.0 https://github.com/gitalk/gitalk # gitalk@1.6.2 https://github.com/gitalk/gitalk
gitalkCSS = '' gitalkCSS = ''
gitalkJS = '' gitalkJS = ''
# valine@1.3.10 https://valine.js.org/ # valine@1.3.10 https://valine.js.org/
...@@ -520,7 +524,7 @@ hugo ...@@ -520,7 +524,7 @@ hugo
taxonomyTerm = ["HTML"] taxonomyTerm = ["HTML"]
``` ```
![完整配置下的预览](/images/theme-documentation-basics/complete-configuration-preview.gif "完整配置下的预览") ![完整配置下的预览](/images/theme-documentation-basics/complete-configuration-preview.zh-cn.png "完整配置下的预览")
### 3.2 网站图标, 浏览器配置, 网站清单 ### 3.2 网站图标, 浏览器配置, 网站清单
...@@ -576,8 +580,8 @@ $code-font-family: Fira Mono, Source Code Pro, Menlo, Consolas, Monaco, monospac ...@@ -576,8 +580,8 @@ $code-font-family: Fira Mono, Source Code Pro, Menlo, Consolas, Monaco, monospac
例如, 一个支持英语, 中文和法语的网站配置: 例如, 一个支持英语, 中文和法语的网站配置:
```toml ```toml
# [en, zh-CN, fr, ...] 设置默认的语言 # [en, zh-cn, fr, ...] 设置默认的语言
defaultContentLanguage = "en" defaultContentLanguage = "zh-cn"
[languages] [languages]
[languages.en] [languages.en]
...@@ -606,49 +610,36 @@ defaultContentLanguage = "en" ...@@ -606,49 +610,36 @@ defaultContentLanguage = "en"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3 weight = 3
[[languages.en.menu.main]]
identifier = "about"
pre = ""
name = "About"
url = "/about/"
title = ""
weight = 4
[languages.zh-CN] [languages.zh-cn]
weight = 2 weight = 2
title = "我的全新 Hugo 网站" title = "我的全新 Hugo 网站"
# 网站语言, 仅在这里 CN 大写
languageCode = "zh-CN" languageCode = "zh-CN"
languageName = "简体中文" languageName = "简体中文"
# 是否包括中日韩文字 # 是否包括中日韩文字
hasCJKLanguage = true hasCJKLanguage = true
[[languages.zh-CN.menu.main]] [[languages.zh-cn.menu.main]]
identifier = "posts" identifier = "posts"
pre = "" pre = ""
name = "文章" name = "文章"
url = "/posts/" url = "/posts/"
title = "" title = ""
weight = 1 weight = 1
[[languages.zh-CN.menu.main]] [[languages.zh-cn.menu.main]]
identifier = "tags" identifier = "tags"
pre = "" pre = ""
name = "标签" name = "标签"
url = "/tags/" url = "/tags/"
title = "" title = ""
weight = 2 weight = 2
[[languages.zh-CN.menu.main]] [[languages.zh-cn.menu.main]]
identifier = "categories" identifier = "categories"
pre = "" pre = ""
name = "分类" name = "分类"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3 weight = 3
[[languages.zh-CN.menu.main]]
identifier = "about"
pre = ""
name = "关于"
url = "/about/"
title = ""
weight = 4
[languages.fr] [languages.fr]
weight = 3 weight = 3
...@@ -676,13 +667,6 @@ defaultContentLanguage = "en" ...@@ -676,13 +667,6 @@ defaultContentLanguage = "en"
url = "/categories/" url = "/categories/"
title = "" title = ""
weight = 3 weight = 3
[[languages.fr.menu.main]]
identifier = "about"
pre = ""
name = "À propos"
url = "/about/"
title = ""
weight = 4
``` ```
然后, 对于每个新页面, 将语言代码附加到文件名中. 然后, 对于每个新页面, 将语言代码附加到文件名中.
......
...@@ -98,7 +98,7 @@ comment: true ...@@ -98,7 +98,7 @@ comment: true
**LoveIt** theme uses the summary of the content to display abstract information in the home page. Hugo can generate summaries of your content. **LoveIt** theme uses the summary of the content to display abstract information in the home page. Hugo can generate summaries of your content.
![Summary Preview](/images/theme-documentation-content/summary.png "Summary Preview") ![Summary Preview](/images/theme-documentation-content/summary.jpg "Summary Preview")
### Automatic Summary Splitting ### Automatic Summary Splitting
...@@ -155,13 +155,13 @@ This part is shown in the [emoji support page](../emoji-support/). ...@@ -155,13 +155,13 @@ This part is shown in the [emoji support page](../emoji-support/).
### Mathematical Formula ### Mathematical Formula
**LoveIt** theme supports mathematical formulas based on [KaTeX](https://katex.org/). **LoveIt** theme supports mathematical formulas based on [$ \KaTeX $](https://katex.org/).
Set the property `enable = true` under `[params.math]` in your [site configuration](../theme-documentation-basics/#site-configuration) Set the property `enable = true` under `[params.math]` in your [site configuration](../theme-documentation-basics/#site-configuration)
and the property `math: true` of the article front matter to enable the automatic rendering of mathematical formulas. and the property `math: true` of the article front matter to enable the automatic rendering of mathematical formulas.
{{< admonition tip >}} {{< admonition tip >}}
Here is a list of [TeX functions supported by KaTeX](https://katex.org/docs/supported.html). Here is a list of [$ \TeX $ functions supported by $ \KaTeX $](https://katex.org/docs/supported.html).
{{< /admonition >}} {{< /admonition >}}
#### Block Formula #### Block Formula
...@@ -198,9 +198,9 @@ You can add more block and inline delimiters in your [site configuration](../the ...@@ -198,9 +198,9 @@ You can add more block and inline delimiters in your [site configuration](../the
#### Copy-tex #### Copy-tex
**[Copy-tex](https://github.com/Khan/KaTeX/tree/master/contrib/copy-tex)** is an extension for **KaTex**. **[Copy-tex](https://github.com/Khan/KaTeX/tree/master/contrib/copy-tex)** is an extension for **$ \KaTeX $**.
By the extension, when selecting and copying KaTeX-rendered elements, copies their LaTeX source to the clipboard. By the extension, when selecting and copying $ \KaTeX $ rendered elements, copies their $ \LaTeX $ source to the clipboard.
Set the property `copyTex = true` under `[params.math]` in your [site configuration](../theme-documentation-basics/#site-configuration) to enable Copy-tex. Set the property `copyTex = true` under `[params.math]` in your [site configuration](../theme-documentation-basics/#site-configuration) to enable Copy-tex.
...@@ -208,7 +208,7 @@ Select and copy the formula rendered in the previous section, and you can find t ...@@ -208,7 +208,7 @@ Select and copy the formula rendered in the previous section, and you can find t
#### mhchem #### mhchem
**[mhchem](https://github.com/Khan/KaTeX/tree/master/contrib/mhchem)** is an extension for **KaTex**. **[mhchem](https://github.com/Khan/KaTeX/tree/master/contrib/mhchem)** is an extension for **$ \KaTeX $**.
By the extension, you can write beautiful chemical equations easily in the article. By the extension, you can write beautiful chemical equations easily in the article.
......
...@@ -103,7 +103,7 @@ comment: true ...@@ -103,7 +103,7 @@ comment: true
**LoveIt** theme uses the summary of the content to display abstract information in the home page. Hugo can generate summaries of your content. **LoveIt** theme uses the summary of the content to display abstract information in the home page. Hugo can generate summaries of your content.
![Summary Preview](/images/theme-documentation-content/summary.png "Summary Preview") ![Summary Preview](/images/theme-documentation-content/summary.jpg "Summary Preview")
### Automatic Summary Splitting ### Automatic Summary Splitting
...@@ -160,13 +160,13 @@ This part is shown in the [emoji support page](../emoji-support/). ...@@ -160,13 +160,13 @@ This part is shown in the [emoji support page](../emoji-support/).
### Mathematical Formula ### Mathematical Formula
**LoveIt** theme supports mathematical formulas based on [KaTeX](https://katex.org/). **LoveIt** theme supports mathematical formulas based on [$ \KaTeX $](https://katex.org/).
Set the property `enable = true` under `[params.math]` in your [site configuration](../theme-documentation-basics/#site-configuration) Set the property `enable = true` under `[params.math]` in your [site configuration](../theme-documentation-basics/#site-configuration)
and the property `math: true` of the article front matter to enable the automatic rendering of mathematical formulas. and the property `math: true` of the article front matter to enable the automatic rendering of mathematical formulas.
{{< admonition tip >}} {{< admonition tip >}}
Here is a list of [TeX functions supported by KaTeX](https://katex.org/docs/supported.html). Here is a list of [$ \TeX $ functions supported by $ \KaTeX $](https://katex.org/docs/supported.html).
{{< /admonition >}} {{< /admonition >}}
#### Block Formula #### Block Formula
...@@ -203,9 +203,9 @@ You can add more block and inline delimiters in your [site configuration](../the ...@@ -203,9 +203,9 @@ You can add more block and inline delimiters in your [site configuration](../the
#### Copy-tex #### Copy-tex
**[Copy-tex](https://github.com/Khan/KaTeX/tree/master/contrib/copy-tex)** is an extension for **KaTex**. **[Copy-tex](https://github.com/Khan/KaTeX/tree/master/contrib/copy-tex)** is an extension for **$ \KaTeX $**.
By the extension, when selecting and copying KaTeX-rendered elements, copies their LaTeX source to the clipboard. By the extension, when selecting and copying $ \KaTeX $ rendered elements, copies their $ \LaTeX $ source to the clipboard.
Set the property `copyTex = true` under `[params.math]` in your [site configuration](../theme-documentation-basics/#site-configuration) to enable Copy-tex. Set the property `copyTex = true` under `[params.math]` in your [site configuration](../theme-documentation-basics/#site-configuration) to enable Copy-tex.
...@@ -213,7 +213,7 @@ Select and copy the formula rendered in the previous section, and you can find t ...@@ -213,7 +213,7 @@ Select and copy the formula rendered in the previous section, and you can find t
#### mhchem #### mhchem
**[mhchem](https://github.com/Khan/KaTeX/tree/master/contrib/mhchem)** is an extension for **KaTex**. **[mhchem](https://github.com/Khan/KaTeX/tree/master/contrib/mhchem)** is an extension for **$ \KaTeX $**.
By the extension, you can write beautiful chemical equations easily in the article. By the extension, you can write beautiful chemical equations easily in the article.
......
...@@ -98,7 +98,7 @@ comment: true ...@@ -98,7 +98,7 @@ comment: true
**LoveIt** 主题使用内容摘要在主页中显示大致文章信息。Hugo 支持生成文章的摘要. **LoveIt** 主题使用内容摘要在主页中显示大致文章信息。Hugo 支持生成文章的摘要.
![文章摘要预览](/images/theme-documentation-content/summary.png "文章摘要预览") ![文章摘要预览](/images/theme-documentation-content/summary.jpg "文章摘要预览")
### 自动摘要拆分 ### 自动摘要拆分
...@@ -155,13 +155,13 @@ comment: true ...@@ -155,13 +155,13 @@ comment: true
### 数学公式 ### 数学公式
**LoveIt** 基于 [KaTeX](https://katex.org/) 提供数学公式的支持. **LoveIt** 基于 [$ \KaTeX $](https://katex.org/) 提供数学公式的支持.
在你的 [网站配置](../theme-documentation-basics/#site-configuration) 中的 `[params.math]` 下面设置属性 `enable = true`, 在你的 [网站配置](../theme-documentation-basics/#site-configuration) 中的 `[params.math]` 下面设置属性 `enable = true`,
并在文章的前置参数中设置属性 `math: true`来启用数学公式的自动渲染. 并在文章的前置参数中设置属性 `math: true`来启用数学公式的自动渲染.
{{< admonition tip >}} {{< admonition tip >}}
有一份 [KaTeX 中支持的 TeX 函数](https://katex.org/docs/supported.html) 清单. 有一份 [$ \KaTeX $ 中支持的 $ \TeX $ 函数](https://katex.org/docs/supported.html) 清单.
{{< /admonition >}} {{< /admonition >}}
#### 公式块 #### 公式块
...@@ -185,12 +185,12 @@ $$ c = \pm\sqrt{a^2 + b^2} $$ ...@@ -185,12 +185,12 @@ $$ c = \pm\sqrt{a^2 + b^2} $$
默认的行内公式分割符是 `$`/`$` 和 `\\(`/`\\)`: 默认的行内公式分割符是 `$`/`$` 和 `\\(`/`\\)`:
```markdown ```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 \\) $ c = \pm\sqrt{a^2 + b^2} $ \\( f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^{2 \pi i \xi x} d \xi \\)
``` ```
呈现的输出效果如下: 呈现的输出效果如下:
$ c = \pm\sqrt{a^2 + b^2} $ and \\( f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^{2 \pi i \xi x} d \xi \\) $ c = \pm\sqrt{a^2 + b^2} $ \\( f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^{2 \pi i \xi x} d \xi \\)
{{< admonition tip >}} {{< admonition tip >}}
你可以在 [网站配置](../theme-documentation-basics/#site-configuration) 中自定义公式块和行内公式的分割符. 你可以在 [网站配置](../theme-documentation-basics/#site-configuration) 中自定义公式块和行内公式的分割符.
...@@ -198,9 +198,9 @@ $ c = \pm\sqrt{a^2 + b^2} $ and \\( f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^ ...@@ -198,9 +198,9 @@ $ c = \pm\sqrt{a^2 + b^2} $ and \\( f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^
#### Copy-tex #### Copy-tex
**[Copy-tex](https://github.com/Khan/KaTeX/tree/master/contrib/copy-tex)** 是一个 **KaTex** 的插件. **[Copy-tex](https://github.com/Khan/KaTeX/tree/master/contrib/copy-tex)** 是一个 **$ \KaTeX $** 的插件.
通过这个扩展, 在选择并复制 KaTeX 渲染的公式时, 会将其 LaTeX 源代码复制到剪贴板. 通过这个扩展, 在选择并复制 $ \KaTeX $ 渲染的公式时, 会将其 $ \LaTeX $ 源代码复制到剪贴板.
在你的 [网站配置](../theme-documentation-basics/#site-configuration) 中的 `[params.math]` 下面设置属性 `copyTex = true` 来启用 Copy-tex. 在你的 [网站配置](../theme-documentation-basics/#site-configuration) 中的 `[params.math]` 下面设置属性 `copyTex = true` 来启用 Copy-tex.
...@@ -208,7 +208,7 @@ $ c = \pm\sqrt{a^2 + b^2} $ and \\( f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^ ...@@ -208,7 +208,7 @@ $ c = \pm\sqrt{a^2 + b^2} $ and \\( f(x)=\int_{-\infty}^{\infty} \hat{f}(\xi) e^
#### mhchem #### mhchem
**[mhchem](https://github.com/Khan/KaTeX/tree/master/contrib/mhchem)** 是一个 **KaTex** 的插件. **[mhchem](https://github.com/Khan/KaTeX/tree/master/contrib/mhchem)** 是一个 **$ \KaTeX $** 的插件.
通过这个扩展, 你可以在文章中轻松编写漂亮的化学方程式. 通过这个扩展, 你可以在文章中轻松编写漂亮的化学方程式.
......
...@@ -29,6 +29,9 @@ other = "More" ...@@ -29,6 +29,9 @@ other = "More"
# === Pagination === # === Pagination ===
# === partials/header.html === # === partials/header.html ===
[selectLanguage]
other = "Select Language"
[switchTheme] [switchTheme]
other = "Switch Theme" other = "Switch Theme"
# === partials/header.html === # === partials/header.html ===
......
...@@ -29,6 +29,9 @@ other = "Plus" ...@@ -29,6 +29,9 @@ other = "Plus"
# === Pagination === # === Pagination ===
# === partials/header.html === # === partials/header.html ===
[selectLanguage]
other = "Choisir la langue"
[switchTheme] [switchTheme]
other = "Changer de Thème" other = "Changer de Thème"
# === partials/header.html === # === partials/header.html ===
......
...@@ -29,6 +29,9 @@ other = "更多" ...@@ -29,6 +29,9 @@ other = "更多"
# === Pagination === # === Pagination ===
# === partials/header.html === # === partials/header.html ===
[selectLanguage]
other = "选择语言"
[switchTheme] [switchTheme]
other = "切换主题" other = "切换主题"
# === partials/header.html === # === partials/header.html ===
......
...@@ -6,5 +6,5 @@ ...@@ -6,5 +6,5 @@
</figcaption> </figcaption>
</figure> </figure>
{{- else -}} {{- else -}}
{{- partial "plugin/image.html" (dict "src" .Destination "title" .Title "description" .Text "lightgallery" false "scratch" (.Page.Scratch.Get "scratch")) -}} {{- partial "plugin/image.html" (dict "src_s" .Destination "title" .Title "description" .Text "lightgallery" false "scratch" (.Page.Scratch.Get "scratch")) -}}
{{- end -}} {{- end -}}
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
{{- if eq hugo.Environment "production" -}} {{- if eq hugo.Environment "production" -}}
{{- $scratch.Set "production" true -}} {{- $scratch.Set "production" true -}}
{{- $scratch.Set "CDN" .Site.Params.cdn -}} {{- $scratch.Set "CDN" .Site.Params.cdn -}}
{{- $scratch.Set "fingerprint" .Site.Params.fingerprint -}}
{{- end -}} {{- end -}}
<!DOCTYPE html> <!DOCTYPE html>
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
{{- /* Title */ -}} {{- /* Title */ -}}
<h1 class="single-title" itemprop="name headline"> <h1 class="single-title" itemprop="name headline">
<a href="{{ .Permalink }}">{{ .Title }}</a> <a href="{{ .RelPermalink }}">{{ .Title }}</a>
</h1> </h1>
{{- /* Meta */ -}} {{- /* Meta */ -}}
...@@ -19,9 +19,8 @@ ...@@ -19,9 +19,8 @@
{{- $author := .Params.author | default .Site.Author.name | default (T "author") -}} {{- $author := .Params.author | default .Site.Author.name | default (T "author") -}}
{{- $authorLink := .Params.authorLink | default .Site.Author.link | default (relLangURL "/") -}} {{- $authorLink := .Params.authorLink | default .Site.Author.link | default (relLangURL "/") -}}
<span class="post-author"> <span class="post-author">
<a class="author" href="{{ $authorLink }}" rel="author" target="_blank"> {{- $link := dict "class" "author" "href" $authorLink "title" "Author" "rel" "author" "icon" (dict "class" "fas fa-user-circle fa-fw") "content" $author -}}
<i class="fas fa-user-circle fa-fw"></i>{{ $author }} {{- partial "plugin/link.html" $link -}}
</a>
</span> </span>
{{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}} {{- $publish_date := .PublishDate.Format (.Site.Params.dateFormatToUse | default "2006-01-02") -}}
...@@ -55,7 +54,7 @@ ...@@ -55,7 +54,7 @@
{{- /* Footer */ -}} {{- /* Footer */ -}}
<div class="post-footer"> <div class="post-footer">
<a href="{{ .Permalink }}">{{ T "readMore" }}</a> <a href="{{ .RelPermalink }}">{{ T "readMore" }}</a>
{{- with .Params.tags -}} {{- with .Params.tags -}}
<div class="post-tags"> <div class="post-tags">
{{- range . -}} {{- range . -}}
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
{{- end -}} {{- end -}}
{{- /* lightgallery.js */ -}} {{- /* lightgallery.js */ -}}
{{- if ne .Page.Site.Params.page.lightgallery false | and (ne .Page.Params.lightgallery false) -}} {{- if ne .Site.Params.page.lightgallery false | and (ne .Params.lightgallery false) -}}
{{- with $CDN.lightgalleryCSS -}} {{- with $CDN.lightgalleryCSS -}}
{{- slice . | $scratch.Add "linkCDN" -}} {{- slice . | $scratch.Add "linkCDN" -}}
{{- else -}} {{- else -}}
...@@ -222,8 +222,8 @@ ...@@ -222,8 +222,8 @@
{{- else if not (strings.HasSuffix . ".min.css") -}} {{- else if not (strings.HasSuffix . ".min.css") -}}
{{- $res = minify $res -}} {{- $res = minify $res -}}
{{- end -}} {{- end -}}
{{- $res = $res | resources.Fingerprint "sha256" -}} {{- $stylesheet := dict "resource" $res "fingerprint" ($scratch.Get "fingerprint") -}}
<link rel="stylesheet" href="{{ $res.RelPermalink }}" integrity="{{ $res.Data.Integrity }}"> {{- partial "plugin/stylesheet.html" $stylesheet -}}
{{- end -}} {{- end -}}
{{- range $scratch.Get "scriptCDN" -}} {{- range $scratch.Get "scriptCDN" -}}
...@@ -234,8 +234,8 @@ ...@@ -234,8 +234,8 @@
{{- if not (strings.HasSuffix . ".min.js") -}} {{- if not (strings.HasSuffix . ".min.js") -}}
{{- $res = minify $res -}} {{- $res = minify $res -}}
{{- end -}} {{- end -}}
{{- $res = $res | resources.Fingerprint "sha256" -}} {{- $script := dict "resource" $res "fingerprint" ($scratch.Get "fingerprint") -}}
<script src="{{ $res.RelPermalink }}" integrity="{{ $res.Data.Integrity }}"></script> {{- partial "plugin/script.html" $script -}}
{{- end -}} {{- end -}}
{{- /* Google analytics async */ -}} {{- /* Google analytics async */ -}}
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
{{- $CDN := $scratch.Get "CDN" -}} {{- $CDN := $scratch.Get "CDN" -}}
{{- /* Disqus Comment System */ -}} {{- /* Disqus Comment System */ -}}
{{- with .Site.Params.comment.disqus.shortname -}} {{- if .Site.Params.comment.disqus.enable -}}
<div id="disqus_thread"></div> <div id="disqus_thread"></div>
{{- $script := printf `<script src="https://%s.disqus.com/embed.js"></script>` . -}} {{- $script := printf `<script defer src="https://%s.disqus.com/embed.js"></script>` .Site.Params.comment.disqus.shortname -}}
{{- slice $script | $scratch.Add "scriptCDN" -}} {{- slice $script | $scratch.Add "scriptCDN" -}}
<noscript> <noscript>
Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a> Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
{{- end -}} {{- end -}}
{{- /* Gitalk Comment System */ -}} {{- /* Gitalk Comment System */ -}}
{{- if .Site.Params.comment.gitalk.owner -}} {{- if .Site.Params.comment.gitalk.enable -}}
{{- $gitalk := .Site.Params.comment.gitalk -}} {{- $gitalk := .Site.Params.comment.gitalk -}}
<div id="gitalk"></div> <div id="gitalk"></div>
{{- with $CDN.gitalkCSS -}} {{- with $CDN.gitalkCSS -}}
......
...@@ -25,16 +25,18 @@ ...@@ -25,16 +25,18 @@
{{- with $CDN.fontawesomeFreeCSS -}} {{- with $CDN.fontawesomeFreeCSS -}}
{{- . | safeHTML -}} {{- . | safeHTML -}}
{{- else -}} {{- else -}}
{{- $res := resources.Get "lib/fontawesome-free/all.min.css" | resources.Fingerprint "sha256" -}} {{- $res := resources.Get "lib/fontawesome-free/all.min.css" -}}
<link rel="stylesheet" href="{{ $res.RelPermalink }}" integrity="{{ $res.Data.Integrity }}"> {{- $stylesheet := dict "resource" $res "fingerprint" ($scratch.Get "fingerprint") -}}
{{- partial "plugin/stylesheet.html" $stylesheet -}}
{{- end -}} {{- end -}}
{{- /* Animate.css */ -}} {{- /* Animate.css */ -}}
{{- with $CDN.animateCSS -}} {{- with $CDN.animateCSS -}}
{{- . | safeHTML -}} {{- . | safeHTML -}}
{{- else -}} {{- else -}}
{{ $res := resources.Get "lib/animate/animate.min.css" | resources.Fingerprint "sha256" -}} {{- $res := resources.Get "lib/fontawesome-free/all.min.css" -}}
<link rel="stylesheet" href="{{ $res.RelPermalink }}" integrity="{{ $res.Data.Integrity }}"> {{- $stylesheet := dict "resource" $res "fingerprint" ($scratch.Get "fingerprint") -}}
{{- partial "plugin/stylesheet.html" $stylesheet -}}
{{- end -}} {{- end -}}
{{- /* style.min.css */ -}} {{- /* style.min.css */ -}}
...@@ -43,5 +45,6 @@ ...@@ -43,5 +45,6 @@
{{- $options = dict "includePaths" (slice "config/css") | merge $options -}} {{- $options = dict "includePaths" (slice "config/css") | merge $options -}}
{{- $options = dict "outputStyle" "compressed" | merge $options -}} {{- $options = dict "outputStyle" "compressed" | merge $options -}}
{{- $options = dict "enableSourceMap" true | merge $options -}} {{- $options = dict "enableSourceMap" true | merge $options -}}
{{- $res = resources.ExecuteAsTemplate "style.scss" . $res | toCSS $options | resources.Fingerprint "sha256" -}} {{- $res = resources.ExecuteAsTemplate "style.scss" . $res | toCSS $options -}}
<link rel="stylesheet" href="{{ $res.RelPermalink }}" integrity="{{ $res.Data.Integrity }}"> {{- $stylesheet := dict "resource" $res "fingerprint" ($scratch.Get "fingerprint") -}}
{{- partial "plugin/stylesheet.html" $stylesheet -}}
...@@ -14,26 +14,28 @@ ...@@ -14,26 +14,28 @@
{{- end -}} {{- end -}}
{{- if .Site.IsMultiLingual -}} {{- if .Site.IsMultiLingual -}}
&nbsp;|&nbsp; &nbsp;|&nbsp;
<a href="javascript:void(0);" class="menu-item"> <a href="javascript:void(0);" class="menu-item" title="{{ T "selectLanguage" }}">
<i class="fas fa-language fa-fw"></i>&nbsp; <label for="language-select-desktop">
<select class="select-language" onchange="location = this.value;"> <i class="fas fa-language fa-fw"></i>&nbsp;
{{- range .Page.AllTranslations -}} <select class="language-select" id="language-select-desktop" onchange="location = this.value;">
{{- $translation := . -}} {{- range .Page.AllTranslations -}}
{{- range $.Site.Languages -}} {{- $translation := . -}}
{{- if eq $translation.Lang .Lang -}} {{- range $.Site.Languages -}}
{{- if eq $.Page.Lang .Lang -}} {{- if eq $translation.Lang .Lang -}}
<option value="{{ $translation.Permalink }}" selected>{{ .LanguageName }}</option> {{- if eq $.Page.Lang .Lang -}}
{{- else -}} <option value="{{ $translation.RelPermalink }}" selected>{{ .LanguageName }}</option>
<option value="{{ $translation.Permalink }}">{{ .LanguageName }}</option> {{- else -}}
<option value="{{ $translation.RelPermalink }}">{{ .LanguageName }}</option>
{{- end -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- end -}} </select>
</select> </label>
</a> </a>
{{- end -}} {{- end -}}
<a href="javascript:void(0);" class="theme-switch" title="{{ T "switchTheme" }}"> <a href="javascript:void(0);" class="theme-switch" title="{{ T "switchTheme" }}">
<i class="fas fa-adjust fa-rotate-180 fa-fw"></i> <i class="fas fa-adjust fa-fw "></i>
</a> </a>
</div> </div>
</div> </div>
...@@ -60,26 +62,28 @@ ...@@ -60,26 +62,28 @@
</a> </a>
{{- end -}} {{- end -}}
{{- if .Site.IsMultiLingual -}} {{- if .Site.IsMultiLingual -}}
<a href="javascript:void(0);" class="menu-item"> <a href="javascript:void(0);" class="menu-item" title="{{ T "selectLanguage" }}">
<i class="fas fa-language fa-fw"></i>&nbsp; <label for="language-select-mobile">
<select class="select-language" onchange="location = this.value;"> <i class="fas fa-language fa-fw"></i>&nbsp;
{{- range .Page.AllTranslations -}} <select class="language-select" id="language-select-mobile" onchange="location = this.value;">
{{- $translation := . -}} {{- range .Page.AllTranslations -}}
{{- range $.Site.Languages -}} {{- $translation := . -}}
{{- if eq $translation.Lang .Lang -}} {{- range $.Site.Languages -}}
{{- if eq $.Page.Lang .Lang -}} {{- if eq $translation.Lang .Lang -}}
<option value="{{ $translation.Permalink }}" selected>{{ .LanguageName }}</option> {{- if eq $.Page.Lang .Lang -}}
{{- else -}} <option value="{{ $translation.RelPermalink }}" selected>{{ .LanguageName }}</option>
<option value="{{ $translation.Permalink }}">{{ .LanguageName }}</option> {{- else -}}
<option value="{{ $translation.RelPermalink }}">{{ .LanguageName }}</option>
{{- end -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- end -}} </select>
</select> </label>
</a> </a>
{{- end -}} {{- end -}}
<a href="javascript:void(0);" class="theme-switch" title="{{ T "switchTheme" }}"> <a href="javascript:void(0);" class="theme-switch" title="{{ T "switchTheme" }}">
<i class="fas fa-adjust fa-rotate-180 fa-fw"></i> <i class="fas fa-adjust fa-fw"></i>
</a> </a>
</div> </div>
</div> </div>
......
...@@ -22,4 +22,4 @@ ...@@ -22,4 +22,4 @@
{{- .Set "iconfont" true -}} {{- .Set "iconfont" true -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
<i class="{{ delimit $classList ` ` }}"></i> <i class="{{ delimit $classList ` ` }}"></i>
\ No newline at end of file
<a href="{{ .href | safeURL }}"{{ with .title }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .href "http" }} target="_blank"{{ end }} rel="noopener noreffer{{ with .rel }} {{ . }}{{ end }}"> <a href="{{ .href | safeURL }}"{{ with .title }} title="{{ . }}"{{ end }}{{ if strings.HasPrefix .href "http" }} target="_blank"{{ end }} rel="noopener noreffer{{ with .rel }} {{ . }}{{ end }}"{{ with .class }} class="{{ . }}"{{ end }}>
{{- with .icon -}} {{- with .icon -}}
{{- partial "plugin/icon.html" . -}} {{- partial "plugin/icon.html" . -}}
{{- end -}} {{- end -}}
......
{{- $res := .resource -}}
{{- with .fingerprint -}}
{{- $res = $res | resources.Fingerprint . -}}
<script src="{{ $res.RelPermalink }}" integrity="{{ $res.Data.Integrity }}"></script>
{{- else -}}
<script src="{{ $res.RelPermalink }}"></script>
{{- end -}}
{{- $res := .resource -}}
{{- with .fingerprint -}}
{{- $res = $res | resources.Fingerprint . -}}
<link rel="stylesheet" href="{{ $res.RelPermalink }}" integrity="{{ $res.Data.Integrity }}">
{{- else -}}
<link rel="stylesheet" href="{{ $res.RelPermalink }}">
{{- end -}}
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
{{- if ne .Site.Params.page.linkToMarkdown false | and (ne .Params.linkToMarkdown false) -}} {{- if ne .Site.Params.page.linkToMarkdown false | and (ne .Params.linkToMarkdown false) -}}
{{- with .OutputFormats.Get "markdown" -}} {{- with .OutputFormats.Get "markdown" -}}
<span> <span>
<a class="link-to-markdown" href="{{ .Permalink }}" target="_blank"> <a class="link-to-markdown" href="{{ .RelPermalink }}" target="_blank">
{{- T "seeMarkdown" -}} {{- T "seeMarkdown" -}}
</a> </a>
</span> </span>
...@@ -60,10 +60,10 @@ ...@@ -60,10 +60,10 @@
<div class="post-nav"> <div class="post-nav">
{{- if .PrevInSection -}} {{- if .PrevInSection -}}
<a href="{{ .PrevInSection.Permalink }}" class="prev" rel="prev" title="{{ .PrevInSection.Title }}"><i class="fas fa-angle-left fa-fw"></i>{{ .PrevInSection.Title }}</a> <a href="{{ .PrevInSection.RelPermalink }}" class="prev" rel="prev" title="{{ .PrevInSection.Title }}"><i class="fas fa-angle-left fa-fw"></i>{{ .PrevInSection.Title }}</a>
{{- end -}} {{- end -}}
{{ if .NextInSection }} {{ if .NextInSection }}
<a href="{{ .NextInSection.Permalink }}" class="next" rel="next" title="{{ .NextInSection.Title }}">{{ .NextInSection.Title }}<i class="fas fa-angle-right fa-fw"></i></a> <a href="{{ .NextInSection.RelPermalink }}" class="next" rel="next" title="{{ .NextInSection.Title }}">{{ .NextInSection.Title }}<i class="fas fa-angle-right fa-fw"></i></a>
{{- end -}} {{- end -}}
</div> </div>
</div> </div>
...@@ -12,9 +12,8 @@ ...@@ -12,9 +12,8 @@
{{- $author := .Params.author | default .Site.Author.name | default (T "author") -}} {{- $author := .Params.author | default .Site.Author.name | default (T "author") -}}
{{- $authorLink := .Params.authorLink | default .Site.Author.link | default (relLangURL "/") -}} {{- $authorLink := .Params.authorLink | default .Site.Author.link | default (relLangURL "/") -}}
<span class="post-author"> <span class="post-author">
<a class="author" href="{{ $authorLink }}" rel="author" target="_blank"> {{- $link := dict "class" "author" "href" $authorLink "title" "Author" "rel" "author" "icon" (dict "class" "fas fa-user-circle fa-fw") "content" $author -}}
<i class="fas fa-user-circle fa-fw"></i>{{ $author }} {{- partial "plugin/link.html" $link -}}
</a>
</span> </span>
{{- with .Params.categories -}} {{- with .Params.categories -}}
......
{{- define "title" -}} {{- define "title" -}}
{{- .Title }} | {{ T .Data.Singular | default (humanize .Data.Singular) }} | {{ .Site.Title -}} {{- .Title | humanize }} | {{ T .Data.Singular | default (humanize .Data.Singular) }} | {{ .Site.Title -}}
{{- end -}} {{- end -}}
{{- define "content" -}} {{- define "content" -}}
......
{{- define "title" -}} {{- define "title" -}}
{{- T "all" | humanize }}{{ T .Data.Plural | default .Data.Plural | humanize }} | {{ .Site.Title -}} {{- T "all" }}{{ T .Data.Plural | default (humanize .Data.Plural) }} | {{ .Site.Title -}}
{{- end -}} {{- end -}}
{{- define "content" -}} {{- define "content" -}}
...@@ -23,20 +23,20 @@ ...@@ -23,20 +23,20 @@
<div class="card-item"> <div class="card-item">
<div class="card-item-wrapper"> <div class="card-item-wrapper">
<h3 class="card-item-title"> <h3 class="card-item-title">
<a href="{{ .Permalink }}"> <a href="{{ .RelPermalink }}">
<i class="far fa-folder fa-fw"></i>&nbsp;{{ $term | humanize}} <i class="far fa-folder fa-fw"></i>&nbsp;{{ $term | humanize}}
</a> </a>
</h3> </h3>
{{- range first 5 $pages -}} {{- range first 5 $pages -}}
<article class="archive-item"> <article class="archive-item">
<a href="{{ .Permalink }}" class="archive-item-link"> <a href="{{ .RelPermalink }}" class="archive-item-link">
{{- .Title -}} {{- .Title -}}
</a> </a>
</article> </article>
{{- end -}} {{- end -}}
{{- if gt (len $pages) 5 -}} {{- if gt (len $pages) 5 -}}
<span class="more-post"> <span class="more-post">
<a href="{{ .Permalink }}" class="more-single-link">{{ T "more" }} >></a> <a href="{{ .RelPermalink }}" class="more-single-link">{{ T "more" }} >></a>
</span> </span>
{{- end -}} {{- end -}}
</div> </div>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
{{- else if eq $taxonomies "tags" -}} {{- else if eq $taxonomies "tags" -}}
<div class="tag-cloud-tags"> <div class="tag-cloud-tags">
{{- range $.Site.Taxonomies.tags.ByCount -}} {{- range $.Site.Taxonomies.tags.ByCount -}}
<a href="{{ .Page.Permalink }}"> {{ .Page.Title }} <small>({{ .Count }})</small></a> <a href="{{ .Page.RelPermalink }}"> {{ .Page.Title }} <small>({{ .Count }})</small></a>
{{- end -}} {{- end -}}
</div> </div>
{{- end -}} {{- end -}}
......
{ {
"name": "loveit-src", "name": "loveit-src",
"version": "0.1.0", "version": "0.1.1",
"description": "LoveIt theme source file", "description": "LoveIt theme source file",
"main": "index.js", "main": "index.js",
"dependencies": {}, "dependencies": {},
......
{"Target":"css/style.min.8596c27951d415c1b2ad9aee1d642e8057049327eca5ce9e397bdd27d84ca62a.css","MediaType":"text/css","Data":{"Integrity":"sha256-hZbCeVHUFcGyrZruHWQugFcEkyfspc6eOXvdJ9hMpio="}}
\ No newline at end of file
{"Target":"css/style.min.css","MediaType":"text/css","Data":{}}
\ No newline at end of file
{"Target":"lib/aplayer/dark.css","MediaType":"text/css","Data":{}}
\ No newline at end of file
{"Target":"lib/aplayer/dark.cf3d10211c52ef53113d7dc3ab708c366141ee4459043a50b02215bc8a2ef76a.css","MediaType":"text/css","Data":{"Integrity":"sha256-zz0QIRxS71MRPX3Dq3CMNmFB7kRZBDpQsCIVvIou92o="}}
\ No newline at end of file
{"Target":"lib/mermaid/mermaid.css","MediaType":"text/css","Data":{}}
\ No newline at end of file
{"Target":"lib/mermaid/mermaid.828bd139deac55c048b4d9ed77d849196aada4a0ea2268d7c59946e8d71665b7.css","MediaType":"text/css","Data":{"Integrity":"sha256-govROd6sVcBItNntd9hJGWqtpKDqImjXxZlG6NcWZbc="}}
\ No newline at end of file
.dark-theme .v *,.dark-theme .v .vwrap input,.dark-theme .v .vwrap input::placeholder,.dark-theme .v .veditor,.dark-theme .v .veditor::placeholder,.dark-theme .v a,.dark-theme .v a:hover{color:rgba(255,255,255,0.75);opacity:1}.dark-theme .v .vbtn{color:rgba(255,255,255,0.75);background:#333;border:none}.dark-theme .v .vbtn:hover{color:#3090e4;border-color:#3090e4}.dark-theme .v .vlist .vcard .vhead .vsys{background:#333}.dark-theme .v code,.dark-theme .v pre{background:#272C34}.v code,.v pre{text-align:left}
/*# sourceMappingURL=dark.css.map */
\ No newline at end of file
{"Target":"lib/valine/dark.css","MediaType":"text/css","Data":{}}
\ No newline at end of file
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
for (let num = 1; num <= 6; num++) { for (let num = 1; num <= 6; num++) {
this.util.forEach(document.querySelectorAll('.page.single .content > h' + num), (header) => { this.util.forEach(document.querySelectorAll('.page.single .content > h' + num), (header) => {
header.classList.add('headerLink'); header.classList.add('headerLink');
header.innerHTML = `<a href="#${header.id}"></a>${header.innerHTML}`; header.innerHTML = `<a href="#${header.id}" class="header-mark"></a>${header.innerHTML}`;
}); });
} }
} }
...@@ -119,7 +119,7 @@ ...@@ -119,7 +119,7 @@
} }
const toc = document.getElementById('toc-auto'); const toc = document.getElementById('toc-auto');
const page = document.getElementsByClassName('page')[0]; const page = document.getElementsByClassName('page')[0];
toc.style.maxWidth = `${page.getBoundingClientRect().left - 40}px`; toc.style.maxWidth = `${page.getBoundingClientRect().left - 20}px`;
this._tocLinks = this._tocLinks || tocCore.getElementsByTagName('a'); this._tocLinks = this._tocLinks || tocCore.getElementsByTagName('a');
this._tocLis = this._tocLis || tocCore.getElementsByTagName('li'); this._tocLis = this._tocLis || tocCore.getElementsByTagName('li');
this._headerLinks = this._headerLinks || document.getElementsByClassName('headerLink') || []; this._headerLinks = this._headerLinks || document.getElementsByClassName('headerLink') || [];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册