Skip to content

Commit

Permalink
test: apply testing config for foreign projects #685
Browse files Browse the repository at this point in the history
  • Loading branch information
McShelby committed Oct 13, 2023
1 parent b0c3f96 commit 507237f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion exampleSite/config/testing/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
15 changes: 14 additions & 1 deletion exampleSite/test-hugo.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 507237f

Please sign in to comment.