diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 109b1dfd..3e6cf7e0 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -40,6 +40,9 @@ Please fill the template below **Expected behavior**: +**Repo/Source where this issue can be reproduced**: + + **Screenshots** diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 2da8f8f2..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: Build - -on: - pull_request: - branches: - - master - - exampleSite - workflow_dispatch: - # manual run - inputs: - hugoVersion: - description: "Hugo Version" - required: false - default: "0.83.0" - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Git checkout - uses: actions/checkout@v2 - with: - ref: exampleSite - - - name: Get Theme - run: git submodule update --init --recursive - - - name: Update theme to Latest commit - run: git submodule update --remote --merge - - - name: Setup hugo - uses: peaceiris/actions-hugo@v2 - with: - hugo-version: "${{ github.event.inputs.hugoVersion }}" - - - name: Build - run: hugo --buildDrafts --gc --verbose --minify diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 75033f82..305a6dec 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -1,4 +1,4 @@ -name: Build GH-Pages +name: Deploy Hugo PaperMod Demo to Pages on: push: @@ -17,31 +17,64 @@ on: required: false default: "0.83.0" +# Allow one concurrent deployment +concurrency: + group: "pages" + cancel-in-progress: true + +# Default to bash +defaults: + run: + shell: bash + +# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +permissions: + contents: read + pages: write + id-token: write + jobs: - deploy: + # Build job + build: runs-on: ubuntu-latest + env: + HUGO_VERSION: "0.83.0" steps: - - name: Git checkout - uses: actions/checkout@v2 + - name: Check version + if: ${{ github.event.inputs.hugoVersion }} + run: export HUGO_VERSION="${{ github.event.inputs.hugoVersion }}" + - name: Install Hugo CLI + run: | + wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.deb \ + && sudo dpkg -i ${{ runner.temp }}/hugo.deb + - name: Checkout + uses: actions/checkout@v3 with: ref: exampleSite - + - name: Setup Pages + id: pages + uses: actions/configure-pages@v1 - name: Get Theme run: git submodule update --init --recursive - - name: Update theme to Latest commit run: git submodule update --remote --merge - - - name: Setup hugo - uses: peaceiris/actions-hugo@v2 + - name: Build with Hugo + run: | + hugo \ + --buildDrafts --gc --verbose \ + --baseURL ${{ steps.pages.outputs.base_url }} + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 with: - hugo-version: "${{ github.event.inputs.hugoVersion }}" - - - name: Build - run: hugo --buildDrafts --gc --verbose --minify - - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.TOKEN }} - publish_dir: ./public + path: ./public + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 diff --git a/assets/css/common/header.css b/assets/css/common/header.css index 3cd070e8..64894da4 100644 --- a/assets/css/common/header.css +++ b/assets/css/common/header.css @@ -27,7 +27,7 @@ font-weight: 700; } -.logo a img { +.logo a img, .logo a svg { display: inline; vertical-align: middle; pointer-events: none; @@ -36,10 +36,6 @@ margin-inline-end: 8px; } -#theme-toggle svg { - height: 18px; -} - button#theme-toggle { font-size: 26px; margin: auto 4px; diff --git a/assets/css/common/post-single.css b/assets/css/common/post-single.css index 8573e470..f5deab1c 100644 --- a/assets/css/common/post-single.css +++ b/assets/css/common/post-single.css @@ -185,10 +185,6 @@ margin-bottom: 0; } -.post-content .highlighttable td .highlight pre code::-webkit-scrollbar { - display: none; -} - .post-content code { margin: auto 4px; padding: 4px 6px; @@ -340,17 +336,6 @@ margin-inline-end: 12px; } -.share-buttons a svg { - height: 30px; - width: 30px; - fill: currentColor; - transition: transform 0.1s; -} - -.share-buttons svg:active { - transform: scale(0.96); -} - h1:hover .anchor, h2:hover .anchor, h3:hover .anchor, @@ -364,28 +349,6 @@ h6:hover .anchor { user-select: none; } -.post-content :not(table) ::-webkit-scrollbar-thumb { - border: 2px solid var(--hljs-bg); - background: rgb(113, 113, 117); -} - -.post-content :not(table) ::-webkit-scrollbar-thumb:hover { - background: rgb(163, 163, 165); -} - -.gist table::-webkit-scrollbar-thumb { - border: 2px solid rgb(255, 255, 255); - background: rgb(173, 173, 173); -} - -.gist table::-webkit-scrollbar-thumb:hover { - background: rgb(112, 112, 112); -} - -.post-content table::-webkit-scrollbar-thumb { - border-width: 2px; -} - .paginav { margin: 10px 0; display: flex; @@ -426,4 +389,9 @@ h6:hover .anchor { h1>a>svg { display: inline; +} + +img.in-text { + display: inline; + margin: auto; } \ No newline at end of file diff --git a/assets/css/common/profile-mode.css b/assets/css/common/profile-mode.css index 6826d960..58f28198 100644 --- a/assets/css/common/profile-mode.css +++ b/assets/css/common/profile-mode.css @@ -17,7 +17,6 @@ .profile img { display: inline-table; border-radius: 50%; - pointer-events: none; } .buttons { diff --git a/assets/css/core/license.css b/assets/css/core/license.css new file mode 100644 index 00000000..8e81d229 --- /dev/null +++ b/assets/css/core/license.css @@ -0,0 +1,6 @@ +/* + PaperMod v6 + License: MIT https://github.com/adityatelange/hugo-PaperMod/blob/master/LICENSE + Copyright (c) 2020 nanxiaobei and adityatelange + Copyright (c) 2021-2022 adityatelange +*/ diff --git a/assets/css/core/reset.css b/assets/css/core/reset.css index dfb1caae..f509cf6e 100644 --- a/assets/css/core/reset.css +++ b/assets/css/core/reset.css @@ -114,25 +114,3 @@ img { display: block; max-width: 100%; } - -::-webkit-scrollbar-track { - background: 0 0; -} - -.list:not(.dark)::-webkit-scrollbar-track { - background: var(--code-bg); -} - -::-webkit-scrollbar-thumb { - background: var(--tertiary); - border: 5px solid var(--theme); - border-radius: var(--radius); -} - -.list:not(.dark)::-webkit-scrollbar-thumb { - border: 5px solid var(--code-bg); -} - -::-webkit-scrollbar-thumb:hover { - background: var(--secondary); -} diff --git a/assets/css/core/zmedia.css b/assets/css/core/zmedia.css index 1cc6c6e7..210d4863 100644 --- a/assets/css/core/zmedia.css +++ b/assets/css/core/zmedia.css @@ -29,14 +29,6 @@ } } -@media screen and (min-width: 768px) { - /* reset */ - ::-webkit-scrollbar { - width: 19px; - height: 11px; - } -} - /* footer */ @media screen and (max-width: 900px) { .list .top-link { @@ -48,7 +40,6 @@ /* terms; profile-mode; post-single; post-entry; post-entry; search; search */ .terms-tags a:active, .button:active, - .share-buttons svg:active, .post-entry:active, .top-link, #searchResults .focus, diff --git a/assets/css/includes/scroll-bar.css b/assets/css/includes/scroll-bar.css new file mode 100644 index 00000000..47405de2 --- /dev/null +++ b/assets/css/includes/scroll-bar.css @@ -0,0 +1,63 @@ +/* from reset */ +::-webkit-scrollbar-track { + background: 0 0; +} + +.list:not(.dark)::-webkit-scrollbar-track { + background: var(--code-bg); +} + +::-webkit-scrollbar-thumb { + background: var(--tertiary); + border: 5px solid var(--theme); + border-radius: var(--radius); +} + +.list:not(.dark)::-webkit-scrollbar-thumb { + border: 5px solid var(--code-bg); +} + +::-webkit-scrollbar-thumb:hover { + background: var(--secondary); +} + +::-webkit-scrollbar:not(.highlighttable, .highlight table, .gist .highlight) { + background: var(--theme); +} + +/* from post-single */ +.post-content .highlighttable td .highlight pre code::-webkit-scrollbar { + display: none; +} + +.post-content :not(table) ::-webkit-scrollbar-thumb { + border: 2px solid var(--hljs-bg); + background: rgb(113, 113, 117); +} + +.post-content :not(table) ::-webkit-scrollbar-thumb:hover { + background: rgb(163, 163, 165); +} + +.gist table::-webkit-scrollbar-thumb { + border: 2px solid rgb(255, 255, 255); + background: rgb(173, 173, 173); +} + +.gist table::-webkit-scrollbar-thumb:hover { + background: rgb(112, 112, 112); +} + +.post-content table::-webkit-scrollbar-thumb { + border-width: 2px; +} + +/* from zmedia */ +@media screen and (min-width: 768px) { + + /* reset */ + ::-webkit-scrollbar { + width: 19px; + height: 11px; + } +} \ No newline at end of file diff --git a/assets/js/fastsearch.js b/assets/js/fastsearch.js index ea110221..06ebcfba 100644 --- a/assets/js/fastsearch.js +++ b/assets/js/fastsearch.js @@ -1,21 +1,21 @@ import * as params from '@params'; -var fuse; // holds our search engine -var resList = document.getElementById('searchResults'); -var sInput = document.getElementById('searchInput'); -var first, last, current_elem = null -var resultsAvailable = false; +let fuse; // holds our search engine +let resList = document.getElementById('searchResults'); +let sInput = document.getElementById('searchInput'); +let first, last, current_elem = null +let resultsAvailable = false; // load our search index window.onload = function () { - var xhr = new XMLHttpRequest(); + let xhr = new XMLHttpRequest(); xhr.onreadystatechange = function () { if (xhr.readyState === 4) { if (xhr.status === 200) { - var data = JSON.parse(xhr.responseText); + let data = JSON.parse(xhr.responseText); if (data) { // fuse.js options; check fuse.js website for details - var options = { + let options = { distance: 100, threshold: 0.4, ignoreLocation: true, @@ -28,17 +28,17 @@ window.onload = function () { }; if (params.fuseOpts) { options = { - isCaseSensitive: params.fuseOpts.iscasesensitive ? params.fuseOpts.iscasesensitive : false, - includeScore: params.fuseOpts.includescore ? params.fuseOpts.includescore : false, - includeMatches: params.fuseOpts.includematches ? params.fuseOpts.includematches : false, - minMatchCharLength: params.fuseOpts.minmatchcharlength ? params.fuseOpts.minmatchcharlength : 1, - shouldSort: params.fuseOpts.shouldsort ? params.fuseOpts.shouldsort : true, - findAllMatches: params.fuseOpts.findallmatches ? params.fuseOpts.findallmatches : false, - keys: params.fuseOpts.keys ? params.fuseOpts.keys : ['title', 'permalink', 'summary', 'content'], - location: params.fuseOpts.location ? params.fuseOpts.location : 0, - threshold: params.fuseOpts.threshold ? params.fuseOpts.threshold : 0.4, - distance: params.fuseOpts.distance ? params.fuseOpts.distance : 100, - ignoreLocation: params.fuseOpts.ignorelocation ? params.fuseOpts.ignorelocation : true + isCaseSensitive: params.fuseOpts.iscasesensitive ?? false, + includeScore: params.fuseOpts.includescore ?? false, + includeMatches: params.fuseOpts.includematches ?? false, + minMatchCharLength: params.fuseOpts.minmatchcharlength ?? 1, + shouldSort: params.fuseOpts.shouldsort ?? true, + findAllMatches: params.fuseOpts.findallmatches ?? false, + keys: params.fuseOpts.keys ?? ['title', 'permalink', 'summary', 'content'], + location: params.fuseOpts.location ?? 0, + threshold: params.fuseOpts.threshold ?? 0.4, + distance: params.fuseOpts.distance ?? 100, + ignoreLocation: params.fuseOpts.ignorelocation ?? true } } fuse = new Fuse(data, options); // build the index from the json file @@ -106,12 +106,12 @@ sInput.addEventListener('search', function (e) { // kb bindings document.onkeydown = function (e) { let key = e.key; - var ae = document.activeElement; + let ae = document.activeElement; let inbox = document.getElementById("searchbox").contains(ae) if (ae === sInput) { - var elements = document.getElementsByClassName('focus'); + let elements = document.getElementsByClassName('focus'); while (elements.length > 0) { elements[0].classList.remove('focus'); } diff --git a/assets/js/fuse.basic.min.js b/assets/js/fuse.basic.min.js index 025c4457..89477c64 100644 --- a/assets/js/fuse.basic.min.js +++ b/assets/js/fuse.basic.min.js @@ -1,9 +1,9 @@ /** - * Fuse.js v6.5.3 - Lightweight fuzzy-search (http://fusejs.io) + * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io) * - * Copyright (c) 2021 Kiro Risk (http://kiro.me) + * Copyright (c) 2022 Kiro Risk (http://kiro.me) * All Rights Reserved. Apache Software License 2.0 * * http://www.apache.org/licenses/LICENSE-2.0 */ -var e,t;e=this,t=function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=new Map,r=Math.pow(10,t);return{get:function(t){var i=t.match(_).length;if(n.has(i))return n.get(i);var o=1/Math.pow(i,.5*e),a=parseFloat(Math.round(o*r)/r);return n.set(i,a),a},clear:function(){n.clear()}}}var O=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.getFn,i=void 0===n?L.getFn:n,o=t.fieldNormWeight,a=void 0===o?L.fieldNormWeight:o;r(this,e),this.norm=S(a,3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return o(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,u(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();u(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?L.getFn:r,o=n.fieldNormWeight,a=void 0===o?L.fieldNormWeight:o,c=new O({getFn:i,fieldNormWeight:a});return c.setKeys(e.map(k)),c.setSources(t),c.create(),c}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,a=t.expectedLocation,c=void 0===a?0:a,s=t.distance,h=void 0===s?L.distance:s,u=t.ignoreLocation,l=void 0===u?L.ignoreLocation:u,d=r/e.length;if(l)return d;var f=Math.abs(c-o);return h?d+f/h:f?1:d}function E(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L.minMatchCharLength,n=[],r=-1,i=-1,o=0,a=e.length;o=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}var I=32;function C(e){for(var t={},n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,a=void 0===o?L.location:o,c=i.threshold,s=void 0===c?L.threshold:c,h=i.distance,u=void 0===h?L.distance:h,l=i.includeMatches,d=void 0===l?L.includeMatches:l,f=i.findAllMatches,v=void 0===f?L.findAllMatches:f,g=i.minMatchCharLength,y=void 0===g?L.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?L.isCaseSensitive:p,b=i.ignoreLocation,k=void 0===b?L.ignoreLocation:b;if(r(this,e),this.options={location:a,threshold:s,distance:u,includeMatches:d,findAllMatches:v,minMatchCharLength:y,isCaseSensitive:m,ignoreLocation:k},this.pattern=m?t:t.toLowerCase(),this.chunks=[],this.pattern.length){var M=function(e,t){n.chunks.push({pattern:e,alphabet:C(e),startIndex:t})},w=this.pattern.length;if(w>I){for(var x=0,_=w%I,S=w-_;x3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?L.location:i,a=r.distance,c=void 0===a?L.distance:a,s=r.threshold,h=void 0===s?L.threshold:s,u=r.findAllMatches,l=void 0===u?L.findAllMatches:u,d=r.minMatchCharLength,f=void 0===d?L.minMatchCharLength:d,v=r.includeMatches,g=void 0===v?L.includeMatches:v,y=r.ignoreLocation,m=void 0===y?L.ignoreLocation:y;if(t.length>I)throw new Error(p(I));for(var b,k=t.length,M=e.length,w=Math.max(0,Math.min(o,M)),x=h,_=w,S=f>1||g,O=S?Array(M):[];(b=e.indexOf(t,_))>-1;){var A=j(t,{currentLocation:b,expectedLocation:w,distance:c,ignoreLocation:m});if(x=Math.min(A,x),_=b+k,S)for(var C=0;C=T;R-=1){var U=R-1,B=n[e.charAt(U)];if(S&&(O[U]=+!!B),J[R]=(J[R+1]<<1|1)&B,$&&(J[R]|=(F[R+1]|F[R])<<1|1|F[R+1]),J[R]&W&&(N=j(t,{errors:$,currentLocation:U,expectedLocation:w,distance:c,ignoreLocation:m}))<=x){if(x=N,(_=U)<=w)break;T=Math.max(1,2*w-_)}}if(j(t,{errors:$+1,currentLocation:w,expectedLocation:w,distance:c,ignoreLocation:m})>x)break;F=J}var V={isMatch:_>=0,score:Math.max(.001,N)};if(S){var q=E(O,f);q.length?g&&(V.indices=q):V.isMatch=!1}return V}(e,n,i,{location:a+o,distance:s,threshold:h,findAllMatches:u,minMatchCharLength:l,includeMatches:r,ignoreLocation:d}),m=y.isMatch,b=y.score,k=y.indices;m&&(g=!0),v+=b,m&&k&&(f=[].concat(c(f),c(k)))}));var y={isMatch:g,score:g?v/this.chunks.length:1};return g&&r&&(y.indices=f),y}}]),e}(),N=[];function P(e,t){for(var n=0,r=N.length;n-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function D(e,t){t.score=e.score}function K(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?L.includeMatches:r,o=n.includeScore,a=void 0===o?L.includeScore:o,c=[];return i&&c.push($),a&&c.push(D),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return c.length&&c.forEach((function(t){t(e,r)})),r}))}var T=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(r(this,e),this.options=t(t({},L),i),this.options.useExtendedSearch)throw new Error(y);this._keyStore=new b(this.options.keys),this.setCollection(n,o)}return o(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof O))throw new Error("Incorrect 'index' type");this._myIndex=t||A(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){f(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,i=this.options,o=i.includeMatches,a=i.includeScore,c=i.shouldSort,s=i.sortFn,h=i.ignoreFieldNorm,d=u(e)?u(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return W(d,{ignoreFieldNorm:h}),c&&d.sort(s),l(r)&&r>-1&&(d=d.slice(0,r)),K(d,this._docs,{includeMatches:o,includeScore:a})}},{key:"_searchStringList",value:function(e){var t=P(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(f(n)){var a=t.searchIn(n),c=a.isMatch,s=a.score,h=a.indices;c&&r.push({item:n,idx:i,matches:[{score:s,value:n,norm:o,indices:h}]})}})),r}},{key:"_searchLogical",value:function(e){throw new Error("Logical search is not available")}},{key:"_searchObjectList",value:function(e){var t=this,n=P(e,this.options),r=this._myIndex,i=r.keys,o=r.records,a=[];return o.forEach((function(e){var r=e.$,o=e.i;if(f(r)){var s=[];i.forEach((function(e,i){s.push.apply(s,c(t._findMatches({key:e,value:r[i],searcher:n})))})),s.length&&a.push({idx:o,item:r,matches:s})}})),a}},{key:"_findMatches",value:function(e){var t=e.key,n=e.value,r=e.searcher;if(!f(n))return[];var i=[];if(h(n))n.forEach((function(e){var n=e.v,o=e.i,a=e.n;if(f(n)){var c=r.searchIn(n),s=c.isMatch,h=c.score,u=c.indices;s&&i.push({score:h,key:t,value:n,idx:o,norm:a,indices:u})}}));else{var o=n.v,a=n.n,c=r.searchIn(o),s=c.isMatch,u=c.score,l=c.indices;s&&i.push({score:u,key:t,value:o,norm:a,indices:l})}return i}}]),e}();return T.version="6.5.3",T.createIndex=A,T.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?L.getFn:n,i=t.fieldNormWeight,o=void 0===i?L.fieldNormWeight:i,a=e.keys,c=e.records,s=new O({getFn:r,fieldNormWeight:o});return s.setKeys(a),s.setIndexRecords(c),s},T.config=L,T},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Fuse=t(); \ No newline at end of file +var e,t;e=this,t=function(){"use strict";function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function t(t){for(var n=1;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=new Map,r=Math.pow(10,t);return{get:function(t){var i=t.match(_).length;if(n.has(i))return n.get(i);var o=1/Math.pow(i,.5*e),a=parseFloat(Math.round(o*r)/r);return n.set(i,a),a},clear:function(){n.clear()}}}var O=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.getFn,i=void 0===n?L.getFn:n,o=t.fieldNormWeight,a=void 0===o?L.fieldNormWeight:o;r(this,e),this.norm=S(a,3),this.getFn=i,this.isCreated=!1,this.setIndexRecords()}return o(e,[{key:"setSources",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=e}},{key:"setIndexRecords",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=e}},{key:"setKeys",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=t,this._keysMap={},t.forEach((function(t,n){e._keysMap[t.id]=n}))}},{key:"create",value:function(){var e=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,u(this.docs[0])?this.docs.forEach((function(t,n){e._addString(t,n)})):this.docs.forEach((function(t,n){e._addObject(t,n)})),this.norm.clear())}},{key:"add",value:function(e){var t=this.size();u(e)?this._addString(e,t):this._addObject(e,t)}},{key:"removeAt",value:function(e){this.records.splice(e,1);for(var t=e,n=this.size();t2&&void 0!==arguments[2]?arguments[2]:{},r=n.getFn,i=void 0===r?L.getFn:r,o=n.fieldNormWeight,a=void 0===o?L.fieldNormWeight:o,c=new O({getFn:i,fieldNormWeight:a});return c.setKeys(e.map(k)),c.setSources(t),c.create(),c}function j(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.errors,r=void 0===n?0:n,i=t.currentLocation,o=void 0===i?0:i,a=t.expectedLocation,c=void 0===a?0:a,s=t.distance,h=void 0===s?L.distance:s,u=t.ignoreLocation,l=void 0===u?L.ignoreLocation:u,d=r/e.length;if(l)return d;var f=Math.abs(c-o);return h?d+f/h:f?1:d}function E(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L.minMatchCharLength,n=[],r=-1,i=-1,o=0,a=e.length;o=t&&n.push([r,i]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}var I=32;function F(e){for(var t={},n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,a=void 0===o?L.location:o,c=i.threshold,s=void 0===c?L.threshold:c,h=i.distance,u=void 0===h?L.distance:h,l=i.includeMatches,d=void 0===l?L.includeMatches:l,f=i.findAllMatches,v=void 0===f?L.findAllMatches:f,g=i.minMatchCharLength,y=void 0===g?L.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?L.isCaseSensitive:p,b=i.ignoreLocation,k=void 0===b?L.ignoreLocation:b;if(r(this,e),this.options={location:a,threshold:s,distance:u,includeMatches:d,findAllMatches:v,minMatchCharLength:y,isCaseSensitive:m,ignoreLocation:k},this.pattern=m?t:t.toLowerCase(),this.chunks=[],this.pattern.length){var M=function(e,t){n.chunks.push({pattern:e,alphabet:F(e),startIndex:t})},w=this.pattern.length;if(w>I){for(var x=0,_=w%I,S=w-_;x3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?L.location:i,a=r.distance,c=void 0===a?L.distance:a,s=r.threshold,h=void 0===s?L.threshold:s,u=r.findAllMatches,l=void 0===u?L.findAllMatches:u,d=r.minMatchCharLength,f=void 0===d?L.minMatchCharLength:d,v=r.includeMatches,g=void 0===v?L.includeMatches:v,y=r.ignoreLocation,m=void 0===y?L.ignoreLocation:y;if(t.length>I)throw new Error(p(I));for(var b,k=t.length,M=e.length,w=Math.max(0,Math.min(o,M)),x=h,_=w,S=f>1||g,O=S?Array(M):[];(b=e.indexOf(t,_))>-1;){var A=j(t,{currentLocation:b,expectedLocation:w,distance:c,ignoreLocation:m});if(x=Math.min(A,x),_=b+k,S)for(var F=0;F=T;R-=1){var U=R-1,B=n[e.charAt(U)];if(S&&(O[U]=+!!B),J[R]=(J[R+1]<<1|1)&B,$&&(J[R]|=(C[R+1]|C[R])<<1|1|C[R+1]),J[R]&W&&(N=j(t,{errors:$,currentLocation:U,expectedLocation:w,distance:c,ignoreLocation:m}))<=x){if(x=N,(_=U)<=w)break;T=Math.max(1,2*w-_)}}if(j(t,{errors:$+1,currentLocation:w,expectedLocation:w,distance:c,ignoreLocation:m})>x)break;C=J}var V={isMatch:_>=0,score:Math.max(.001,N)};if(S){var q=E(O,f);q.length?g&&(V.indices=q):V.isMatch=!1}return V}(e,n,i,{location:a+o,distance:s,threshold:h,findAllMatches:u,minMatchCharLength:l,includeMatches:r,ignoreLocation:d}),m=y.isMatch,b=y.score,k=y.indices;m&&(g=!0),v+=b,m&&k&&(f=[].concat(c(f),c(k)))}));var y={isMatch:g,score:g?v/this.chunks.length:1};return g&&r&&(y.indices=f),y}}]),e}(),N=[];function P(e,t){for(var n=0,r=N.length;n-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function D(e,t){t.score=e.score}function K(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?L.includeMatches:r,o=n.includeScore,a=void 0===o?L.includeScore:o,c=[];return i&&c.push($),a&&c.push(D),e.map((function(e){var n=e.idx,r={item:t[n],refIndex:n};return c.length&&c.forEach((function(t){t(e,r)})),r}))}var T=function(){function e(n){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2?arguments[2]:void 0;if(r(this,e),this.options=t(t({},L),i),this.options.useExtendedSearch)throw new Error(y);this._keyStore=new b(this.options.keys),this.setCollection(n,o)}return o(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof O))throw new Error("Incorrect 'index' type");this._myIndex=t||A(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){f(e)&&(this._docs.push(e),this._myIndex.add(e))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},t=[],n=0,r=this._docs.length;n1&&void 0!==arguments[1]?arguments[1]:{},n=t.limit,r=void 0===n?-1:n,i=this.options,o=i.includeMatches,a=i.includeScore,c=i.shouldSort,s=i.sortFn,h=i.ignoreFieldNorm,d=u(e)?u(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return W(d,{ignoreFieldNorm:h}),c&&d.sort(s),l(r)&&r>-1&&(d=d.slice(0,r)),K(d,this._docs,{includeMatches:o,includeScore:a})}},{key:"_searchStringList",value:function(e){var t=P(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(f(n)){var a=t.searchIn(n),c=a.isMatch,s=a.score,h=a.indices;c&&r.push({item:n,idx:i,matches:[{score:s,value:n,norm:o,indices:h}]})}})),r}},{key:"_searchLogical",value:function(e){throw new Error("Logical search is not available")}},{key:"_searchObjectList",value:function(e){var t=this,n=P(e,this.options),r=this._myIndex,i=r.keys,o=r.records,a=[];return o.forEach((function(e){var r=e.$,o=e.i;if(f(r)){var s=[];i.forEach((function(e,i){s.push.apply(s,c(t._findMatches({key:e,value:r[i],searcher:n})))})),s.length&&a.push({idx:o,item:r,matches:s})}})),a}},{key:"_findMatches",value:function(e){var t=e.key,n=e.value,r=e.searcher;if(!f(n))return[];var i=[];if(h(n))n.forEach((function(e){var n=e.v,o=e.i,a=e.n;if(f(n)){var c=r.searchIn(n),s=c.isMatch,h=c.score,u=c.indices;s&&i.push({score:h,key:t,value:n,idx:o,norm:a,indices:u})}}));else{var o=n.v,a=n.n,c=r.searchIn(o),s=c.isMatch,u=c.score,l=c.indices;s&&i.push({score:u,key:t,value:o,norm:a,indices:l})}return i}}]),e}();return T.version="6.6.2",T.createIndex=A,T.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?L.getFn:n,i=t.fieldNormWeight,o=void 0===i?L.fieldNormWeight:i,a=e.keys,c=e.records,s=new O({getFn:r,fieldNormWeight:o});return s.setKeys(a),s.setIndexRecords(c),s},T.config=L,T},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Fuse=t(); \ No newline at end of file diff --git a/assets/js/license.js b/assets/js/license.js new file mode 100644 index 00000000..8e81d229 --- /dev/null +++ b/assets/js/license.js @@ -0,0 +1,6 @@ +/* + PaperMod v6 + License: MIT https://github.com/adityatelange/hugo-PaperMod/blob/master/LICENSE + Copyright (c) 2020 nanxiaobei and adityatelange + Copyright (c) 2021-2022 adityatelange +*/ diff --git a/i18n/bn.yaml b/i18n/bn.yaml index 9fdafd16..9c5a2c44 100644 --- a/i18n/bn.yaml +++ b/i18n/bn.yaml @@ -1,8 +1,8 @@ - id: prev_page - translation: "পূর্বের পাতা" + translation: "পূর্ববর্তী" - id: next_page - translation: "পরবর্তী পাতা" + translation: "পরবর্তী" - id: read_time translation: diff --git a/i18n/de.yaml b/i18n/de.yaml index 47254190..f64aad97 100644 --- a/i18n/de.yaml +++ b/i18n/de.yaml @@ -1,8 +1,8 @@ - id: prev_page - translation: "Vorherige Seite" + translation: "Vorherige" - id: next_page - translation: "Nächste Seite" + translation: "Nächste" - id: read_time translation: diff --git a/i18n/hi.yaml b/i18n/hi.yaml index 24e8fc61..681efdc5 100644 --- a/i18n/hi.yaml +++ b/i18n/hi.yaml @@ -1,14 +1,17 @@ - id: prev_page - translation: "पिछला पृष्ठ" + translation: "पिछला" - id: next_page - translation: "अगला पृष्ठ" + translation: "अगला" - id: read_time translation: one : "एक मिनट" other: "{{ .Count }} मिनट" +- id: edit_post + translation: "सुधारें" + - id: toc translation: "विषय - सूची" diff --git a/i18n/id.yaml b/i18n/id.yaml index 0add1217..93d34f5b 100644 --- a/i18n/id.yaml +++ b/i18n/id.yaml @@ -1,16 +1,33 @@ - id: prev_page - translation: "Halaman Sebelumnya" + translation: "Sebelumnya" - id: next_page - translation: "Halaman Selanjutnya" + translation: "Selanjutnya" - id: read_time translation: one : "1 menit" other: "{{ .Count }} menit" +- id: words + translation: + one : "kata" + other: "{{ .Count }} kata" + - id: toc - translation: "Daftar Isi" + translation: "Daftar isi" - id: translations translation: "Terjemahan" + +- id: home + translation: "Beranda" + +- id: edit_post + translation: "Sunting" + +- id: code_copy + translation: "salin" + +- id: code_copied + translation: "disalin!" \ No newline at end of file diff --git a/i18n/ja.yaml b/i18n/ja.yaml index c286ef9e..bc7bf377 100644 --- a/i18n/ja.yaml +++ b/i18n/ja.yaml @@ -9,8 +9,25 @@ one : "1 分" other: "{{ .Count }} 分" +- id: words + translation: + one: "文字" + other: "{{ .Count }} 文字" + - id: toc translation: "目次" - id: translations translation: "言語" + +- id: home + translation: "ホーム" + +- id: edit_post + translation: "編集" + +- id: code_copy + translation: "コピー" + +- id: code_copied + translation: "コピーされました!" diff --git a/i18n/ku.yaml b/i18n/ku.yaml index b6d5e321..d1d30a53 100644 --- a/i18n/ku.yaml +++ b/i18n/ku.yaml @@ -1,8 +1,8 @@ - id: prev_page - translation: "Rêpela Berê" + translation: "Rûpela Paş" - id: next_page - translation: "Rûpela Bê" + translation: "Rûpela Pêş" - id: read_time translation: @@ -13,13 +13,13 @@ translation: "Pêrist" - id: translations - translation: "Wergêranan" + translation: "Wergeran" - id: home translation: "Xanî" - id: code_copy - translation: "Jê bigre" + translation: "Jê bigire" - id: code_copied - translation: "Hat jê girtin!" + translation: "Hat jêgirtin!" diff --git a/i18n/ru.yaml b/i18n/ru.yaml index 7ef8ed21..a5dbb5cb 100644 --- a/i18n/ru.yaml +++ b/i18n/ru.yaml @@ -5,7 +5,20 @@ translation: "Следующая" - id: read_time - translation: "{{ .Count }} мин" + translation: + zero: "0 минут" + one: "1 минута" + few: "{{ .Count }} минуты" + many: "{{ .Count }} минут" + other: "{{ .Count }} минута" + +- id: words + translation: + zero: "0 слов" + one: "1 слово" + few: "{{ .Count }} слова" + many: "{{ .Count }} слов" + other: "{{ .Count }} слово" - id: toc translation: "Оглавление" @@ -16,6 +29,9 @@ - id: home translation: "Главная" +- id: edit_post + translation: "Редактировать" + - id: code_copy translation: "копировать" diff --git a/layouts/_default/list.html b/layouts/_default/list.html index be48d84d..17f36f36 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -39,7 +39,9 @@ {{- $pages := union .RegularPages .Sections }} {{- if .IsHome }} -{{- $pages = where ( where site.RegularPages "Type" "in" site.Params.mainSections ) ".Params.offTheRecord" "!=" true }} +{{- $pages = where site.RegularPages "Type" "in" site.Params.mainSections }} +{{- $pages = where $pages "Params.hiddenInHomeList" "!=" "true" }} +{{- $pages = where $pages "Params.offTheRecord" "!=" "true" }} {{- end }} {{- $paginator := .Paginate $pages }} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index ae02d99a..52668eb3 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -8,7 +8,7 @@ Powered by Hugo & - PaperMod + PaperMod {{- end }} diff --git a/layouts/partials/head.html b/layouts/partials/head.html index d9b79735..112e84de 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -23,33 +23,49 @@ {{- with site.Params.description }}{{ . }}{{- end }}{{- end }}{{- end -}}"> -{{- if site.Params.analytics.googlesiteVerificationTag }} - +{{- if site.Params.analytics.google.SiteVerificationTag }} + {{- end }} -{{- if site.Params.analytics.yandexsiteVerificationTag }} - +{{- if site.Params.analytics.yandex.SiteVerificationTag }} + {{- end }} -{{- if site.Params.analytics.bingsiteVerificationTag }} - +{{- if site.Params.analytics.bing.SiteVerificationTag }} + +{{- end }} +{{- if site.Params.analytics.naver.SiteVerificationTag }} + {{- end }} {{- /* Styles */}} + +{{- /* includes */}} +{{- $includes := slice }} +{{- $includes = $includes | append (" " | resources.FromString "assets/css/includes-blank.css")}} + +{{- if not (eq site.Params.assets.disableScrollBarStyle true) }} + {{- $ScrollStyle := (resources.Get "css/includes/scroll-bar.css") }} + {{- $includes = (append $ScrollStyle $includes) }} +{{- end }} + +{{- $includes_all := $includes | resources.Concat "assets/css/includes.css" }} + {{- $theme_vars := (resources.Get "css/core/theme-vars.css") }} {{- $reset := (resources.Get "css/core/reset.css") }} {{- $media := (resources.Get "css/core/zmedia.css") }} +{{- $license_css := (resources.Get "css/core/license.css") }} {{- $common := (resources.Match "css/common/*.css") | resources.Concat "assets/css/common.css" }} {{- /* include `an-old-hope` if hljs is on */}} {{- $isHLJSdisabled := (site.Params.assets.disableHLJS | default false) }} -{{- $hljs := (cond ($isHLJSdisabled) (" " | resources.FromString "assets/css/hljs-blank.css") (resources.Get "css/hljs/an-old-hope.min.css")) }} +{{- $hljs := (cond ($isHLJSdisabled) (".chroma { background-color: unset !important;}" | resources.FromString "assets/css/hljs-blank.css") (resources.Get "css/hljs/an-old-hope.min.css")) }} {{- /* order is important */}} -{{- $core := (slice $theme_vars $reset $common $hljs $media) | resources.Concat "assets/css/core.css" }} -{{- $extended := (resources.Match "css/extended/*.css") | resources.Concat "assets/css/extended.css" }} +{{- $core := (slice $theme_vars $reset $common $hljs $includes_all $media) | resources.Concat "assets/css/core.css" | resources.Minify }} +{{- $extended := (resources.Match "css/extended/*.css") | resources.Concat "assets/css/extended.css" | resources.Minify }} {{- /* bundle all required css */}} {{- /* Add extended css after theme style */ -}} -{{- $stylesheet := (slice $core $extended) | resources.Concat "assets/css/stylesheet.css" | minify }} +{{- $stylesheet := (slice $license_css $core $extended) | resources.Concat "assets/css/stylesheet.css" }} {{- if not site.Params.assets.disableFingerprinting }} {{- $stylesheet := $stylesheet | fingerprint }} @@ -61,13 +77,14 @@ {{- /* Search */}} {{- if (eq .Layout `search`) -}} -{{- $fastsearch := resources.Get "js/fastsearch.js" | js.Build (dict "params" (dict "fuseOpts" site.Params.fuseOpts)) }} +{{- $fastsearch := resources.Get "js/fastsearch.js" | js.Build (dict "params" (dict "fuseOpts" site.Params.fuseOpts)) | resources.Minify }} {{- $fusejs := resources.Get "js/fuse.basic.min.js" }} +{{- $license_js := resources.Get "js/license.js" }} {{- if not site.Params.assets.disableFingerprinting }} -{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify | fingerprint }} +{{- $search := (slice $fusejs $license_js $fastsearch ) | resources.Concat "assets/js/search.js" | fingerprint }} {{- else }} -{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify }} +{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" }} {{- end }} {{- end -}} @@ -76,11 +93,11 @@ {{- $isHLJSdisabled := (site.Params.assets.disableHLJS | default .Params.disableHLJS ) }} {{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (not $isHLJSdisabled)) }} {{- if not site.Params.assets.disableFingerprinting }} -{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify | fingerprint }} +{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | fingerprint }} {{- else }} -{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify }} +{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" }} {{- end }} {{- end }} diff --git a/layouts/partials/header.html b/layouts/partials/header.html index 34dc9215..4a7291e2 100644 --- a/layouts/partials/header.html +++ b/layouts/partials/header.html @@ -60,12 +60,14 @@ {{- $img = $img.Resize "x30" }} {{- end }} {{- end }} - logo {{- else }} - logo {{- end -}} + {{- else if hasPrefix site.Params.label.iconSVG " @@ -73,12 +75,12 @@
{{- if (not site.Params.disableThemeToggle) }}
\ No newline at end of file + diff --git a/layouts/partials/share_icons.html b/layouts/partials/share_icons.html index 85c59b3b..59ed0503 100644 --- a/layouts/partials/share_icons.html +++ b/layouts/partials/share_icons.html @@ -17,7 +17,7 @@ {{- if (cond ($custom) (in $ShareButtons "twitter") (true)) }} - + @@ -26,7 +26,7 @@ {{- if (cond ($custom) (in $ShareButtons "linkedin") (true)) }} - + @@ -35,7 +35,7 @@ {{- if (cond ($custom) (in $ShareButtons "reddit") (true)) }} - + @@ -44,7 +44,7 @@ {{- if (cond ($custom) (in $ShareButtons "facebook") (true)) }} - + @@ -53,7 +53,7 @@ {{- if (cond ($custom) (in $ShareButtons "whatsapp") (true)) }} - + @@ -62,10 +62,10 @@ {{- if (cond ($custom) (in $ShareButtons "telegram") (true)) }} - + {{- end }} - + \ No newline at end of file diff --git a/layouts/partials/social_icons.html b/layouts/partials/social_icons.html index 7c16e30e..3f8d6a35 100644 --- a/layouts/partials/social_icons.html +++ b/layouts/partials/social_icons.html @@ -1,6 +1,6 @@