mirror of
https://git.adityakumar.xyz/hugo-theme-even.git
synced 2024-11-09 14:59:45 +00:00
refactor: move theme version param to template
delete version param in config.toml even.[version].css => even.min.css?v=[version] even.[version].js => even.min.js?v=[version] It's more convenient for users to update this theme.
This commit is contained in:
parent
6c4998a108
commit
6a66b73a43
10 changed files with 16 additions and 20 deletions
|
@ -42,12 +42,11 @@ copyright = "" # default: author.name ↓ # 默认为下面配
|
|||
url = "/categories/"
|
||||
|
||||
[params]
|
||||
version = "2.5.0" # theme version, don't change it! # 请勿更改
|
||||
since = "2017" # Site creation time # 站点建立时间
|
||||
|
||||
# site info (option) # 站点信息(可选)
|
||||
keywords = ["olOwOlo", "blog"]
|
||||
description = "olOwOlo blog."
|
||||
keywords = ["Hugo", "theme","even"]
|
||||
description = "Hugo theme even example site."
|
||||
|
||||
# paginate of archives, tags and categories # 归档、标签、分类每页显示的文章数目
|
||||
archive-paginate = 3
|
||||
|
|
|
@ -51,8 +51,7 @@
|
|||
<link rel="mask-icon" href="{{ "safari-pinned-tab.svg" | relURL }}" color="#5bbad5">
|
||||
|
||||
<!-- Styles -->
|
||||
{{ $themeVersion := .Site.Params.version }}
|
||||
<link href="{{ relURL (printf "dist/even.v%s.css" $themeVersion) }}" rel="stylesheet">
|
||||
<link href="{{ "dist/even.min.css?v=2.5.0" | relURL }}" rel="stylesheet">
|
||||
{{ if .Site.Params.bootcdn -}}
|
||||
{{ if .Site.Params.fancybox }}<link href="https://cdn.bootcss.com/fancybox/3.1.20/jquery.fancybox.min.css" rel="stylesheet">{{ end }}
|
||||
{{ else -}}
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
<!-- js -->
|
||||
{{ $themeVersion := .Site.Params.version }}
|
||||
<script src="{{ "lib/highlight/highlight.pack.js" | relURL }}"></script>
|
||||
{{ if .Site.Params.bootcdn -}}
|
||||
<!-- script src="https://cdn.bootcss.com/highlight.js/9.12.0/highlight.min.js"></script -->
|
||||
<script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="https://cdn.bootcss.com/slideout/1.0.1/slideout.min.js"></script>
|
||||
{{ if .Site.Params.fancybox }}<script type="text/javascript" src="https://cdn.bootcss.com/fancybox/3.1.20/jquery.fancybox.min.js"></script>{{ end }}
|
||||
<script type="text/javascript" src="{{ relURL (printf "dist/even.v%s.js" $themeVersion) }}"></script>
|
||||
{{ else -}}
|
||||
<script type="text/javascript" src="{{ "lib/jquery/jquery-3.2.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 }}
|
||||
<script type="text/javascript" src="{{ relURL (printf "dist/even.v%s.js" $themeVersion) }}"></script>
|
||||
{{- end }}
|
||||
<script type="text/javascript" src="{{ "dist/even.min.js?v=2.5.0" | relURL }}"></script>
|
||||
|
||||
{{ if and (and .Site.Params.mathjax (ne .Params.mathjax false)) (or .IsPage .IsHome) -}}
|
||||
<script async src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-MML-AM_CHTML'></script>
|
||||
|
|
|
@ -2,11 +2,8 @@ const path = require('path');
|
|||
const ExtractTextPlugin = require("extract-text-webpack-plugin");
|
||||
const UglifyJSPlugin = require('uglifyjs-webpack-plugin')
|
||||
|
||||
// theme version
|
||||
const version = 'v2.5.0'
|
||||
|
||||
const extractSass = new ExtractTextPlugin({
|
||||
filename: `even.${version}.css`
|
||||
filename: `even.min.css`
|
||||
});
|
||||
|
||||
module.exports = {
|
||||
|
@ -16,7 +13,7 @@ module.exports = {
|
|||
},
|
||||
output: {
|
||||
path: path.join(__dirname, '../static/dist'),
|
||||
filename: `[name].${version}.js`
|
||||
filename: `[name].min.js`
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
|
@ -31,10 +28,14 @@ module.exports = {
|
|||
use: [{
|
||||
loader: 'css-loader',
|
||||
options: {
|
||||
minimize: true
|
||||
minimize: true,
|
||||
sourceMap: true
|
||||
}
|
||||
}, {
|
||||
loader: 'sass-loader'
|
||||
loader: 'sass-loader',
|
||||
options: {
|
||||
sourceMap: true
|
||||
}
|
||||
}],
|
||||
fallback: 'style-loader'
|
||||
})
|
||||
|
|
File diff suppressed because one or more lines are too long
1
static/dist/even.min.css.map
vendored
Normal file
1
static/dist/even.min.css.map
vendored
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,2 +1,2 @@
|
|||
!function(e){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}var n={};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,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";var o=n(1);n(2),hljs.initHighlighting(),o.Even.highlight(),$(document).ready(function(){o.Even.backToTop(),o.Even.mobileNavbar(),o.Even.beforeToc(),o.Even.toc(),o.Even.fancybox()})},function(e,t,n){"use strict";Object.defineProperty(t,"__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"),t=$(".mobile-navbar-icon"),n=new Slideout({panel:document.getElementById("mobile-panel"),menu:document.getElementById("mobile-menu"),padding:180,tolerance:70});n.disableTouch(),t.click(function(){n.toggle()}),n.on("beforeopen",function(){e.addClass("fixed-open"),t.addClass("icon-click").removeClass("icon-out")}),n.on("beforeclose",function(){e.removeClass("fixed-open"),t.addClass("icon-out").removeClass("icon-click")}),$("#mobile-panel").on("touchend",function(){n.isOpen()&&t.click()})},o.toc=function(){var e=$(".post-toc"),t=$(".post-footer");if(e.length){var n=e.offset().top-20,o=t.offset().top-e.height()-20,r={start:{position:"absolute",top:n},process:{position:"fixed",top:20},end:{position:"absolute",top:o}};$(window).scroll(function(){var t=$(window).scrollTop();t<n?e.css(r.start):t>o?e.css(r.end):e.css(r.process)})}var i=$(".toc-link"),l=$(".headerlink"),a=$.map(l,function(e){return $(e).offset().top});$(window).scroll(function(){for(var e=$(window).scrollTop(),t=0;t<i.length;t++){var n=t+1===i.length,o=a[t]-30,r=n?1/0:a[t+1]-30;o<e&&e<=r?$(i[t]).addClass("active"):$(i[t]).removeClass("active")}})},o.fancybox=function(){$.fancybox&&($(".post").each(function(){$(this).find("img").each(function(){$(this).wrap('<a class="fancybox" href="'+this.src+'" title="'+this.alt+'"></a>')})}),$(".fancybox").fancybox({openEffect:"elastic",closeEffect:"elastic"}))},o.highlight=function(){var e=document.querySelectorAll("pre code"),t=!0,n=!1,o=void 0;try{for(var r,i=e[Symbol.iterator]();!(t=(r=i.next()).done);t=!0){for(var l=r.value,a=l.classList,c=l.parentElement,s=l.innerHTML.split(/\n/).slice(0,-1),f=s.length,u="",d=0;d<f;d++)u+='<div class="line">'+(d+1)+"</div>";var v="",p=!0,h=!1,b=void 0;try{for(var y,m=s[Symbol.iterator]();!(p=(y=m.next()).done);p=!0){v+='<div class="line">'+y.value+"</div>"}}catch(e){h=!0,b=e}finally{try{!p&&m.return&&m.return()}finally{if(h)throw b}}a.add("highlight");var g=document.createElement("figure");g.classList=a,g.innerHTML='<table><tbody><tr><td class="gutter"><pre>'+u+'</pre></td><td class="code"><pre>'+v+"</pre></td></tr></tbody></table>",c.parentElement.replaceChild(g,c)}}catch(e){n=!0,o=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw o}}},o.beforeToc=function(){var e=document.querySelectorAll("#TableOfContents a"),t=!0,n=!1,o=void 0;try{for(var r,i=e[Symbol.iterator]();!(t=(r=i.next()).done);t=!0){r.value.classList.add("toc-link")}}catch(e){n=!0,o=e}finally{try{!t&&i.return&&i.return()}finally{if(n)throw o}}for(var l=[1,2,3,4,5,6],a=0;a<l.length;a++){var c=l[a],s=document.querySelectorAll(".post-content>h"+c),f=!0,u=!1,d=void 0;try{for(var v,p=s[Symbol.iterator]();!(f=(v=p.next()).done);f=!0){var h=v.value;h.innerHTML='<a href="#'+h.id+'" class="headerlink" title="'+h.innerHTML+'"></a>'+h.innerHTML}}catch(e){u=!0,d=e}finally{try{!f&&p.return&&p.return()}finally{if(u)throw d}}}},t.Even=o},function(e,t){}]);
|
||||
//# sourceMappingURL=even.v2.5.0.js.map
|
||||
//# sourceMappingURL=even.min.js.map
|
1
static/dist/even.min.js.map
vendored
Normal file
1
static/dist/even.min.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
static/dist/even.v2.5.0.css.map
vendored
1
static/dist/even.v2.5.0.css.map
vendored
|
@ -1 +0,0 @@
|
|||
{"version":3,"sources":[],"names":[],"mappings":"","file":"even.v2.5.0.css","sourceRoot":""}
|
1
static/dist/even.v2.5.0.js.map
vendored
1
static/dist/even.v2.5.0.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue