From 507237f6905a95788fbc7b2b25c2d0d708acf1aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Fri, 13 Oct 2023 23:12:32 +0200 Subject: [PATCH] test: apply testing config for foreign projects #685 --- exampleSite/config/testing/config.toml | 2 +- exampleSite/test-hugo.bat | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/exampleSite/config/testing/config.toml b/exampleSite/config/testing/config.toml index 4b1fe304eb..3a2045e423 100644 --- a/exampleSite/config/testing/config.toml +++ b/exampleSite/config/testing/config.toml @@ -9,7 +9,7 @@ disableHugoGeneratorInject = true # enableMissingTranslationPlaceholders = true # Audit your published site for problems -# https://discourse.gohugo.io/t/audit-your-published-site-for-problems/35184/12?u=mcshelby +# https://discourse.gohugo.io/t/audit-your-published-site-for-problems/35184/12 [minify] [minify.tdewolff] [minify.tdewolff.html] diff --git a/exampleSite/test-hugo.bat b/exampleSite/test-hugo.bat index ff05f4910f..cbe13e689c 100644 --- a/exampleSite/test-hugo.bat +++ b/exampleSite/test-hugo.bat @@ -15,7 +15,20 @@ if not exist "%versionFile%" ( set /p version=<"%versionFile%" echo %version%>"metrics.%version%%hugo_prefix%%hugo_version%.log" -hugo%hugo_version% --environment testing --templateMetrics --templateMetricsHints --cleanDestinationDir --destination "public.%version%%hugo_prefix%%hugo_version%" >> "metrics.%version%%hugo_prefix%%hugo_version%.log" +set config=--environment testing +if exist "config\testing" ( + rem Seems we are in the themes exampleSite, no need to copy anything +) else if exist "config.toml" ( + set config=--config config.toml,..\hugo-theme-relearn\exampleSite\config\testing\config.toml +) else if exist "hugo.toml" ( + set config=--config hugo.toml,..\hugo-theme-relearn\exampleSite\config\testing\config.toml +) else if exist "config" ( + copy /e /i /y "..\hugo-theme-relearn\exampleSite\config\testing" "config\testing" +) else if exist "hugo" ( + copy /e /i /y "..\hugo-theme-relearn\exampleSite\config\testing" "hugo\testing" +) + +hugo%hugo_version% %config% --templateMetrics --templateMetricsHints --cleanDestinationDir --destination "public.%version%%hugo_prefix%%hugo_version%" >> "metrics.%version%%hugo_prefix%%hugo_version%.log" set "start_dir=%CD%\public.%version%%hugo_prefix%%hugo_version%" set "output_file=dir.%version%%hugo_prefix%%hugo_version%.log"