From 40ede377c8e67960f181dd22ce34a63eb952f3f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Mon, 18 Nov 2024 19:01:15 +0100 Subject: [PATCH] theme: Hugo 0.139 without verbose option --- exampleSite/test-hugo.bat | 132 +++++++++++++++++----------------- exampleSite/test-hugo.min.bat | 8 +-- layouts/partials/version.txt | 2 +- 3 files changed, 71 insertions(+), 71 deletions(-) diff --git a/exampleSite/test-hugo.bat b/exampleSite/test-hugo.bat index b7e2dc29e6..90517f81d5 100644 --- a/exampleSite/test-hugo.bat +++ b/exampleSite/test-hugo.bat @@ -1,66 +1,66 @@ -@echo off -setlocal enabledelayedexpansion - -set hugo_prefix= -set hugo_version= -if not "%~1"=="" ( - set hugo_prefix=.hugo - set hugo_version=.%1 -) - -rem Relearn themes exampleSite -set "themeDir=.." -if not exist "%themeDir%\layouts\partials\version.txt" ( - rem other sites stored parallel to Relearn themes directory - set "themeDir=..\hugo-theme-relearn" -) -if not exist "%themeDir%\layouts\partials\version.txt" ( - rem other sites stored inside of repos directory parallel to Relearn theme directory - set "themeDir=..\..\hugo-theme-relearn" -) -if not exist "%themeDir%\layouts\partials\version.txt" ( - rem regular theme users - set "themeDir=themes\hugo-theme-relearn" -) -if not exist "%themeDir%\layouts\partials\version.txt" ( - rem theme users with custom theme name - set "themeDir=themes\relearn" -) -if not exist "%themeDir%\layouts\partials\version.txt" ( - echo Relearn theme not found. - set "version=" -) else ( - set /p version=<"%themeDir%\layouts\partials\version.txt" - set "version=.!version!" -) -echo %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,%themeDir%\exampleSite\config\testing\hugo.toml -) else if exist "hugo.toml" ( - set config=--config hugo.toml,%themeDir%\exampleSite\config\testing\hugo.toml -) else if exist "config" ( - copy /e /i /y "%themeDir%\exampleSite\config\testing" "config\testing" -) else if exist "hugo" ( - copy /e /i /y "%themeDir%\config\testing" "hugo\testing" -) - -echo on -hugo%hugo_version% %config% --printPathWarnings --printI18nWarnings --templateMetrics --templateMetricsHints --cleanDestinationDir --logLevel info --verbose --destination "public%version%%hugo_prefix%%hugo_version%" >> "metrics%version%%hugo_prefix%%hugo_version%.log" -@echo off - -set "start_dir=%CD%\public%version%%hugo_prefix%%hugo_version%" -set "output_file=dir%version%%hugo_prefix%%hugo_version%.log" -if exist "%output_file%" del "%output_file%" -for /r "%start_dir%" %%F in (*) do ( - set "file=%%F" - echo !file:%start_dir%\=! >> "%output_file%" -) -move /Y "dir%version%%hugo_prefix%%hugo_version%.log" "public%version%%hugo_prefix%%hugo_version%\dir.log" 2>&1 >NUL - -move /Y "metrics%version%%hugo_prefix%%hugo_version%.log" "public%version%%hugo_prefix%%hugo_version%\metrics.log" 2>&1 >NUL -For /F "UseBackQ Delims==" %%A In ("public%version%%hugo_prefix%%hugo_version%\metrics.log") Do Set "lastline=%%A" -echo %lastline% +@echo off +setlocal enabledelayedexpansion + +set hugo_prefix= +set hugo_version= +if not "%~1"=="" ( + set hugo_prefix=.hugo + set hugo_version=.%1 +) + +rem Relearn themes exampleSite +set "themeDir=.." +if not exist "%themeDir%\layouts\partials\version.txt" ( + rem other sites stored parallel to Relearn themes directory + set "themeDir=..\hugo-theme-relearn" +) +if not exist "%themeDir%\layouts\partials\version.txt" ( + rem other sites stored inside of repos directory parallel to Relearn theme directory + set "themeDir=..\..\hugo-theme-relearn" +) +if not exist "%themeDir%\layouts\partials\version.txt" ( + rem regular theme users + set "themeDir=themes\hugo-theme-relearn" +) +if not exist "%themeDir%\layouts\partials\version.txt" ( + rem theme users with custom theme name + set "themeDir=themes\relearn" +) +if not exist "%themeDir%\layouts\partials\version.txt" ( + echo Relearn theme not found. + set "version=" +) else ( + set /p version=<"%themeDir%\layouts\partials\version.txt" + set "version=.!version!" +) +echo %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,%themeDir%\exampleSite\config\testing\hugo.toml +) else if exist "hugo.toml" ( + set config=--config hugo.toml,%themeDir%\exampleSite\config\testing\hugo.toml +) else if exist "config" ( + copy /e /i /y "%themeDir%\exampleSite\config\testing" "config\testing" +) else if exist "hugo" ( + copy /e /i /y "%themeDir%\config\testing" "hugo\testing" +) + +echo on +hugo%hugo_version% %config% --printPathWarnings --printI18nWarnings --templateMetrics --templateMetricsHints --cleanDestinationDir --logLevel info --destination "public%version%%hugo_prefix%%hugo_version%" >> "metrics%version%%hugo_prefix%%hugo_version%.log" +@echo off + +set "start_dir=%CD%\public%version%%hugo_prefix%%hugo_version%" +set "output_file=dir%version%%hugo_prefix%%hugo_version%.log" +if exist "%output_file%" del "%output_file%" +for /r "%start_dir%" %%F in (*) do ( + set "file=%%F" + echo !file:%start_dir%\=! >> "%output_file%" +) +move /Y "dir%version%%hugo_prefix%%hugo_version%.log" "public%version%%hugo_prefix%%hugo_version%\dir.log" 2>&1 >NUL + +move /Y "metrics%version%%hugo_prefix%%hugo_version%.log" "public%version%%hugo_prefix%%hugo_version%\metrics.log" 2>&1 >NUL +For /F "UseBackQ Delims==" %%A In ("public%version%%hugo_prefix%%hugo_version%\metrics.log") Do Set "lastline=%%A" +echo %lastline% diff --git a/exampleSite/test-hugo.min.bat b/exampleSite/test-hugo.min.bat index 8e3f5574a6..e7412ed8de 100644 --- a/exampleSite/test-hugo.min.bat +++ b/exampleSite/test-hugo.min.bat @@ -1,4 +1,4 @@ -@echo off -setlocal enabledelayedexpansion - -call "test-hugo.bat" 0.126.0 +@echo off +setlocal enabledelayedexpansion + +call "test-hugo.bat" 0.126.0 diff --git a/layouts/partials/version.txt b/layouts/partials/version.txt index 9fcd896e20..7fab1364ba 100644 --- a/layouts/partials/version.txt +++ b/layouts/partials/version.txt @@ -1 +1 @@ -7.1.1+b48b344b6d6d58cbd5cb32879db41fcc0cd5df9a \ No newline at end of file +7.1.1+6cb54ccb05c2c63af78ad8cba8ff244278550c4a \ No newline at end of file