diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index b7d5b289..d88b750f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -26,7 +26,7 @@ Please fill the template below - Device/Os: [e.g. Android 10] - Type: [e.g. Desktop/Mobile] - Browser and version [e.g. Chrome 86.0]: - - Hugo Version [ >=0.97.1 expected]: + - Hugo Version [ >=0.112.4 expected]: - Theme Version [e.g. v4.0, master, or commit-id ]: **Steps to reproduce the behavior:** diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 4f59e302..4d35f1de 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -15,7 +15,7 @@ on: hugoVersion: description: "Hugo Version" required: false - default: "0.97.1" + default: "0.112.4" # Allow one concurrent deployment concurrency: @@ -38,14 +38,14 @@ jobs: build: runs-on: ubuntu-latest env: - HUGO_VERSION: "0.97.1" + HUGO_VERSION: "0.112.4" steps: - 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 \ + wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_linux-amd64.deb \ && sudo dpkg -i ${{ runner.temp }}/hugo.deb - name: Checkout uses: actions/checkout@v3 @@ -53,7 +53,7 @@ jobs: ref: exampleSite - name: Setup Pages id: pages - uses: actions/configure-pages@v1 + uses: actions/configure-pages@v3 - name: Get Theme run: git submodule update --init --recursive - name: Update theme to Latest commit @@ -64,7 +64,7 @@ jobs: --buildDrafts --gc --verbose \ --baseURL ${{ steps.pages.outputs.base_url }} - name: Upload artifact - uses: actions/upload-pages-artifact@v1 + uses: actions/upload-pages-artifact@v2 with: path: ./public # Deployment job @@ -77,4 +77,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v1 + uses: actions/deploy-pages@v2 diff --git a/assets/css/common/main.css b/assets/css/common/main.css index 50022ac1..25ae4dae 100644 --- a/assets/css/common/main.css +++ b/assets/css/common/main.css @@ -27,12 +27,10 @@ margin-inline-start: auto; } -.social-icons { - padding: 12px 0; -} -.social-icons a:not(:last-of-type) { - margin-inline-end: 12px; +.social-icons a { + display: inline-flex; + padding: 10px; } .social-icons a svg { diff --git a/assets/css/common/post-entry.css b/assets/css/common/post-entry.css index 5ccab69c..3d52d3f3 100644 --- a/assets/css/common/post-entry.css +++ b/assets/css/common/post-entry.css @@ -80,13 +80,17 @@ bottom: 0; } -.entry-cover, -.entry-isdraft { - font-size: 14px; +.entry-hint { color: var(--secondary); } +.entry-hint-parent { + display: flex; + justify-content: space-between; +} + .entry-cover { + font-size: 14px; margin-bottom: var(--gap); text-align: center; } diff --git a/assets/css/common/post-single.css b/assets/css/common/post-single.css index 24afb9e4..0e14f18a 100644 --- a/assets/css/common/post-single.css +++ b/assets/css/common/post-single.css @@ -128,19 +128,18 @@ } .post-content table { - margin-bottom: 32px; + margin-bottom: var(--content-gap); } .post-content table th, .post-content table:not(.highlighttable, .highlight table, .gist .highlight) td { min-width: 80px; - padding: 12px 8px; + padding: 8px 5px; line-height: 1.5; border-bottom: 1px solid var(--border); } .post-content table th { - font-size: 14px; text-align: start; } @@ -314,10 +313,18 @@ margin-top: 56px; } +.post-footer>* { + margin-bottom: 10px; +} + +.post-tags { + display: flex; + flex-wrap: wrap; + gap: 10px; +} + .post-tags li { display: inline-block; - margin-inline-end: 3px; - margin-bottom: 5px; } .post-tags a, @@ -329,8 +336,7 @@ .post-tags a { display: block; - padding-inline-start: 14px; - padding-inline-end: 14px; + padding: 0 14px; color: var(--secondary); font-size: 14px; line-height: 34px; @@ -338,17 +344,16 @@ } .share-buttons { - margin: 14px 0; - padding-inline-start: var(--radius); + padding: 10px; display: flex; justify-content: center; overflow-x: auto; - background: none; - border: none; + gap: 10px; } +.share-buttons li, .share-buttons a { - margin-top: 10px; + display: inline-flex; } .share-buttons a:not(:last-of-type) { @@ -370,7 +375,6 @@ h6:hover .anchor { } .paginav { - margin: 10px 0; display: flex; line-height: 30px; border-radius: var(--radius); diff --git a/assets/css/common/profile-mode.css b/assets/css/common/profile-mode.css index 58f28198..9e98df55 100644 --- a/assets/css/common/profile-mode.css +++ b/assets/css/common/profile-mode.css @@ -10,19 +10,20 @@ text-align: center; } -.profile .profile_inner h1 { - padding: 12px 0; +.profile .profile_inner { + display: flex; + flex-direction: column; + align-items: center; + gap: 10px; } .profile img { - display: inline-table; border-radius: 50%; } .buttons { flex-wrap: wrap; max-width: 400px; - margin: 0 auto; } .button { diff --git a/assets/css/core/reset.css b/assets/css/core/reset.css index 4d49dd15..d41fcadb 100644 --- a/assets/css/core/reset.css +++ b/assets/css/core/reset.css @@ -8,6 +8,8 @@ html { -webkit-tap-highlight-color: transparent; overflow-y: scroll; scroll-behavior: smooth; + -webkit-text-size-adjust: 100%; + text-size-adjust: 100%; } a, diff --git a/assets/css/core/zmedia.css b/assets/css/core/zmedia.css index 210d4863..a68fd718 100644 --- a/assets/css/core/zmedia.css +++ b/assets/css/core/zmedia.css @@ -36,6 +36,12 @@ } } +@media screen and (max-width: 340px) { + .share-buttons { + justify-content: unset; + } +} + @media (prefers-reduced-motion) { /* terms; profile-mode; post-single; post-entry; post-entry; search; search */ .terms-tags a:active, diff --git a/assets/js/fastsearch.js b/assets/js/fastsearch.js index 06ebcfba..9484e751 100644 --- a/assets/js/fastsearch.js +++ b/assets/js/fastsearch.js @@ -77,7 +77,12 @@ sInput.onkeyup = function (e) { // run a search query (for "term") every time a letter is typed // in the search box if (fuse) { - const results = fuse.search(this.value.trim()); // the actual query being run using fuse.js + let results; + if (params.fuseOpts) { + results = fuse.search(this.value.trim(), {limit: params.fuseOpts.limit}); // the actual query being run using fuse.js along with options + } else { + results = fuse.search(this.value.trim()); // the actual query being run using fuse.js + } if (results.length !== 0) { // build our html if result exists let resultSet = ''; // our results bucket diff --git a/assets/js/fuse.basic.min.js b/assets/js/fuse.basic.min.js index 89477c64..74577214 100644 --- a/assets/js/fuse.basic.min.js +++ b/assets/js/fuse.basic.min.js @@ -1,9 +1,9 @@ /** - * Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io) + * Fuse.js v7.0.0 - Lightweight fuzzy-search (http://fusejs.io) * - * Copyright (c) 2022 Kiro Risk (http://kiro.me) + * Copyright (c) 2023 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 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 +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]:{},n=t.getFn,i=void 0===n?O.getFn:n,o=t.fieldNormWeight,a=void 0===o?O.fieldNormWeight:o;r(this,e),this.norm=function(){var e=arguments.length>0&&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(j).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()}}}(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,f(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();f(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?O.getFn:r,o=n.fieldNormWeight,a=void 0===o?O.fieldNormWeight:o,c=new A({getFn:i,fieldNormWeight:a});return c.setKeys(e.map(x)),c.setSources(t),c.create(),c}function I(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?O.distance:s,u=t.ignoreLocation,l=void 0===u?O.ignoreLocation:u,d=r/e.length;if(l)return d;var f=Math.abs(c-o);return h?d+f/h:f?1:d}var F=32;function C(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=r.location,o=void 0===i?O.location:i,a=r.distance,c=void 0===a?O.distance:a,s=r.threshold,h=void 0===s?O.threshold:s,u=r.findAllMatches,l=void 0===u?O.findAllMatches:u,d=r.minMatchCharLength,f=void 0===d?O.minMatchCharLength:d,v=r.includeMatches,g=void 0===v?O.includeMatches:v,y=r.ignoreLocation,p=void 0===y?O.ignoreLocation:y;if(t.length>F)throw new Error("Pattern length exceeds max of ".concat(F,"."));for(var m,b=t.length,k=e.length,M=Math.max(0,Math.min(o,k)),w=h,x=M,L=f>1||g,S=L?Array(k):[];(m=e.indexOf(t,x))>-1;){var _=I(t,{currentLocation:m,expectedLocation:M,distance:c,ignoreLocation:p});if(w=Math.min(_,w),x=m+b,L)for(var j=0;j=$;z-=1){var J=z-1,R=n[e.charAt(J)];if(L&&(S[J]=+!!R),K[z]=(K[z+1]<<1|1)&R,P&&(K[z]|=(A[z+1]|A[z])<<1|1|A[z+1]),K[z]&N&&(E=I(t,{errors:P,currentLocation:J,expectedLocation:M,distance:c,ignoreLocation:p}))<=w){if(w=E,(x=J)<=M)break;$=Math.max(1,2*M-x)}}if(I(t,{errors:P+1,currentLocation:M,expectedLocation:M,distance:c,ignoreLocation:p})>w)break;A=K}var U={isMatch:x>=0,score:Math.max(.001,E)};if(L){var B=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:O.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}(S,f);B.length?g&&(U.indices=B):U.isMatch=!1}return U}function N(e){for(var t={},n=0,r=e.length;n1&&void 0!==arguments[1]?arguments[1]:{},o=i.location,a=void 0===o?O.location:o,c=i.threshold,s=void 0===c?O.threshold:c,h=i.distance,u=void 0===h?O.distance:h,l=i.includeMatches,d=void 0===l?O.includeMatches:l,f=i.findAllMatches,v=void 0===f?O.findAllMatches:f,g=i.minMatchCharLength,y=void 0===g?O.minMatchCharLength:g,p=i.isCaseSensitive,m=void 0===p?O.isCaseSensitive:p,b=i.ignoreLocation,k=void 0===b?O.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:N(e),startIndex:t})},w=this.pattern.length;if(w>F){for(var x=0,L=w%F,S=w-L;x-1&&(n.refIndex=e.idx),t.matches.push(n)}}))}function D(e,t){t.score=e.score}var K=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({},O),i),this.options.useExtendedSearch)throw new Error("Extended search is not available");this._keyStore=new w(this.options.keys),this.setCollection(n,o)}return o(e,[{key:"setCollection",value:function(e,t){if(this._docs=e,t&&!(t instanceof A))throw new Error("Incorrect 'index' type");this._myIndex=t||E(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(e){y(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]:{}).limit,n=void 0===t?-1:t,r=this.options,i=r.includeMatches,o=r.includeScore,a=r.shouldSort,c=r.sortFn,s=r.ignoreFieldNorm,h=f(e)?f(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return function(e,t){var n=t.ignoreFieldNorm,r=void 0===n?O.ignoreFieldNorm:n;e.forEach((function(e){var t=1;e.matches.forEach((function(e){var n=e.key,i=e.norm,o=e.score,a=n?n.weight:null;t*=Math.pow(0===o&&a?Number.EPSILON:o,(a||1)*(r?1:i))})),e.score=t}))}(h,{ignoreFieldNorm:s}),a&&h.sort(c),v(n)&&n>-1&&(h=h.slice(0,n)),function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.includeMatches,i=void 0===r?O.includeMatches:r,o=n.includeScore,a=void 0===o?O.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}))}(h,this._docs,{includeMatches:i,includeScore:o})}},{key:"_searchStringList",value:function(e){var t=T(e,this.options),n=this._myIndex.records,r=[];return n.forEach((function(e){var n=e.v,i=e.i,o=e.n;if(y(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=T(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(y(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(!y(n))return[];var i=[];if(u(n))n.forEach((function(e){var n=e.v,o=e.i,a=e.n;if(y(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,h=c.score,l=c.indices;s&&i.push({score:h,key:t,value:o,norm:a,indices:l})}return i}}]),e}();return K.version="7.0.0",K.createIndex=E,K.parseIndex=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.getFn,r=void 0===n?O.getFn:n,i=t.fieldNormWeight,o=void 0===i?O.fieldNormWeight:i,a=e.keys,c=e.records,s=new A({getFn:r,fieldNormWeight:o});return s.setKeys(a),s.setIndexRecords(c),s},K.config=O,K},"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/i18n/cs.yaml b/i18n/cs.yaml new file mode 100644 index 00000000..058c3a1c --- /dev/null +++ b/i18n/cs.yaml @@ -0,0 +1,33 @@ +- id: prev_page + translation: "Předchozí" + +- id: next_page + translation: "Další" + +- id: read_time + translation: + one : "1 min" + other: "{{ .Count }} min" + +- id: words + translation: + one : "slovo" + other: "{{ .Count }} slov" + +- id: toc + translation: "Obsah" + +- id: translations + translation: "Překlady" + +- id: home + translation: "Domů" + +- id: edit_post + translation: "Upravit" + +- id: code_copy + translation: "kopírovat" + +- id: code_copied + translation: "zkopírováno!" diff --git a/i18n/no.yaml b/i18n/no.yaml new file mode 100644 index 00000000..24003489 --- /dev/null +++ b/i18n/no.yaml @@ -0,0 +1,33 @@ +- id: prev_page + translation: "Forrige Side" + +- id: next_page + translation: "Neste Side" + +- id: read_time + translation: + one: "1 min" + other: "{{ .Count }} min" + +- id: words + translation: + one: "ord" + other: "{{ .Count }} ord" + +- id: toc + translation: "Innholdsfortegnelse" + +- id: translations + translation: "Oversettelser" + +- id: home + translation: "Hjem" + +- id: edit_post + translation: "Rediger" + +- id: code_copy + translation: "Kopier" + +- id: code_copied + translation: "Kopiert!" diff --git a/i18n/ro.yaml b/i18n/ro.yaml new file mode 100644 index 00000000..694f20bd --- /dev/null +++ b/i18n/ro.yaml @@ -0,0 +1,33 @@ +- id: prev_page + translation: "Înapoi" + +- id: next_page + translation: "Înainte" + +- id: read_time + translation: + one : "1 minut" + other: "{{ .Count }} minute" + +- id: words + translation: + one : "cuvânt" + other: "{{ .Count }} cuvinte" + +- id: toc + translation: "Sumar" + +- id: translations + translation: "Traduceri" + +- id: home + translation: "Acasă" + +- id: edit_post + translation: "Editează" + +- id: code_copy + translation: "copiază" + +- id: code_copied + translation: "copiat!" diff --git a/i18n/sw.yaml b/i18n/sw.yaml new file mode 100644 index 00000000..5fceb1a0 --- /dev/null +++ b/i18n/sw.yaml @@ -0,0 +1,33 @@ +- id: prev_page + translation: "Uliopita" + +- id: next_page + translation: "Ujao" + +- id: read_time + translation: + one : "dakika 1" + other: "dakika {{ .Count }}" + +- id: words + translation: + one : "neno" + other: "maneno {{ .Count }}" + +- id: toc + translation: "Jedwali la Yaliyomo" + +- id: translations + translation: "Tafsiri" + +- id: home + translation: "Mwanzo" + +- id: edit_post + translation: "Hariri" + +- id: code_copy + translation: "nakili" + +- id: code_copied + translation: "nakiliwa!" diff --git a/i18n/th.yaml b/i18n/th.yaml new file mode 100644 index 00000000..d8036ae5 --- /dev/null +++ b/i18n/th.yaml @@ -0,0 +1,33 @@ +- id: prev_page + translation: "ก่อนหน้า" + +- id: next_page + translation: "ถัดไป" + +- id: read_time + translation: + 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/vi.yaml b/i18n/vi.yaml index a3832ed7..2eb05d08 100644 --- a/i18n/vi.yaml +++ b/i18n/vi.yaml @@ -6,9 +6,14 @@ - id: read_time translation: - one : "1 phút" + one: "1 phút" other: "{{ .Count }} phút" +- id: words + translation: + one: "từ" + other: "{{ .Count }} từ" + - id: toc translation: "Mục lục" @@ -18,6 +23,9 @@ - id: home translation: "Trang chủ" +- id: edit_post + translation: "Chỉnh sửa" + - id: code_copy translation: "Sao chép" diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html index d2c4d76b..b38e39a1 100644 --- a/layouts/_default/archives.html +++ b/layouts/_default/archives.html @@ -6,7 +6,7 @@ {{- if (.Param "ShowRssButtonInSectionTermList") }} {{- $rss := (.OutputFormats.Get "rss") }} {{- if (eq .Kind `page`) }} - {{- $rss = (.Parent.OutputFormats.Get "rss") }} + {{- $rss = (.Parent.OutputFormats.Get "rss") }} {{- end }} {{- with $rss }} @@ -46,9 +46,16 @@ {{- range .Pages }} {{- if eq .Kind "page" }}
-

+

{{- .Title | markdownify }} - {{- if .Draft }}  [draft]{{- end }} + {{- if .Draft }} + + + + + + {{- end }}

{{- partial "post_meta.html" . -}} diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 3d13f07a..df611bfb 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -1,3 +1,7 @@ +{{- if lt hugo.Version "0.112.4" }} +{{- errorf "=> hugo v0.112.4 or greater is required for hugo-PaperMod to build " }} +{{- end -}} + diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 9c5bc54d..81aea6e4 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -64,12 +64,19 @@ {{- end }}
- {{- $isHidden := (site.Params.cover.hidden | default site.Params.cover.hiddenInList) }} - {{- partial "cover.html" (dict "cxt" . "IsHome" true "isHidden" $isHidden) }} + {{- $isHidden := (.Param "cover.hiddenInList") | default (.Param "cover.hidden") | default false }} + {{- partial "cover.html" (dict "cxt" . "IsSingle" false "isHidden" $isHidden) }}
-

+

{{- .Title }} - {{- if .Draft }}  [draft]{{- end }} + {{- if .Draft }} + + + + + + {{- end }}

{{- if (ne (.Param "hideSummary") true) }} diff --git a/layouts/_default/rss.xml b/layouts/_default/rss.xml index 44f14986..b6a7ec06 100644 --- a/layouts/_default/rss.xml +++ b/layouts/_default/rss.xml @@ -1,21 +1,53 @@ -{{- $pctx := . -}} -{{- if .IsHome -}}{{ $pctx = site }}{{- end -}} -{{- $pages := slice -}} -{{- if or $.IsHome $.IsSection -}} -{{- $pages = $pctx.RegularPages -}} -{{- else -}} -{{- $pages = $pctx.Pages -}} -{{- end -}} -{{- $limit := site.Config.Services.RSS.Limit -}} -{{- if ge $limit 1 -}} -{{- $pages = $pages | first $limit -}} -{{- end -}} +{{- /* Deprecate site.Author.email in favor of site.Params.author.email */}} +{{- $authorEmail := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .email }} + {{- $authorEmail = . }} + {{- end }} + {{- end }} +{{- else }} + {{- with site.Author.email }} + {{- $authorEmail = . }} + {{- warnf "The author key in site configuration is deprecated. Use params.author.email instead." }} + {{- end }} +{{- end }} + +{{- /* Deprecate site.Author.name in favor of site.Params.author.name */}} +{{- $authorName := "" }} +{{- with site.Params.author }} + {{- if reflect.IsMap . }} + {{- with .name }} + {{- $authorName = . }} + {{- end }} + {{- else }} + {{- $authorName = . }} + {{- end }} +{{- else }} + {{- with site.Author.name }} + {{- $authorName = . }} + {{- warnf "The author key in site configuration is deprecated. Use params.author.name instead." }} + {{- end }} +{{- end }} + +{{- $pctx := . }} +{{- if .IsHome }}{{ $pctx = site }}{{ end }} +{{- $pages := slice }} +{{- if or $.IsHome $.IsSection }} +{{- $pages = $pctx.RegularPages }} +{{- else }} +{{- $pages = $pctx.Pages }} +{{- end }} +{{- $limit := site.Config.Services.RSS.Limit }} +{{- if ge $limit 1 }} +{{- $pages = $pages | first $limit }} +{{- end }} {{- printf "" | safeHTML }} - + - {{ if eq .Title site.Title }}{{ site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ site.Title }}{{ end }} + {{ if eq .Title site.Title }}{{ site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ site.Title }}{{ end }} {{ .Permalink }} - Recent content {{ if ne .Title site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ site.Title }} + Recent content {{ if ne .Title site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ site.Title }} {{- with site.Params.images }} {{ site.Title }} @@ -23,22 +55,22 @@ {{ index . 0 | absURL }} {{- end }} - Hugo -- gohugo.io{{ with site.LanguageCode }} - {{.}}{{end}}{{ with site.Author.email }} - {{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}}{{ with site.Author.email }} - {{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}}{{ with site.Copyright }} - {{.}}{{end}}{{ if not .Date.IsZero }} + Hugo -- gohugo.io + {{ site.Language.LanguageCode }}{{ with $authorEmail }} + {{.}}{{ with $authorName }} ({{ . }}){{ end }}{{ end }}{{ with $authorEmail }} + {{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }}{{ with site.Copyright }} + {{ . }}{{ end }}{{ if not .Date.IsZero }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}{{ end }} - {{- with .OutputFormats.Get "RSS" -}} + {{- with .OutputFormats.Get "RSS" }} {{ printf "" .Permalink .MediaType | safeHTML }} - {{- end -}} - {{ range $pages }} + {{- end }} + {{- range $pages }} {{- if and (ne .Layout `search`) (ne .Layout `archives`) }} {{ .Title }} {{ .Permalink }} {{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }} - {{ with site.Author.email }}{{.}}{{ with site.Author.name }} ({{.}}){{end}}{{end}} + {{- with $authorEmail }}{{ . }}{{ with $authorName }} ({{ . }}){{ end }}{{ end }} {{ .Permalink }} {{ with .Description | html }}{{ . }}{{ else }}{{ .Summary | html }}{{ end -}} {{- if site.Params.ShowFullTextinRSS }} @@ -46,6 +78,6 @@ {{- end }} {{- end }} - {{ end }} + {{- end }} diff --git a/layouts/_default/search.html b/layouts/_default/search.html index 6ce67aac..fa166b50 100644 --- a/layouts/_default/search.html +++ b/layouts/_default/search.html @@ -22,7 +22,7 @@
- {{ partial "social_icons.html" site.Params.socialIcons }} + {{ partial "social_icons.html" (dict "align" site.Params.homeInfoParams.AlignSocialIconsTo) }}
{{- end -}} diff --git a/layouts/partials/index_profile.html b/layouts/partials/index_profile.html index d9ddbda5..6882f39b 100644 --- a/layouts/partials/index_profile.html +++ b/layouts/partials/index_profile.html @@ -32,7 +32,7 @@ {{- end }}

{{ .title | default site.Title | markdownify }}

{{ .subtitle | markdownify }} - {{- partial "social_icons.html" site.Params.socialIcons -}} + {{- partial "social_icons.html" -}} {{- with .buttons }}
diff --git a/layouts/partials/post_meta.html b/layouts/partials/post_meta.html index 15b8b1bd..b0c0417e 100644 --- a/layouts/partials/post_meta.html +++ b/layouts/partials/post_meta.html @@ -12,10 +12,12 @@ {{- $scratch.Add "meta" (slice (i18n "words" .WordCount | default (printf "%d words" .WordCount))) }} {{- end }} +{{- if not (.Param "hideAuthor") -}} {{- with (partial "author.html" .) }} {{- $scratch.Add "meta" (slice .) }} {{- end }} +{{- end }} {{- with ($scratch.Get "meta") }} -{{- delimit . " · " -}} +{{- delimit . " · " | safeHTML -}} {{- end -}} diff --git a/layouts/partials/share_icons.html b/layouts/partials/share_icons.html index 0b8fe74f..910ba7f1 100644 --- a/layouts/partials/share_icons.html +++ b/layouts/partials/share_icons.html @@ -13,59 +13,83 @@ {{- $ShareButtons := (.Param "ShareButtons")}} {{- with $ShareButtons }}{{ $custom = true }}{{ end }} - + {{- if (cond ($custom) (in $ShareButtons "ycombinator") (true)) }} +
  • + + + + + +
  • + {{- end }} + diff --git a/layouts/partials/social_icons.html b/layouts/partials/social_icons.html index 958a8590..2b385172 100644 --- a/layouts/partials/social_icons.html +++ b/layouts/partials/social_icons.html @@ -1,6 +1,7 @@ -