test: modularize config

This commit is contained in:
Sören Weber 2023-06-09 20:28:03 +02:00
parent 03b7ae392a
commit ab67fcc80e
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
4 changed files with 23 additions and 14 deletions

View file

@ -36,11 +36,6 @@ defaultContentLanguage = "en"
# the site's title of this showcase; you should change this ;-) # the site's title of this showcase; you should change this ;-)
title = "Hugo Relearn Documentation" title = "Hugo Relearn Documentation"
# We disable this for testing the exampleSite; you must do so too
# if you want to use the themes parameter disableGeneratorVersion=true;
# otherwise Hugo will create a generator tag on your home page
disableHugoGeneratorInject = true
[outputs] [outputs]
# add JSON to the home to support Lunr search; This is a mandatory setting # add JSON to the home to support Lunr search; This is a mandatory setting
# for the search functionality # for the search functionality

View file

@ -0,0 +1,21 @@
# We disable this for testing the exampleSite; you must do so too
# if you want to use the themes parameter disableGeneratorVersion=true;
# otherwise Hugo will create a generator tag on your home page
disableHugoGeneratorInject = true
# We are pretty sure, to not have unintentionally untranslated titles;
# it may happen in case when shortcodes want to set an automatic title
# out of a given style setting (this is allowed to fail for non severity styles)
# enableMissingTranslationPlaceholders = true
# Audit your published site for problems
# https://discourse.gohugo.io/t/audit-your-published-site-for-problems/35184/12?u=mcshelby
[minify]
[minify.tdewolff]
[minify.tdewolff.html]
keepComments = true
[params]
disableGeneratorVersion = true
disableAssetsBusting = true
disableRandomIds = true

View file

@ -2,10 +2,7 @@
setlocal enabledelayedexpansion setlocal enabledelayedexpansion
set /p version=<..\layouts\partials\version.txt set /p version=<..\layouts\partials\version.txt
echo %version%>metrics.%version%.log echo %version%>metrics.%version%.log
echo disableAssetsBusting=true>>config.toml hugo --environment testing --templateMetrics --templateMetricsHints --cleanDestinationDir --destination public.%version% >> metrics.%version%.log
echo disableGeneratorVersion=true>>config.toml
echo disableRandomIds=true>>config.toml
hugo --templateMetrics --templateMetricsHints --cleanDestinationDir --destination public.%version% >> metrics.%version%.log
set "start_dir=%CD%\public.%version%" set "start_dir=%CD%\public.%version%"
set "output_file=dir.%version%.log" set "output_file=dir.%version%.log"
@ -17,6 +14,5 @@ for /r "%start_dir%" %%F in (*) do (
move /Y dir.%version%.log public.%version%\dir.log 2>&1 >NUL move /Y dir.%version%.log public.%version%\dir.log 2>&1 >NUL
move /Y metrics.%version%.log public.%version%\metrics.log 2>&1 >NUL move /Y metrics.%version%.log public.%version%\metrics.log 2>&1 >NUL
git restore config.toml
For /F "UseBackQ Delims==" %%A In ("public.%version%\metrics.log") Do Set "lastline=%%A" For /F "UseBackQ Delims==" %%A In ("public.%version%\metrics.log") Do Set "lastline=%%A"
echo %lastline% echo %lastline%

View file

@ -5,9 +5,7 @@ set hugo_minor=95
set hugo_patch=0 set hugo_patch=0
set /p version=<..\layouts\partials\version.txt set /p version=<..\layouts\partials\version.txt
echo %version%>metrics.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%.log echo %version%>metrics.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%.log
echo disableAssetsBusting=true>>config.toml hugo.%hugo_major%.%hugo_minor%.%hugo_patch% --environment testing --templateMetrics --templateMetricsHints --cleanDestinationDir --destination public.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch% >> metrics.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%.log
echo disableGeneratorVersion=true>>config.toml
hugo.%hugo_major%.%hugo_minor%.%hugo_patch% --templateMetrics --templateMetricsHints --cleanDestinationDir --destination public.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch% >> metrics.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%.log
set "start_dir=%CD%\public.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%" set "start_dir=%CD%\public.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%"
set "output_file=dir.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%.log" set "output_file=dir.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%.log"
@ -19,6 +17,5 @@ for /r "%start_dir%" %%F in (*) do (
move /Y dir.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%.log public.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%\dir.log 2>&1 >NUL move /Y dir.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%.log public.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%\dir.log 2>&1 >NUL
move /Y metrics.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%.log public.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%\metrics.log 2>&1 >NUL move /Y metrics.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%.log public.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%\metrics.log 2>&1 >NUL
git restore config.toml
For /F "UseBackQ Delims==" %%A In ("public.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%\metrics.log") Do Set "lastline=%%A" For /F "UseBackQ Delims==" %%A In ("public.%version%.hugo.%hugo_major%.%hugo_minor%.%hugo_patch%\metrics.log") Do Set "lastline=%%A"
echo %lastline% echo %lastline%