From 50405c32c94bcde2f79be791eefba4d2efccac91 Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Wed, 18 Sep 2024 00:04:49 +0200 Subject: [PATCH] [SITE] move to hugo builtin minify * move to use hugo-extened minify function * add `rawhtml` shortcode for non-interpreated html/js code this provides the ability to have real raw code that hugo does nto interpretate * move several markdown content with mixed html/js to raw to prevent minify failure * content/events/2019-geneva/newsletter.md * content/events/2023-detroit/welcome.md * remove unused file to prevent wrong interpretation * content/events/2024-kansas-city/program/placeholder-ignite.md * remove nodejs and gulp from gh action workflow * add configuration for proper minifying * update workflow to use new hugo options syntax to enable minify Signed-off-by: Toshaan Bharvani --- .github/workflows/hugo.yml | 13 +------ config/_default/hugo.yml | 39 +++++++++++++++++++ content/events/2019-geneva/newsletter.md | 2 + content/events/2023-detroit/welcome.md | 2 + .../program/placeholder-ignite.md | 8 ---- .../layouts/shortcodes/rawhtml.html | 2 + 6 files changed, 46 insertions(+), 20 deletions(-) delete mode 100644 content/events/2024-kansas-city/program/placeholder-ignite.md create mode 100644 themes/devopsdays-theme/layouts/shortcodes/rawhtml.html diff --git a/.github/workflows/hugo.yml b/.github/workflows/hugo.yml index 5d1c44bd6b3..1b20f99168a 100644 --- a/.github/workflows/hugo.yml +++ b/.github/workflows/hugo.yml @@ -39,18 +39,7 @@ jobs: # extended: true - name: Build Hugo - run: hugo -v - - - uses: actions/setup-node@v3 - name: Setup Node - with: - node-version: ${{ env.NODE_VERSION }} - - - run: npm ci - name: Run npm ci - - - name: Test through minifying - run: gulp min-html + run: hugo --environment=production --minify --templateMetrics --logLevel info # test-windows: # needs: lint diff --git a/config/_default/hugo.yml b/config/_default/hugo.yml index a54e2818f04..c0f8cad2a38 100644 --- a/config/_default/hugo.yml +++ b/config/_default/hugo.yml @@ -60,3 +60,42 @@ params: Linkedin: http://www.linkedin.com/groups?home=&gid=2445279 Groups: http://groups.google.com/group/devopsdays GoogleMapsAPI: AIzaSyA1WhgJirbPSYxMCWRD14IP90A4yLY4vxE + +minify: + disableCSS: false + disableHTML: false + disableJS: false + disableJSON: false + disableSVG: false + disableXML: false + minifyOutput: true + tdewolff: + css: + inline: true + keepCSS2: true + precision: 0 + html: + keepComments: false + keepConditionalComments: false + keepDefaultAttrVals: true + keepDocumentTags: true + keepEndTags: true + keepQuotes: false + keepSpecialComments: false + keepWhitespace: false + templateDelims: + - "" + - "" + js: + keepVarNames: false + precision: 0 + version: 2022 + json: + keepNumbers: false + precision: 0 + svg: + inline: false + keepComments: false + precision: 0 + xml: + keepWhitespace: false diff --git a/content/events/2019-geneva/newsletter.md b/content/events/2019-geneva/newsletter.md index 6be154a0329..e4471df4498 100644 --- a/content/events/2019-geneva/newsletter.md +++ b/content/events/2019-geneva/newsletter.md @@ -6,6 +6,7 @@ Description = "Newsletter devopsdays Geneva 2018" Subscribe to our newsletter for the next news ! +{{< rawhtml >}} \