diff --git a/.github/workflows/fresh-to-vercel-pr.yml b/.github/workflows/fresh-to-vercel-pr.yml index e6befcae..a3c6c349 100644 --- a/.github/workflows/fresh-to-vercel-pr.yml +++ b/.github/workflows/fresh-to-vercel-pr.yml @@ -4,8 +4,32 @@ on: pull_request: jobs: + testBuild: + runs-on: ubuntu-latest + strategy: + matrix: + # 0.120.0 "minVersion" + # 0.135.0 "justAVersion" + # latest "latest" + hugo: ['0.120.0', '0.135.0', 'latest'] + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v3 + with: + hugo-version: ${{ matrix.hugo }} + extended: true + + - name: Build with Hugo on PR + working-directory: exampleSite + run: hugo --minify + createExampleAndDeployToArtifacts: runs-on: ubuntu-latest + needs: [testBuild] steps: - name: Checkout uses: actions/checkout@v4 @@ -13,7 +37,7 @@ jobs: - name: Setup Hugo uses: peaceiris/actions-hugo@v3 with: - hugo-version: '0.110.0' + hugo-version: 'latest' extended: true - name: Build with Hugo on PR @@ -38,4 +62,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: alias-domain - path: alias-domain/ \ No newline at end of file + path: alias-domain/ diff --git a/layouts/partials/css.html b/layouts/partials/css.html index e941ba13..b9416320 100644 --- a/layouts/partials/css.html +++ b/layouts/partials/css.html @@ -1,4 +1,9 @@ -{{- $inServerMode := .Site.IsServer }} +{{- $inServerMode := "" }} +{{- if gt (int (index (split hugo.Version ".") 1)) "120" }} + {{ $inServerMode = hugo.IsServer }} +{{- else }} + {{ $inServerMode = .Site.IsServer }} +{{- end }} {{- $sass := "style.sass" }} {{- $cssTarget := "css/style.css" }} {{- $cssOpts := cond ($inServerMode) (dict "targetPath" $cssTarget "enableSourceMap" true) (dict "targetPath" $cssTarget "outputStyle" "compressed") }}