Skip to content

Commit

Permalink
Replace .Site.IsServer with hugo.IsServer (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
StefMa authored Oct 14, 2024
1 parent efd3807 commit aa6b8e5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 3 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/fresh-to-vercel-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,40 @@ 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

- 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
Expand All @@ -38,4 +62,4 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: alias-domain
path: alias-domain/
path: alias-domain/
7 changes: 6 additions & 1 deletion layouts/partials/css.html
Original file line number Diff line number Diff line change
@@ -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") }}
Expand Down

0 comments on commit aa6b8e5

Please sign in to comment.