diff --git a/.drone.yml b/.drone.yml index 5269445..22dab9d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -24,7 +24,7 @@ steps: - hugo-official -s exampleSite/ -b http://localhost/ - name: html-validation - image: validator/validator + image: xoxys/vnu commands: - vnu --skip-non-html --also-check-css --errors-only exampleSite/public diff --git a/.jsbeautifyrc b/.jsbeautifyrc new file mode 100644 index 0000000..ffbbba3 --- /dev/null +++ b/.jsbeautifyrc @@ -0,0 +1,8 @@ +{ + "indent_size": 4, + "indent_char": " ", + "preserve_newlines": false, + "unformatted" : ["svg"], + "content_unformatted": ["pre"], + "extra_liners": ["head", "body", "html", "main", "header", "footer", "section"] +} diff --git a/.lighthouserc.yml b/.lighthouserc.yml new file mode 100644 index 0000000..ed7a475 --- /dev/null +++ b/.lighthouserc.yml @@ -0,0 +1,19 @@ +--- +ci: + collect: + numberOfRuns: 2 + staticDistDir: exampleSite/public + url: + - http://localhost/ + - http://localhost/404.html + - http://localhost/posts/ + settings: + chromeFlags: "--no-sandbox" + assert: + preset: "lighthouse:no-pwa" + assertions: + uses-long-cache-ttl: off + render-blocking-resources: off + tap-targets: off + first-contentful-paint: off + first-meaningful-paint: off diff --git a/.markdownlint.yml b/.markdownlint.yml new file mode 100644 index 0000000..b59a114 --- /dev/null +++ b/.markdownlint.yml @@ -0,0 +1,6 @@ +--- +default: True +MD013: False +MD041: False +MD004: + style: dash diff --git a/exampleSite/archetypes/default.md b/exampleSite/archetypes/default.md new file mode 100644 index 0000000..00e77bd --- /dev/null +++ b/exampleSite/archetypes/default.md @@ -0,0 +1,6 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true +--- + diff --git a/exampleSite/config.yml b/exampleSite/config.yml new file mode 100644 index 0000000..b430b9a --- /dev/null +++ b/exampleSite/config.yml @@ -0,0 +1,19 @@ +--- +baseURL: https://geekblog.geekdocs.de/ +title: Geekblog +theme: hugo-geekblog +pygmentsUseClasses: true +pygmentsCodeFences: true + +# Needed for mermaid/katex shortcodes +markup: + goldmark: + renderer: + unsafe: true + tableOfContents: + startLevel: 1 + endLevel: 9 + +taxonomies: + author: authors + tag: tags diff --git a/exampleSite/content/contact.md b/exampleSite/content/contact.md new file mode 100644 index 0000000..736ccc7 --- /dev/null +++ b/exampleSite/content/contact.md @@ -0,0 +1,3 @@ +--- +title: "Contact" +--- diff --git a/exampleSite/content/legal-notice.md b/exampleSite/content/legal-notice.md new file mode 100644 index 0000000..13fdd23 --- /dev/null +++ b/exampleSite/content/legal-notice.md @@ -0,0 +1,3 @@ +--- +title: "Legal Notice" +--- diff --git a/exampleSite/content/posts/post-1.md b/exampleSite/content/posts/post-1.md new file mode 100644 index 0000000..4a421e4 --- /dev/null +++ b/exampleSite/content/posts/post-1.md @@ -0,0 +1,18 @@ +--- +title: "First demo post" +date: 2020-06-02T22:00:00+02:00 +authors: + - richard-roe + - john-doe +tags: + - Opinion + - Hardware +--- + +Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture. Ornateness bland it ex enc, est yeti am bongo detract re. Pro ad prompts feud gait, quid exercise emeritus bis e. In pro quints consequent, denim fastidious copious quo ad. Stet [probates](#subtitle-2) in duo. + +Amalia id per in minimum facility, quid facet modifier ea ma. Ill um select ma ad, en ferric patine sentient vim. Per expendable foreordained interpretations cu, maxim sole pertinacity in ram. Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture. Ornateness bland it ex enc, est yeti am bongo detract re. Pro ad prompts feud gait, quid exercise emeritus bis e. In pro quints consequent, denim fastidious copious quo ad. Stet probates in duo. + +## Subtitle 2 + +Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture. Ornateness bland it ex enc, est yeti am bongo detract re. Pro ad prompts feud gait, quid exercise emeritus bis e. In pro quints consequent, denim fastidious copious quo ad. Stet probates in duo. diff --git a/exampleSite/content/posts/post-short.md b/exampleSite/content/posts/post-short.md new file mode 100644 index 0000000..63fdc82 --- /dev/null +++ b/exampleSite/content/posts/post-short.md @@ -0,0 +1,10 @@ +--- +title: "Very short post" +date: 2020-06-22T20:00:00+02:00 +authors: + - john-doe +tags: + - Opinion +--- + +Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture. Ornateness bland it ex enc, est yeti am bongo detract re. Pro ad prompts feud gait, quid exercise emeritus bis e. In pro quints consequent, denim fastidious copious quo ad. Stet probates in duo. diff --git a/exampleSite/content/posts/post-with-image/index.md b/exampleSite/content/posts/post-with-image/index.md new file mode 100644 index 0000000..cd8af95 --- /dev/null +++ b/exampleSite/content/posts/post-with-image/index.md @@ -0,0 +1,14 @@ +--- +title: "Post with image" +date: 2020-06-22T20:00:00+02:00 +authors: + - richard-roe +tags: + - Open Source + - Development + - DevOps +--- + +Amalia id per in minimum facility, quid facet modifier ea ma. Ill um select ma ad, en ferric patine sentient vim. Per expendable foreordained interpretations cu, maxim sole pertinacity in ram. Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture. Ornateness bland it ex enc, est yeti am bongo detract re. Pro ad prompts feud gait, quid exercise emeritus bis e. In pro quints consequent, denim fastidious copious quo ad. Stet probates in duo. + +Dolor sit, sumo unique argument um no. Gracie nominal id xiv. Romanesque acclimates investiture. Ornateness bland it ex enc, est yeti am bongo detract re. Pro ad prompts feud gait, quid exercise emeritus bis e. In pro quints consequent, denim fastidious copious quo ad. Stet probates in duo. diff --git a/exampleSite/data/authors/john-doe.yml b/exampleSite/data/authors/john-doe.yml new file mode 100644 index 0000000..0d50515 --- /dev/null +++ b/exampleSite/data/authors/john-doe.yml @@ -0,0 +1,2 @@ +name: John Doe +email: john@example.com diff --git a/exampleSite/data/authors/richard-roe.yml b/exampleSite/data/authors/richard-roe.yml new file mode 100644 index 0000000..196ed99 --- /dev/null +++ b/exampleSite/data/authors/richard-roe.yml @@ -0,0 +1,2 @@ +name: Richard Roe +email: richard@example.com diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..2f62ef3 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,173 @@ +const gulp = require('gulp'); +const rename = require('gulp-rename'); +const sass = require('gulp-sass'); +const cleanCSS = require('gulp-clean-css'); +const autoprefixer = require('gulp-autoprefixer'); +const iconfont = require('gulp-iconfont'); + +const realFavicon = require('gulp-real-favicon'); +const path = require('path'); +const fs = require('fs'); + +const svgSprite = require('gulp-svg-sprite'); + +var CSSDEST = 'static/' +var FAVICON_DATA_FILE = 'src/favicon/faviconData.json'; +var TIMESTAMP = Math.round(Date.now() / 1000); + +gulp.task('sass', function () { + return gulp.src('src/sass/main.scss') + .pipe(sass({ errLogToConsole: true })) + .pipe(cleanCSS({ format: 'beautify' })) + .pipe(autoprefixer({ + cascade: false + })) + .pipe(gulp.dest(CSSDEST)) + .pipe(cleanCSS()) + .pipe(rename({ extname: '.min.css' })) + .pipe(gulp.dest(CSSDEST)) +}); + +gulp.task('favicon-generate', function (done) { + realFavicon.generateFavicon({ + masterPicture: 'src/favicon/favicon-master.svg', + dest: 'static/favicon', + iconsPath: '/', + design: { + ios: { + pictureAspect: 'backgroundAndMargin', + backgroundColor: '#ffffff', + margin: '14%', + assets: { + ios6AndPriorIcons: false, + ios7AndLaterIcons: false, + precomposedIcons: false, + declareOnlyDefaultIcon: true + } + }, + desktopBrowser: {}, + windows: { + pictureAspect: 'whiteSilhouette', + backgroundColor: '#2b5797', + onConflict: 'override', + assets: { + windows80Ie10Tile: false, + windows10Ie11EdgeTiles: { + small: false, + medium: true, + big: false, + rectangle: false + } + } + }, + androidChrome: { + pictureAspect: 'shadow', + themeColor: '#ffffff', + manifest: { + display: 'standalone', + orientation: 'notSet', + onConflict: 'override', + declared: true + }, + assets: { + legacyIcon: false, + lowResolutionIcons: false + } + }, + safariPinnedTab: { + pictureAspect: 'blackAndWhite', + threshold: 74.21875, + themeColor: '#5bbad5' + } + }, + settings: { + scalingAlgorithm: 'Mitchell', + errorOnImageTooSmall: false, + readmeFile: false, + htmlCodeFile: false, + usePathAsIs: false + }, + markupFile: FAVICON_DATA_FILE + }, function () { + done(); + }); +}); + +gulp.task('favicon-check-update', function (done) { + var currentVersion = JSON.parse(fs.readFileSync(FAVICON_DATA_FILE)).version; + realFavicon.checkForUpdates(currentVersion, function (err) { + if (err) { + throw err; + } + }); + done(); +}); + +gulp.task('svg-sprite', function () { + config = { + svg: { + xmlDeclaration: false, + rootAttributes: { + style: "position: absolute; width: 0; height: 0; overflow: hidden;" + } + }, + mode: { + inline: true, + symbol: { + dest: './', + sprite: 'svg-icon-symbols.html', + bust: false, + } + } + }; + + return gulp.src('src/icons/*.svg') + .pipe(svgSprite(config)) + .pipe(gulp.dest('layouts/partials/')); +}); + +gulp.task('iconfont', function () { + var lastUnicode = 0xEA01; + var files = fs.readdirSync('src/iconfont'); + + // Filter files with containing unicode value + // and set last unicode + files.forEach(function (file) { + var basename = path.basename(file); + var matches = basename.match(/^(?:((?:u[0-9a-f]{4,6},?)+)\-)?(.+)\.svg$/i); + var currentCode = -1; + + if (matches && matches[1]) { + currentCode = parseInt(matches[1].split('u')[1], 16); + } + + if (currentCode >= lastUnicode) { + lastUnicode = ++currentCode; + } + }); + + return gulp.src(['src/iconfont/*.svg']) + .pipe(iconfont({ + startUnicode: lastUnicode, + fontName: 'GeekblogIcons', // required + prependUnicode: true, // recommended option + normalize: true, + fontHeight: 1001, + centerHorizontally: true, + formats: ['woff', 'woff2'], // default, 'woff2' and 'svg' are available + timestamp: TIMESTAMP, // recommended to get consistent builds when watching files + })) + .pipe(gulp.dest('static/fonts/')); +}); + +gulp.task('default', gulp.series( + 'sass', + 'svg-sprite', + 'iconfont', + 'favicon-check-update', + 'favicon-generate' +)); + +gulp.task('devel', function () { + gulp.watch('src/sass/**/*.*css', gulp.series('sass')); +}); diff --git a/layouts/404.html b/layouts/404.html new file mode 100644 index 0000000..3ab8b8d --- /dev/null +++ b/layouts/404.html @@ -0,0 +1,35 @@ + + + +
+ {{ partial "head" . }} + + + + {{ partial "svg-icon-symbols" . }} + ++ {{ .Inner | markdownify }} +diff --git a/layouts/shortcodes/mermaid.html b/layouts/shortcodes/mermaid.html new file mode 100644 index 0000000..033f231 --- /dev/null +++ b/layouts/shortcodes/mermaid.html @@ -0,0 +1,16 @@ +{{ if not (.Page.Scratch.Get "mermaid") }} + + + +{{ .Page.Scratch.Set "mermaid" true }} +{{ end }} + +
+ {{- .Inner -}} +diff --git a/layouts/shortcodes/tab.html b/layouts/shortcodes/tab.html new file mode 100644 index 0000000..e2a207c --- /dev/null +++ b/layouts/shortcodes/tab.html @@ -0,0 +1,12 @@ +{{ if .Parent }} + {{ $name := .Get 0 }} + {{ $group := printf "tabs-%s" (.Parent.Get 0) }} + + {{ if not (.Parent.Scratch.Get $group) }} + {{ .Parent.Scratch.Set $group slice }} + {{ end }} + + {{ .Parent.Scratch.Add $group (dict "Name" $name "Content" .Inner) }} +{{ else }} + {{ errorf "%q: 'tab' shortcode must be inside 'tabs' shortcode" .Page.Path }} +{{ end}} diff --git a/layouts/shortcodes/tabs.html b/layouts/shortcodes/tabs.html new file mode 100644 index 0000000..7a1e6a2 --- /dev/null +++ b/layouts/shortcodes/tabs.html @@ -0,0 +1,16 @@ +{{ if .Inner }}{{ end }} +{{ $id := .Get 0 }} +{{ $group := printf "tabs-%s" $id }} + +
=0;r--){for(var c=e.words[r],f=s-1;f>=0;f--){var l=c>>f&1;i!==n[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++u||0===r&&0===f)&&(i=this.mul(i,n[a]),u=0,a=0)):u=0}s=26}return i},x.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},x.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new k(t)},i(k,x),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var n=t.imul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var n=t.mul(e),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,n(14)(t))},function(t,e,n){"use strict";var r=n(66),i=n(113),o=function(t){return Object(i.a)(Object(r.a)(t).call(document.documentElement))},a=0;function u(){return new s}function s(){this._="@"+(++a).toString(36)}s.prototype=u.prototype={constructor:s,get:function(t){for(var e=this._;!(e in t);)if(!(t=t.parentNode))return;return t[e]},set:function(t,e){return t[this._]=e},remove:function(t){return this._ in t&&delete t[this._]},toString:function(){return this._}};var c=n(203),f=n(285),l=n(105),h=n(68),d=n(67),p=n(49),g=function(t){return"string"==typeof t?new p.a([document.querySelectorAll(t)],[document.documentElement]):new p.a([null==t?[]:t],p.c)},y=n(106),b=n(204),v=n(205),m=n(284),_=n(112),w=function(t,e){null==e&&(e=Object(_.a)().touches);for(var n=0,r=e?e.length:0,i=new Array(r);n >>1;c[g] c)break;y.push(h)}}else for(;d =1;--l)if(!((h=f*l)i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a=this._delta8){var n=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-n,t.length),0===this.pending.length&&(this.pending=null),t=r.join32(t,0,t.length-n,this.endian);for(var i=0;iit&&(it=o):c^(u*ot<(s=(s+360)%360-180)&&sit&&(it=e)),c?t1e-12&&L>1e-12?U>1e-12?(D=k(W,$,Z,X,v,-U,O),C=k(G,H,J,Q,v,-U,O),M.lineTo(D.cx+D.x01,D.cy+D.y01),U
=l;--h)c.point(b[h],v[h]);c.lineEnd(),c.areaEnd()}y&&(b[f]=+t(d,f,i),v[f]=+n(d,f,i),c.point(e?+e(d,f,i):b[f],o?+o(d,f,i):v[f]))}if(p)return c=null,p+""||null}function l(){return O().defined(a).curve(s).context(u)}return f.x=function(n){return arguments.length?(t="function"==typeof n?n:i(+n),e=null,f):t},f.x0=function(e){return arguments.length?(t="function"==typeof e?e:i(+e),f):t},f.x1=function(t){return arguments.length?(e=null==t?null:"function"==typeof t?t:i(+t),f):e},f.y=function(t){return arguments.length?(n="function"==typeof t?t:i(+t),o=null,f):n},f.y0=function(t){return arguments.length?(n="function"==typeof t?t:i(+t),f):n},f.y1=function(t){return arguments.length?(o=null==t?null:"function"==typeof t?t:i(+t),f):o},f.lineX0=f.lineY0=function(){return l().x(t).y(n)},f.lineY1=function(){return l().x(t).y(o)},f.lineX1=function(){return l().x(e).y(n)},f.defined=function(t){return arguments.length?(a="function"==typeof t?t:i(!!t),f):a},f.curve=function(t){return arguments.length?(s=t,null!=u&&(c=s(u)),f):s},f.context=function(t){return arguments.length?(null==t?u=c=null:c=s(u=t),f):u},f},C=function(t,e){return e
h&&(h=u),y=f*f*g,(d=Math.max(h/y,y/l))>p){f-=u;break}p=d}b.push(a={value:f,dice:sr&&(e=n,n=r,r=e),function(t){return Math.max(n,Math.min(r,t))}}function k(t,e,n){var r=t[0],i=t[1],o=e[0],a=e[1];return i0?(s=Math.floor(s/i)*i,c=Math.ceil(c/i)*i,i=Object(r.z)(s,c,n)):i<0&&(s=Math.ceil(s*i)/i,c=Math.floor(c*i)/i,i=Object(r.z)(s,c,n)),i>0?(o[a]=Math.floor(s/i)*i,o[u]=Math.ceil(c/i)*i,e(o)):i<0&&(o[a]=Math.ceil(s*i)/i,o[u]=Math.floor(c*i)/i,e(o)),t},t}function j(){var t=M(_,_);return t.copy=function(){return A(t,j())},i.apply(t,arguments),R(t)}function L(t){var e;function n(t){return isNaN(t=+t)?e:t}return n.invert=n,n.domain=n.range=function(e){return arguments.length?(t=s.call(e,v),n):t.slice()},n.unknown=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return L(t).unknown(e)},t=arguments.length?s.call(t,v):[0,1],R(n)}var B=function(t,e){var n,r=0,i=(t=t.slice()).length-1,o=t[r],a=t[i];return ac)break;y.push(h)}}else y=Object(r.B)(d,p,Math.min(p-d,g)).map(n);return i?y.reverse():y},i.tickFormat=function(t,r){if(null==r&&(r=10===a?".0e":","),"function"!=typeof r&&(r=Object(D.b)(r)),t===1/0)return r;null==t&&(t=10);var o=Math.max(1,a*t/i.ticks().length);return function(t){var i=t/n(Math.round(e(t)));return i*a