From 821865d033ad6b4d92afdba37cc119cf0fe21137 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 8 Nov 2020 15:00:48 +0100 Subject: [PATCH 01/12] use relative URL's for fonts --- CHANGELOG.md | 3 +++ layouts/partials/head/others.html | 16 ++++++++++++++-- layouts/partials/site-header.html | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cd634e..480fbb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,2 +1,5 @@ - ENHANCEMENT - add node `gulp` script to package.json + - remove title and set empty alt tag for page branding +- BUGFIX + - use relative URL's for fonts diff --git a/layouts/partials/head/others.html b/layouts/partials/head/others.html index 15e93ba..ecfe483 100644 --- a/layouts/partials/head/others.html +++ b/layouts/partials/head/others.html @@ -1,5 +1,17 @@ - - + + + + + + + + + + + + + + {{ with .OutputFormats.Get "atom" }} {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} diff --git a/layouts/partials/site-header.html b/layouts/partials/site-header.html index 49fae99..9de1482 100644 --- a/layouts/partials/site-header.html +++ b/layouts/partials/site-header.html @@ -2,7 +2,7 @@
- {{ .Site.Title }} + {{ .Site.Title }} {{ with .Site.Params.subtitle }} From 7cdb54f558fab6de305ee166280ff12149cc7ba1 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 8 Nov 2020 15:07:02 +0100 Subject: [PATCH 02/12] revert css media type --- layouts/partials/head/others.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/head/others.html b/layouts/partials/head/others.html index ecfe483..a08f924 100644 --- a/layouts/partials/head/others.html +++ b/layouts/partials/head/others.html @@ -8,10 +8,10 @@ - + - + {{ with .OutputFormats.Get "atom" }} {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} From cdd82bb2974e217cc910f58e0b647ec570d87e86 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 8 Nov 2020 17:07:27 +0100 Subject: [PATCH 03/12] update dependencies --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index a78f542..32290ab 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5236,9 +5236,9 @@ "dev": true }, "prettier": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.1.tgz", - "integrity": "sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.2.tgz", + "integrity": "sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==", "dev": true }, "prettier-plugin-go-template": { diff --git a/package.json b/package.json index d823cb8..f72f61d 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "gulp-rename": "^2.0.0", "gulp-sass": "^4.1.0", "gulp-svg-sprite": "^1.5.0", - "prettier": "^2.1.1", + "prettier": "^2.1.2", "prettier-plugin-go-template": "0.0.10", "run-sequence": "^2.2.1" }, From d2eb08243f24a569c4a11d1cc2529989f47129f2 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 8 Nov 2020 17:07:53 +0100 Subject: [PATCH 04/12] fix typo --- exampleSite/content/posts/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exampleSite/content/posts/getting-started.md b/exampleSite/content/posts/getting-started.md index a4e9847..5b6fe50 100644 --- a/exampleSite/content/posts/getting-started.md +++ b/exampleSite/content/posts/getting-started.md @@ -127,7 +127,7 @@ To prepare your new site environment just a few steps are required: If you want to add some demo data you could use the content from the [Hugo basic example](https://github.com/gohugoio/hugoBasicExample): ```Shell - curl -L https://github.com/gohugoio/hugoBasicExample/archive/master.tar.gz | tar -xz --exclude "config*" --exclude "LICENSE" --exclude "README*" --strip-components=1 + curl -L https://github.com/gohugoio/hugoBasicExample/archive/master.tar.gz | tar -xz --exclude "config*" --exclude "LICENSE" --exclude "README*" --strip-components=1 ``` ### Option 1: Download pre-build release bundle From 172db048f09b36639a0906e3ba12b4b7303633e3 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 8 Nov 2020 17:08:17 +0100 Subject: [PATCH 05/12] fix print css and split out mobile css --- CHANGELOG.md | 4 +- gulpfile.js | 2 +- layouts/partials/head/others.html | 10 +++- src/sass/_base.scss | 83 +------------------------------ src/sass/_mobile.scss | 81 ++++++++++++++++++++++++++++++ src/sass/_print.scss | 37 ++++++++++---- src/sass/main.scss | 17 +++---- src/sass/mobile.scss | 3 ++ src/sass/print.scss | 3 ++ static/mobile.css | 61 +++++++++++++++++++++++ static/mobile.min.css | 1 + static/print.css | 32 ++++++++++++ static/print.min.css | 1 + 13 files changed, 231 insertions(+), 104 deletions(-) create mode 100644 src/sass/_mobile.scss create mode 100644 src/sass/mobile.scss create mode 100644 src/sass/print.scss create mode 100644 static/mobile.css create mode 100644 static/mobile.min.css create mode 100644 static/print.css create mode 100644 static/print.min.css diff --git a/CHANGELOG.md b/CHANGELOG.md index 480fbb3..14444c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ - ENHANCEMENT - add node `gulp` script to package.json - - remove title and set empty alt tag for page branding + - remove `title` and set empty `alt` tag on branding image + - add minimal working CSS for printing + - split out mobile CSS - BUGFIX - use relative URL's for fonts diff --git a/gulpfile.js b/gulpfile.js index 64ef523..fe30645 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -17,7 +17,7 @@ var TIMESTAMP = Math.round(Date.now() / 1000); gulp.task("sass", function () { return gulp - .src("src/sass/main.scss") + .src("src/sass/{main,print,mobile}.scss") .pipe(sass({ errLogToConsole: true })) .pipe(cleanCSS({ format: "beautify" })) .pipe( diff --git a/layouts/partials/head/others.html b/layouts/partials/head/others.html index a08f924..b7f293f 100644 --- a/layouts/partials/head/others.html +++ b/layouts/partials/head/others.html @@ -8,10 +8,16 @@ - + + + + + + + - + {{ with .OutputFormats.Get "atom" }} {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} diff --git a/src/sass/_base.scss b/src/sass/_base.scss index 3995ab1..bce324c 100644 --- a/src/sass/_base.scss +++ b/src/sass/_base.scss @@ -132,6 +132,7 @@ img { .gblog-nav { background: $second-color; color: $gray-200; + min-height: $padding-4; .container { padding-top: $padding-8; @@ -429,85 +430,3 @@ img { text-decoration: none; } } - -@media screen and (max-width: $sm-breakpoint) { - .gblog-brand { - font-size: $font-size-32 * 1.1; - } - - .gblog-nav { - .container { - padding: 0; - } - - &__list { - background: lighten($second-color, 10%); - flex-direction: column; - justify-content: center; - max-height: 0; - overflow: hidden; - } - - &__entry { - padding: $padding-16 0; - border: 0; - border-radius: 0; - display: block; - margin: 0; - text-align: center; - - &:hover, - &.is-active { - background: lighten($second-color, 5%); - } - } - - &__control { - display: block; - text-align: center; - - label { - padding: $padding-16 0; - } - } - } - - .gblog-error { - padding: $padding-16 * 6 $padding-16; - - .icon { - font-size: $font-size-32 * 2.5; - } - - &__message { - padding-left: $padding-16 * 2; - } - - &__line { - padding: $padding-4 0; - } - - &__title { - font-size: $font-size-16 * 2; - } - } - - .gblog-footer { - &__item { - width: 100%; - } - } -} - -#menu-control:checked ~ .gblog-nav__list { - max-height: 100%; -} - -#menu-control:checked ~ .gblog-nav__control { - .icon.menu { - display: none; - } - .icon.clear { - display: inline-block; - } -} diff --git a/src/sass/_mobile.scss b/src/sass/_mobile.scss new file mode 100644 index 0000000..a7713ff --- /dev/null +++ b/src/sass/_mobile.scss @@ -0,0 +1,81 @@ +@media screen and (max-width: $sm-breakpoint) { + .gblog-brand { + font-size: $font-size-32 * 1.1; + } + + .gblog-nav { + .container { + padding: 0; + } + + &__list { + background: lighten($second-color, 10%); + flex-direction: column; + justify-content: center; + max-height: 0; + overflow: hidden; + } + + &__entry { + padding: $padding-16 0; + border: 0; + border-radius: 0; + display: block; + margin: 0; + text-align: center; + + &:hover, + &.is-active { + background: lighten($second-color, 5%); + } + } + + &__control { + display: block; + text-align: center; + + label { + padding: $padding-16 0; + } + } + } + + .gblog-error { + padding: $padding-16 * 6 $padding-16; + + .icon { + font-size: $font-size-32 * 2.5; + } + + &__message { + padding-left: $padding-16 * 2; + } + + &__line { + padding: $padding-4 0; + } + + &__title { + font-size: $font-size-16 * 2; + } + } + + .gblog-footer { + &__item { + width: 100%; + } + } +} + +#menu-control:checked ~ .gblog-nav__list { + max-height: 100%; +} + +#menu-control:checked ~ .gblog-nav__control { + .icon.menu { + display: none; + } + .icon.clear { + display: inline-block; + } +} diff --git a/src/sass/_print.scss b/src/sass/_print.scss index c736efa..e1615c1 100644 --- a/src/sass/_print.scss +++ b/src/sass/_print.scss @@ -1,19 +1,38 @@ @media print { .gblog-nav, - .gblog-footer { + .gblog-footer .container div:not(:last-child), + .gblog-paging, + .gblog-post__readmore, + .gblog-post__anchor { display: none; } - main { - flex-direction: column-reverse; + .gblog-header { + border-bottom: 1px solid $gray-300; } - .gblog-toc { - flex: none; + .gblog-footer { + border-top: 1px solid $gray-300; + } + + .gblog-markdown pre { + white-space: pre-wrap; + overflow-wrap: break-word; + } + + .chroma code { + border: 1px solid $gray-300; + padding: $padding-8 !important; + font-weight: normal !important; + } + + .gblog-markdown code { + font-weight: bold; + } - nav { - position: relative; - width: auto; - } + a, + a:visited { + color: inherit !important; + text-decoration: none !important; } } diff --git a/src/sass/main.scss b/src/sass/main.scss index 901e485..7445b21 100644 --- a/src/sass/main.scss +++ b/src/sass/main.scss @@ -1,11 +1,10 @@ -@import "defaults"; +@import "_defaults"; -@import "normalize"; -@import "utils"; -@import "fonts"; -@import "base"; -@import "print"; +@import "_normalize"; +@import "_utils"; +@import "_fonts"; +@import "_base"; -@import "markdown"; -@import "chroma_github"; -@import "shortcodes"; +@import "_markdown"; +@import "_chroma_github"; +@import "_shortcodes"; diff --git a/src/sass/mobile.scss b/src/sass/mobile.scss new file mode 100644 index 0000000..0d891ee --- /dev/null +++ b/src/sass/mobile.scss @@ -0,0 +1,3 @@ +@import "_defaults"; + +@import "_mobile"; diff --git a/src/sass/print.scss b/src/sass/print.scss new file mode 100644 index 0000000..b00823a --- /dev/null +++ b/src/sass/print.scss @@ -0,0 +1,3 @@ +@import "_defaults"; + +@import "_print"; diff --git a/static/mobile.css b/static/mobile.css new file mode 100644 index 0000000..d06c3b5 --- /dev/null +++ b/static/mobile.css @@ -0,0 +1,61 @@ +@media screen and (max-width:45rem) { + .gblog-brand { + font-size: 2.2rem + } + .gblog-nav .container { + padding: 0 + } + .gblog-nav__list { + background: #454b5b; + flex-direction: column; + justify-content: center; + max-height: 0; + overflow: hidden + } + .gblog-nav__entry { + padding: 1rem 0; + border: 0; + border-radius: 0; + display: block; + margin: 0; + text-align: center + } + .gblog-nav__entry.is-active, + .gblog-nav__entry:hover { + background: #3a3f4d + } + .gblog-nav__control { + display: block; + text-align: center + } + .gblog-nav__control label { + padding: 1rem 0 + } + .gblog-error { + padding: 6rem 1rem + } + .gblog-error .icon { + font-size: 5rem + } + .gblog-error__message { + padding-left: 2rem + } + .gblog-error__line { + padding: .25rem 0 + } + .gblog-error__title { + font-size: 2rem + } + .gblog-footer__item { + width: 100% + } +} +#menu-control:checked ~ .gblog-nav__list { + max-height: 100% +} +#menu-control:checked ~ .gblog-nav__control .icon.menu { + display: none +} +#menu-control:checked ~ .gblog-nav__control .icon.clear { + display: inline-block +} \ No newline at end of file diff --git a/static/mobile.min.css b/static/mobile.min.css new file mode 100644 index 0000000..1b76314 --- /dev/null +++ b/static/mobile.min.css @@ -0,0 +1 @@ +@media screen and (max-width:45rem){.gblog-brand{font-size:2.2rem}.gblog-nav .container{padding:0}.gblog-nav__list{background:#454b5b;flex-direction:column;justify-content:center;max-height:0;overflow:hidden}.gblog-nav__entry{padding:1rem 0;border:0;border-radius:0;display:block;margin:0;text-align:center}.gblog-nav__entry.is-active,.gblog-nav__entry:hover{background:#3a3f4d}.gblog-nav__control{display:block;text-align:center}.gblog-nav__control label{padding:1rem 0}.gblog-error{padding:6rem 1rem}.gblog-error .icon{font-size:5rem}.gblog-error__message{padding-left:2rem}.gblog-error__line{padding:.25rem 0}.gblog-error__title{font-size:2rem}.gblog-footer__item{width:100%}}#menu-control:checked~.gblog-nav__list{max-height:100%}#menu-control:checked~.gblog-nav__control .icon.menu{display:none}#menu-control:checked~.gblog-nav__control .icon.clear{display:inline-block} \ No newline at end of file diff --git a/static/print.css b/static/print.css new file mode 100644 index 0000000..75afc76 --- /dev/null +++ b/static/print.css @@ -0,0 +1,32 @@ +@media print { + .gblog-footer .container div:not(:last-child), + .gblog-nav, + .gblog-paging, + .gblog-post__anchor, + .gblog-post__readmore { + display: none + } + .gblog-header { + border-bottom: 1px solid #dee2e6 + } + .gblog-footer { + border-top: 1px solid #dee2e6 + } + .gblog-markdown pre { + white-space: pre-wrap; + overflow-wrap: break-word + } + .chroma code { + border: 1px solid #dee2e6; + padding: .5rem!important; + font-weight: 400!important + } + .gblog-markdown code { + font-weight: 700 + } + a, + a:visited { + color: inherit!important; + text-decoration: none!important + } +} \ No newline at end of file diff --git a/static/print.min.css b/static/print.min.css new file mode 100644 index 0000000..0ddf00e --- /dev/null +++ b/static/print.min.css @@ -0,0 +1 @@ +@media print{.gblog-footer .container div:not(:last-child),.gblog-nav,.gblog-paging,.gblog-post__anchor,.gblog-post__readmore{display:none}.gblog-header{border-bottom:1px solid #dee2e6}.gblog-footer{border-top:1px solid #dee2e6}.gblog-markdown pre{white-space:pre-wrap;overflow-wrap:break-word}.chroma code{border:1px solid #dee2e6;padding:.5rem!important;font-weight:400!important}.gblog-markdown code{font-weight:700}a,a:visited{color:inherit!important;text-decoration:none!important}} \ No newline at end of file From f3dd4a258d9a7a62a5e9b6e2dad0b3a09bc985a5 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 8 Nov 2020 17:17:00 +0100 Subject: [PATCH 06/12] upload page validation report on PR --- .drone.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.drone.yml b/.drone.yml index 473e868..f4c82d4 100644 --- a/.drone.yml +++ b/.drone.yml @@ -56,9 +56,6 @@ steps: strip_prefix: lhci_reports/dist/ target: /${DRONE_REPO_NAME} when: - ref: - - refs/heads/master - - refs/tags/** status: - failure - success @@ -234,6 +231,6 @@ depends_on: --- kind: signature -hmac: d4a14c67312952bf2cba2f41bf5f2b5b7bc2b576bc2ff7cea2aa5442afb673a6 +hmac: 9d9a8eac7e74638129bb170a5262eb0923531449654d616327ec54aaa7db4635 ... From 70a1a019d9a726ed8e9b584e30bbf156b5252510 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 8 Nov 2020 20:29:07 +0100 Subject: [PATCH 07/12] add lhci report comment to PRs --- .drone.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index f4c82d4..faee3ac 100644 --- a/.drone.yml +++ b/.drone.yml @@ -60,6 +60,15 @@ steps: - failure - success +- name: page-validation-link + image: thegeeklab/drone-github-comment + settings: + api_key: + from_secret: github_token + when: + ref: + - refs/pull/** + trigger: ref: - refs/heads/master @@ -231,6 +240,6 @@ depends_on: --- kind: signature -hmac: 9d9a8eac7e74638129bb170a5262eb0923531449654d616327ec54aaa7db4635 +hmac: 20937ab9306d0bd679187d6cbee7f11e7d9c37fcc4e4eccd156779e9c4c4d80f ... From 4cd2ddf9bc6331832590962de025f8b4411f8136 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 8 Nov 2020 21:06:23 +0100 Subject: [PATCH 08/12] debug --- .drone.yml | 111 +++++++++++++++++++++++++++-------------------------- 1 file changed, 57 insertions(+), 54 deletions(-) diff --git a/.drone.yml b/.drone.yml index faee3ac..89ca85f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,64 +7,67 @@ platform: arch: amd64 steps: -- name: assets - image: node:lts - commands: - - npm install -g gulp - - npm install - - gulp default - environment: - FORCE_COLOR: true - NPM_CONFIG_LOGLEVEL: error - -- name: testbuild - image: klakegg/hugo:0.74.3-ext-alpine - commands: - - mkdir exampleSite/themes/ && ln -s $(pwd)/ exampleSite/themes/hugo-geekblog - - hugo-official -s exampleSite/ -b http://localhost/ - -- name: html-validation - image: thegeeklab/vnu - commands: - - vnu --skip-non-html --also-check-css --errors-only exampleSite/public - -- name: link-validation - image: thegeeklab/link-validator - commands: - - link-validator -ro - environment: - LINK_VALIDATOR_BASE_DIR: exampleSite/public - -- name: page-validation - image: thegeeklab/lhci - commands: - - lhci autorun - environment: - LHCI_SERVER_URL: https://drone-artifact.rknet.org/${DRONE_REPO_NAME}/ - -- name: page-validation-upload - image: plugins/s3 - settings: - access_key: - from_secret: s3_access_key - bucket: drone-artifact - endpoint: https://sp.rknet.org - path_style: true - secret_key: - from_secret: s3_secret_access_key - source: lhci_reports/dist/* - strip_prefix: lhci_reports/dist/ - target: /${DRONE_REPO_NAME} - when: - status: - - failure - - success +# - name: assets +# image: node:lts +# commands: +# - npm install -g gulp +# - npm install +# - gulp default +# environment: +# FORCE_COLOR: true +# NPM_CONFIG_LOGLEVEL: error + +# - name: testbuild +# image: klakegg/hugo:0.74.3-ext-alpine +# commands: +# - mkdir exampleSite/themes/ && ln -s $(pwd)/ exampleSite/themes/hugo-geekblog +# - hugo-official -s exampleSite/ -b http://localhost/ + +# - name: html-validation +# image: thegeeklab/vnu +# commands: +# - vnu --skip-non-html --also-check-css --errors-only exampleSite/public + +# - name: link-validation +# image: thegeeklab/link-validator +# commands: +# - link-validator -ro +# environment: +# LINK_VALIDATOR_BASE_DIR: exampleSite/public + +# - name: page-validation +# image: thegeeklab/lhci +# commands: +# - lhci autorun +# environment: +# LHCI_SERVER_URL: https://drone-artifact.rknet.org/${DRONE_REPO_NAME}/ + +# - name: page-validation-upload +# image: plugins/s3 +# settings: +# access_key: +# from_secret: s3_access_key +# bucket: drone-artifact +# endpoint: https://sp.rknet.org +# path_style: true +# secret_key: +# from_secret: s3_secret_access_key +# source: lhci_reports/dist/* +# strip_prefix: lhci_reports/dist/ +# target: /${DRONE_REPO_NAME} +# when: +# status: +# - failure +# - success - name: page-validation-link image: thegeeklab/drone-github-comment settings: - api_key: + api-key: from_secret: github_token + key: pr-${DRONE_PULL_REQUEST} + message: lhci_reports/dist/summary.md + update: true when: ref: - refs/pull/** @@ -240,6 +243,6 @@ depends_on: --- kind: signature -hmac: 20937ab9306d0bd679187d6cbee7f11e7d9c37fcc4e4eccd156779e9c4c4d80f +hmac: 6a4b6cf7a9cf9aad9d41f81925c9c01b3804820c53360a5c3c9a2c7fb90f7d87 ... From 346ac3c82f6bb21aabe70e99d02d959f6cbb1659 Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 8 Nov 2020 21:14:38 +0100 Subject: [PATCH 09/12] debug --- .drone.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 89ca85f..9640a9f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -63,8 +63,7 @@ steps: - name: page-validation-link image: thegeeklab/drone-github-comment settings: - api-key: - from_secret: github_token + api_key: "dummy" key: pr-${DRONE_PULL_REQUEST} message: lhci_reports/dist/summary.md update: true @@ -243,6 +242,6 @@ depends_on: --- kind: signature -hmac: 6a4b6cf7a9cf9aad9d41f81925c9c01b3804820c53360a5c3c9a2c7fb90f7d87 +hmac: def24842a8394087e7ee34f93370366a79184d6faffcd06347f9e6ffbce6ae11 ... From 61b42b047d0f4174a718a490759ec808a6a0e22c Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 8 Nov 2020 21:18:22 +0100 Subject: [PATCH 10/12] cleanup --- .drone.yml | 109 +++++++++++++++++++++++++++-------------------------- 1 file changed, 55 insertions(+), 54 deletions(-) diff --git a/.drone.yml b/.drone.yml index 9640a9f..d2e58b2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -7,63 +7,64 @@ platform: arch: amd64 steps: -# - name: assets -# image: node:lts -# commands: -# - npm install -g gulp -# - npm install -# - gulp default -# environment: -# FORCE_COLOR: true -# NPM_CONFIG_LOGLEVEL: error - -# - name: testbuild -# image: klakegg/hugo:0.74.3-ext-alpine -# commands: -# - mkdir exampleSite/themes/ && ln -s $(pwd)/ exampleSite/themes/hugo-geekblog -# - hugo-official -s exampleSite/ -b http://localhost/ - -# - name: html-validation -# image: thegeeklab/vnu -# commands: -# - vnu --skip-non-html --also-check-css --errors-only exampleSite/public - -# - name: link-validation -# image: thegeeklab/link-validator -# commands: -# - link-validator -ro -# environment: -# LINK_VALIDATOR_BASE_DIR: exampleSite/public - -# - name: page-validation -# image: thegeeklab/lhci -# commands: -# - lhci autorun -# environment: -# LHCI_SERVER_URL: https://drone-artifact.rknet.org/${DRONE_REPO_NAME}/ - -# - name: page-validation-upload -# image: plugins/s3 -# settings: -# access_key: -# from_secret: s3_access_key -# bucket: drone-artifact -# endpoint: https://sp.rknet.org -# path_style: true -# secret_key: -# from_secret: s3_secret_access_key -# source: lhci_reports/dist/* -# strip_prefix: lhci_reports/dist/ -# target: /${DRONE_REPO_NAME} -# when: -# status: -# - failure -# - success +- name: assets + image: node:lts + commands: + - npm install -g gulp + - npm install + - gulp default + environment: + FORCE_COLOR: true + NPM_CONFIG_LOGLEVEL: error + +- name: testbuild + image: klakegg/hugo:0.74.3-ext-alpine + commands: + - mkdir exampleSite/themes/ && ln -s $(pwd)/ exampleSite/themes/hugo-geekblog + - hugo-official -s exampleSite/ -b http://localhost/ + +- name: html-validation + image: thegeeklab/vnu + commands: + - vnu --skip-non-html --also-check-css --errors-only exampleSite/public + +- name: link-validation + image: thegeeklab/link-validator + commands: + - link-validator -ro + environment: + LINK_VALIDATOR_BASE_DIR: exampleSite/public + +- name: page-validation + image: thegeeklab/lhci + commands: + - lhci autorun + environment: + LHCI_SERVER_URL: https://drone-artifact.rknet.org/${DRONE_REPO_NAME}/ + +- name: page-validation-upload + image: plugins/s3 + settings: + access_key: + from_secret: s3_access_key + bucket: drone-artifact + endpoint: https://sp.rknet.org + path_style: true + secret_key: + from_secret: s3_secret_access_key + source: lhci_reports/dist/* + strip_prefix: lhci_reports/dist/ + target: /${DRONE_REPO_NAME} + when: + status: + - failure + - success - name: page-validation-link image: thegeeklab/drone-github-comment settings: - api_key: "dummy" + api_key: + from_secret: github_token key: pr-${DRONE_PULL_REQUEST} message: lhci_reports/dist/summary.md update: true @@ -242,6 +243,6 @@ depends_on: --- kind: signature -hmac: def24842a8394087e7ee34f93370366a79184d6faffcd06347f9e6ffbce6ae11 +hmac: aed300317299ce213f8f6369180d0563514592592ab4221299f3410d4f9d0ef3 ... From fe36135da86898253fdc19ff2e9560618808aeed Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 8 Nov 2020 21:58:08 +0100 Subject: [PATCH 11/12] increase hugo timeout --- CHANGELOG.md | 2 ++ exampleSite/config.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14444c2..de86c37 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,3 +5,5 @@ - split out mobile CSS - BUGFIX - use relative URL's for fonts +- INTERNAL + - publish Lighthouse CI overwiew to PR's diff --git a/exampleSite/config.yml b/exampleSite/config.yml index de23886..2b5e342 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -5,6 +5,7 @@ theme: hugo-geekblog pygmentsUseClasses: true pygmentsCodeFences: true enableGitInfo: true +timeout: 60000 paginate: 5 From f00b90be7841fe446322672a6cde618b523c197e Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sun, 8 Nov 2020 22:36:04 +0100 Subject: [PATCH 12/12] load static css/js assets from data template --- CHANGELOG.md | 5 +++++ data/assets.json | 8 ++++++++ layouts/partials/foot.html | 2 +- layouts/partials/head/others.html | 16 ++++++++-------- layouts/shortcodes/mermaid.html | 2 +- 5 files changed, 23 insertions(+), 10 deletions(-) create mode 100644 data/assets.json diff --git a/CHANGELOG.md b/CHANGELOG.md index de86c37..6e156d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ - remove `title` and set empty `alt` tag on branding image - add minimal working CSS for printing - split out mobile CSS + - load static css/js assets from data template: + This way users can hash static assets and overwrite the data template + to deliver the hashed assets. Thats helpful if you have to deal with + long cache settings but wont to ensure your updated assets are delivered + to clients. - BUGFIX - use relative URL's for fonts - INTERNAL diff --git a/data/assets.json b/data/assets.json new file mode 100644 index 0000000..20a527d --- /dev/null +++ b/data/assets.json @@ -0,0 +1,8 @@ +{ + "main.min.css": "main.min.css", + "mobile.min.css": "mobile.min.css", + "print.min.css": "print.min.css", + "custom.css": "custom.css", + "js/clipboard.min.js": "js/clipboard.min.js", + "js/mermaid.min.js": "js/mermaid.min.js" +} diff --git a/layouts/partials/foot.html b/layouts/partials/foot.html index 79349b8..db37bb0 100644 --- a/layouts/partials/foot.html +++ b/layouts/partials/foot.html @@ -1,5 +1,5 @@ {{ if default true .Site.Params.GeekblogAnchorCopy }} - + +