mirror of
https://git.adityakumar.xyz/hugo-theme-even.git
synced 2024-11-09 14:59:45 +00:00
parent
5ec874d64e
commit
5e2df2d9db
12 changed files with 28 additions and 26 deletions
|
@ -47,7 +47,7 @@ $ git clone https://github.com/olOwOlo/hugo-theme-even themes/even
|
||||||
```bash
|
```bash
|
||||||
cd ./themes/even/src/
|
cd ./themes/even/src/
|
||||||
npm install
|
npm install
|
||||||
npm start
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
|
@ -47,7 +47,7 @@ if you change any file under `/src/`, you need to rebuild.
|
||||||
```bash
|
```bash
|
||||||
cd ./themes/even/src/
|
cd ./themes/even/src/
|
||||||
npm install
|
npm install
|
||||||
npm start
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
|
@ -20,14 +20,14 @@
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{{ if .Site.Params.busuanzi.enable -}}
|
{{ if .Site.Params.busuanzi.enable -}}
|
||||||
<div class="busuanzi-footer">
|
<div class="busuanzi-footer">
|
||||||
{{ $spinner := "img/spinner.svg" | relURL -}}
|
{{ $spinner := "img/spinner.svg" | relURL -}}
|
||||||
{{ if and .Site.Params.busuanzi.enable .Site.Params.busuanzi.sitePV -}}
|
{{ if and .Site.Params.busuanzi.enable .Site.Params.busuanzi.sitePV -}}
|
||||||
{{ $valueSpan := printf `<span id="busuanzi_value_site_pv"><img src="%s" alt="spinner.svg"/></span>` $spinner -}}
|
{{ $valueSpan := printf `<span id="busuanzi_value_site_pv"><img src="%s" alt="spinner.svg"/></span>` $spinner -}}
|
||||||
<span id="busuanzi_container_site_pv"> {{ printf $lang.traffic.sitePV $valueSpan | safeHTML }} </span>
|
<span id="busuanzi_container_site_pv"> {{ printf $lang.traffic.sitePV $valueSpan | safeHTML }} </span>
|
||||||
{{ if .Site.Params.busuanzi.siteUV }}<span class="division">|</span>{{ end }}
|
{{ if .Site.Params.busuanzi.siteUV }}<span class="division">|</span>{{ end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{ if and .Site.Params.busuanzi.enable .Site.Params.busuanzi.siteUV -}}
|
{{ if and .Site.Params.busuanzi.enable .Site.Params.busuanzi.siteUV -}}
|
||||||
{{ $valueSpan := printf `<span id="busuanzi_value_site_uv"><img src="%s" alt="spinner.svg"/></span>` $spinner -}}
|
{{ $valueSpan := printf `<span id="busuanzi_value_site_uv"><img src="%s" alt="spinner.svg"/></span>` $spinner -}}
|
||||||
<span id="busuanzi_container_site_uv"> {{ printf $lang.traffic.siteUV $valueSpan | safeHTML }} </span>
|
<span id="busuanzi_container_site_uv"> {{ printf $lang.traffic.siteUV $valueSpan | safeHTML }} </span>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
<!-- Styles -->
|
<!-- Styles -->
|
||||||
<link href="{{ "dist/even.min.css?v=2.7.0" | relURL }}" rel="stylesheet">
|
<link href="{{ "dist/even.min.css?v=2.7.1" | relURL }}" rel="stylesheet">
|
||||||
{{ if .Site.Params.bootcdn -}}
|
{{ if .Site.Params.bootcdn -}}
|
||||||
{{ if .Site.Params.fancybox }}<link href="https://cdn.bootcss.com/fancybox/3.1.20/jquery.fancybox.min.css" rel="stylesheet" crossorigin="anonymous">{{ end }}
|
{{ if .Site.Params.fancybox }}<link href="https://cdn.bootcss.com/fancybox/3.1.20/jquery.fancybox.min.css" rel="stylesheet" crossorigin="anonymous">{{ end }}
|
||||||
{{- else if .Site.Params.publicCDN.enable -}}
|
{{- else if .Site.Params.publicCDN.enable -}}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
<script type="text/javascript" src="{{ "lib/slideout/slideout-1.0.1.min.js" | relURL }}"></script>
|
<script type="text/javascript" src="{{ "lib/slideout/slideout-1.0.1.min.js" | relURL }}"></script>
|
||||||
{{ if .Site.Params.fancybox }}<script type="text/javascript" src="{{ "lib/fancybox/jquery.fancybox-3.1.20.min.js" | relURL }}"></script>{{ end }}
|
{{ if .Site.Params.fancybox }}<script type="text/javascript" src="{{ "lib/fancybox/jquery.fancybox-3.1.20.min.js" | relURL }}"></script>{{ end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
<script type="text/javascript" src="{{ "dist/even.min.js?v=2.7.0" | relURL }}"></script>
|
<script type="text/javascript" src="{{ "dist/even.min.js?v=2.7.1" | relURL }}"></script>
|
||||||
|
|
||||||
{{- if and (or .Params.mathjax (and .Site.Params.mathjax (ne .Params.mathjax false))) (or .IsPage .IsHome) }}
|
{{- if and (or .Params.mathjax (and .Site.Params.mathjax (ne .Params.mathjax false))) (or .IsPage .IsHome) }}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
|
@ -144,7 +144,8 @@ Even.highlight = function () {
|
||||||
for (let i = 0; i < blocks.length; i++) {
|
for (let i = 0; i < blocks.length; i++) {
|
||||||
const block = blocks[i]
|
const block = blocks[i]
|
||||||
const rootElement = block.parentElement
|
const rootElement = block.parentElement
|
||||||
const lineCodes = block.innerHTML.split(/\n/).slice(0, -1)
|
const lineCodes = block.innerHTML.split(/\n/)
|
||||||
|
if (lineCodes[lineCodes.length - 1] === '') lineCodes.pop()
|
||||||
const lineLength = lineCodes.length
|
const lineLength = lineCodes.length
|
||||||
|
|
||||||
let codeLineHtml = ''
|
let codeLineHtml = ''
|
||||||
|
|
|
@ -1,30 +1,31 @@
|
||||||
{
|
{
|
||||||
"name": "even-src",
|
"name": "even-src",
|
||||||
"version": "2.7.0",
|
"version": "2.7.1",
|
||||||
"description": "even source file",
|
"description": "even source file",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "webpack"
|
"start": "webpack",
|
||||||
|
"build": "webpack"
|
||||||
},
|
},
|
||||||
"author": "ahonn, olOwOlo",
|
"author": "ahonn, olOwOlo",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"autoprefixer": "^7.1.5",
|
"autoprefixer": "^7.2.4",
|
||||||
"babel-core": "^6.26.0",
|
"babel-core": "^6.26.0",
|
||||||
"babel-loader": "^7.1.2",
|
"babel-loader": "^7.1.2",
|
||||||
"babel-plugin-transform-runtime": "^6.23.0",
|
"babel-plugin-transform-runtime": "^6.23.0",
|
||||||
"babel-preset-es2015": "^6.24.1",
|
"babel-preset-es2015": "^6.24.1",
|
||||||
"babel-preset-stage-2": "^6.24.1",
|
"babel-preset-stage-2": "^6.24.1",
|
||||||
"css-loader": "^0.28.5",
|
"css-loader": "^0.28.8",
|
||||||
"expose-loader": "^0.7.3",
|
"expose-loader": "^0.7.4",
|
||||||
"extract-text-webpack-plugin": "^3.0.0",
|
"extract-text-webpack-plugin": "^3.0.2",
|
||||||
"file-loader": "^0.11.2",
|
"file-loader": "^1.1.6",
|
||||||
"node-sass": "^4.5.3",
|
"node-sass": "^4.7.2",
|
||||||
"postcss-loader": "^2.0.7",
|
"postcss-loader": "^2.0.10",
|
||||||
"sass-loader": "^6.0.6",
|
"sass-loader": "^6.0.6",
|
||||||
"style-loader": "^0.18.2",
|
"style-loader": "^0.19.1",
|
||||||
"uglifyjs-webpack-plugin": "^0.4.6",
|
"uglifyjs-webpack-plugin": "^1.1.6",
|
||||||
"url-loader": "^0.5.9",
|
"url-loader": "^0.6.2",
|
||||||
"webpack": "^3.7.1"
|
"webpack": "^3.10.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const ExtractTextPlugin = require("extract-text-webpack-plugin")
|
const ExtractTextPlugin = require('extract-text-webpack-plugin')
|
||||||
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
|
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
|
||||||
|
|
||||||
const extractSass = new ExtractTextPlugin({
|
const extractSass = new ExtractTextPlugin({
|
||||||
|
@ -18,7 +18,7 @@ module.exports = {
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
test: /\.js$/,
|
test: /\.js$/,
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
loader: 'babel-loader'
|
loader: 'babel-loader'
|
||||||
},
|
},
|
||||||
|
|
2
static/dist/even.min.css
vendored
2
static/dist/even.min.css
vendored
File diff suppressed because one or more lines are too long
2
static/dist/even.min.css.map
vendored
2
static/dist/even.min.css.map
vendored
File diff suppressed because one or more lines are too long
2
static/dist/even.min.js
vendored
2
static/dist/even.min.js
vendored
|
@ -1,2 +1,2 @@
|
||||||
!function(e){function n(o){if(t[o])return t[o].exports;var c=t[o]={i:o,l:!1,exports:{}};return e[o].call(c.exports,c,c.exports,n),c.l=!0,c.exports}var t={};n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:o})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=0)}([function(e,n,t){"use strict";var o=t(1);t(2),$(document).ready(function(){o.Even.backToTop(),o.Even.mobileNavbar(),o.Even.toc(),o.Even.fancybox()}),hljs.initHighlighting(),o.Even.highlight()},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o={};o.backToTop=function(){var e=$("#back-to-top");$(window).scroll(function(){$(window).scrollTop()>100?e.fadeIn(1e3):e.fadeOut(1e3)}),e.click(function(){$("body,html").animate({scrollTop:0})})},o.mobileNavbar=function(){var e=$("#mobile-navbar"),n=$(".mobile-navbar-icon"),t=new Slideout({panel:document.getElementById("mobile-panel"),menu:document.getElementById("mobile-menu"),padding:180,tolerance:70});t.disableTouch(),n.click(function(){t.toggle()}),t.on("beforeopen",function(){e.addClass("fixed-open"),n.addClass("icon-click").removeClass("icon-out")}),t.on("beforeclose",function(){e.removeClass("fixed-open"),n.addClass("icon-out").removeClass("icon-click")}),$("#mobile-panel").on("touchend",function(){t.isOpen()&&n.click()})},o._initToc=function(){var e=$(".post-toc"),n=$(".post-footer");if(e.length){var t=e.offset().top-20,o=n.offset().top-e.height()-20,c={start:{position:"absolute",top:t},process:{position:"fixed",top:20},end:{position:"absolute",top:o}};$(window).scroll(function(){var n=$(window).scrollTop();n<t?e.css(c.start):n>o?e.css(c.end):e.css(c.process)})}var i=$(".toc-link"),r=$(".headerlink"),a=$(".post-toc-content li"),l=$.map(r,function(e){return $(e).offset().top}),s=$.map(l,function(e){return e-30}),d=function(e,n){for(var t=0;t<e.length-1;t++)if(n>e[t]&&n<=e[t+1])return t;return n>e[e.length-1]?e.length-1:-1};$(window).scroll(function(){var e=$(window).scrollTop(),n=d(s,e);if($(i).removeClass("active"),$(a).removeClass("has-active"),-1!==n){$(i[n]).addClass("active");for(var t=i[n].parentNode;"NAV"!==t.tagName;)$(t).addClass("has-active"),t=t.parentNode.parentNode}})},o.fancybox=function(){$.fancybox&&($(".post-content").each(function(){$(this).find("img").each(function(){$(this).wrap('<a class="fancybox" href="'+this.src+'" data-fancybox="gallery" data-caption="'+this.title+'"></a>')})}),$(".fancybox").fancybox({selector:".fancybox",protect:!0}))},o.highlight=function(){for(var e=document.querySelectorAll("pre code"),n=0;n<e.length;n++){for(var t=e[n],o=t.parentElement,c=t.innerHTML.split(/\n/).slice(0,-1),i=c.length,r="",a=0;a<i;a++)r+='<div class="line">'+(a+1)+"</div>";for(var l="",s=0;s<i;s++)l+='<div class="line">'+c[s]+"</div>";t.className+=" highlight";var d=document.createElement("figure");d.className=t.className,d.innerHTML='<table><tbody><tr><td class="gutter"><pre>'+r+'</pre></td><td class="code"><pre>'+l+"</pre></td></tr></tbody></table>",o.parentElement.replaceChild(d,o)}},o.toc=function(){var e=document.getElementById("post-toc");if(null!==e){var n=document.getElementById("TableOfContents");null===n?e.parentNode.removeChild(e):(this._refactorToc(n),this._linkToc(),this._initToc())}},o._refactorToc=function(e){for(var n=e.children[0],t=n,o=void 0;1===t.children.length&&"UL"===(o=t.children[0].children[0]).tagName;)t=o;t!==n&&e.replaceChild(t,n)},o._linkToc=function(){for(var e=document.querySelectorAll("#TableOfContents a"),n=0;n<e.length;n++)e[n].className+=" toc-link";for(var t=1;t<=6;t++)for(var o=document.querySelectorAll(".post-content>h"+t),c=0;c<o.length;c++){var i=o[c];i.innerHTML='<a href="#'+i.id+'" class="headerlink" title="'+i.innerHTML+'"></a>'+i.innerHTML}},n.Even=o},function(e,n){}]);
|
!function(e){var n={};function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=0)}([function(e,n,t){"use strict";var o=t(1);t(2),$(document).ready(function(){o.Even.backToTop(),o.Even.mobileNavbar(),o.Even.toc(),o.Even.fancybox()}),hljs.initHighlighting(),o.Even.highlight()},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o={};o.backToTop=function(){var e=$("#back-to-top");$(window).scroll(function(){$(window).scrollTop()>100?e.fadeIn(1e3):e.fadeOut(1e3)}),e.click(function(){$("body,html").animate({scrollTop:0})})},o.mobileNavbar=function(){var e=$("#mobile-navbar"),n=$(".mobile-navbar-icon"),t=new Slideout({panel:document.getElementById("mobile-panel"),menu:document.getElementById("mobile-menu"),padding:180,tolerance:70});t.disableTouch(),n.click(function(){t.toggle()}),t.on("beforeopen",function(){e.addClass("fixed-open"),n.addClass("icon-click").removeClass("icon-out")}),t.on("beforeclose",function(){e.removeClass("fixed-open"),n.addClass("icon-out").removeClass("icon-click")}),$("#mobile-panel").on("touchend",function(){t.isOpen()&&n.click()})},o._initToc=function(){var e=$(".post-toc"),n=$(".post-footer");if(e.length){var t=e.offset().top-20,o=n.offset().top-e.height()-20,r={start:{position:"absolute",top:t},process:{position:"fixed",top:20},end:{position:"absolute",top:o}};$(window).scroll(function(){var n=$(window).scrollTop();n<t?e.css(r.start):n>o?e.css(r.end):e.css(r.process)})}var c=$(".toc-link"),i=$(".headerlink"),a=$(".post-toc-content li"),l=$.map(i,function(e){return $(e).offset().top}),s=$.map(l,function(e){return e-30});$(window).scroll(function(){var e=$(window).scrollTop(),n=function(e,n){for(var t=0;t<e.length-1;t++)if(n>e[t]&&n<=e[t+1])return t;return n>e[e.length-1]?e.length-1:-1}(s,e);if($(c).removeClass("active"),$(a).removeClass("has-active"),-1!==n){$(c[n]).addClass("active");for(var t=c[n].parentNode;"NAV"!==t.tagName;)$(t).addClass("has-active"),t=t.parentNode.parentNode}})},o.fancybox=function(){$.fancybox&&($(".post-content").each(function(){$(this).find("img").each(function(){$(this).wrap('<a class="fancybox" href="'+this.src+'" data-fancybox="gallery" data-caption="'+this.title+'"></a>')})}),$(".fancybox").fancybox({selector:".fancybox",protect:!0}))},o.highlight=function(){for(var e=document.querySelectorAll("pre code"),n=0;n<e.length;n++){var t=e[n],o=t.parentElement,r=t.innerHTML.split(/\n/);""===r[r.length-1]&&r.pop();for(var c=r.length,i="",a=0;a<c;a++)i+='<div class="line">'+(a+1)+"</div>";for(var l="",s=0;s<c;s++)l+='<div class="line">'+r[s]+"</div>";t.className+=" highlight";var d=document.createElement("figure");d.className=t.className,d.innerHTML='<table><tbody><tr><td class="gutter"><pre>'+i+'</pre></td><td class="code"><pre>'+l+"</pre></td></tr></tbody></table>",o.parentElement.replaceChild(d,o)}},o.toc=function(){var e=document.getElementById("post-toc");if(null!==e){var n=document.getElementById("TableOfContents");null===n?e.parentNode.removeChild(e):(this._refactorToc(n),this._linkToc(),this._initToc())}},o._refactorToc=function(e){for(var n=e.children[0],t=n,o=void 0;1===t.children.length&&"UL"===(o=t.children[0].children[0]).tagName;)t=o;t!==n&&e.replaceChild(t,n)},o._linkToc=function(){for(var e=document.querySelectorAll("#TableOfContents a"),n=0;n<e.length;n++)e[n].className+=" toc-link";for(var t=1;t<=6;t++)for(var o=document.querySelectorAll(".post-content>h"+t),r=0;r<o.length;r++){var c=o[r];c.innerHTML='<a href="#'+c.id+'" class="headerlink" title="'+c.innerHTML+'"></a>'+c.innerHTML}},n.Even=o},function(e,n){}]);
|
||||||
//# sourceMappingURL=even.min.js.map
|
//# sourceMappingURL=even.min.js.map
|
2
static/dist/even.min.js.map
vendored
2
static/dist/even.min.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue