mirror of https://github.com/escalate/hugo-split-theme.git

Felix Boerner
31.22.2024 c333857a0947a35b0593b82dcc70176070f1093b
feat: use environment modes
6 files modified
16 ■■■■ changed files
.github/workflows/test.yml 4 ●●●● patch | view | raw | blame | history
layouts/partials/head.html 4 ●●●● patch | view | raw | blame | history
tests/exampleSiteWithImage/docker-compose.desktop.yml 2 ●●● patch | view | raw | blame | history
tests/exampleSiteWithImage/docker-compose.mobile.yml 2 ●●● patch | view | raw | blame | history
tests/exampleSiteWithVideo/docker-compose.desktop.yml 2 ●●● patch | view | raw | blame | history
tests/exampleSiteWithVideo/docker-compose.mobile.yml 2 ●●● patch | view | raw | blame | history
.github/workflows/test.yml
@@ -24,7 +24,7 @@
      - name: Build Hugo example site with image
        run: |
          cd tests/exampleSiteWithImage/
          hugo --logLevel=info --baseURL= --themesDir=../../../
          hugo --environment=development --logLevel=info --baseURL= --themesDir=../../../
      - name: Upload Hugo example site with image
        uses: actions/upload-artifact@v4
@@ -35,7 +35,7 @@
      - name: Build Hugo example site with video
        run: |
          cd tests/exampleSiteWithVideo/
          hugo --logLevel=info --baseURL= --themesDir=../../../
          hugo --environment=development --logLevel=info --baseURL= --themesDir=../../../
      - name: Upload Hugo example site with video
        uses: actions/upload-artifact@v4
layouts/partials/head.html
@@ -22,7 +22,7 @@
{{ with .Site.Params.favicon }}<link rel="icon" href="{{ . | absURL }}" />{{ end }}
<!-- Styles -->
{{ if hugo.IsServer }}
{{ if hugo.IsDevelopment }}
  {{ $cssOpts := (dict "targetPath" "css/split.css" "enableSourceMap" true ) }}
  {{ $styles := resources.Get "scss/split.scss" | resources.ExecuteAsTemplate "split.css" . | toCSS $cssOpts }}
  <link rel="stylesheet" href="{{ $styles.RelPermalink }}" media="screen" />
@@ -38,6 +38,6 @@
{{ end }}
<!-- Google Analytics -->
{{ if and (.Site.Config.Services.GoogleAnalytics.ID) (not (in (printf "%#v" .Site.BaseURL) "localhost")) }}
{{ if and (.Site.Config.Services.GoogleAnalytics.ID) (not hugo.IsDevelopment) }}
  {{ template "_internal/google_analytics.html" . }}
{{ end }}
tests/exampleSiteWithImage/docker-compose.desktop.yml
@@ -5,7 +5,7 @@
      - type: bind
        source: ../../../
        target: /src
    command: ["hugo", "server", "--logLevel=info", "--bind=0.0.0.0", "--baseURL=http://hugo", "--disableLiveReload", "--source=/src/hugo-split-theme/tests/exampleSiteWithImage", "--themesDir=/src"]
    command: ["hugo", "server", "--environment=production", "--logLevel=info", "--bind=0.0.0.0", "--baseURL=http://hugo", "--disableLiveReload", "--source=/src/hugo-split-theme/tests/exampleSiteWithImage", "--themesDir=/src"]
    ports:
      - "1313:1313"
tests/exampleSiteWithImage/docker-compose.mobile.yml
@@ -5,7 +5,7 @@
      - type: bind
        source: ../../../
        target: /src
    command: ["hugo", "server", "--logLevel=info", "--bind=0.0.0.0", "--baseURL=http://hugo", "--disableLiveReload", "--source=/src/hugo-split-theme/tests/exampleSiteWithImage", "--themesDir=/src"]
    command: ["hugo", "server", "--environment=production", "--logLevel=info", "--bind=0.0.0.0", "--baseURL=http://hugo", "--disableLiveReload", "--source=/src/hugo-split-theme/tests/exampleSiteWithImage", "--themesDir=/src"]
    ports:
      - "1313:1313"
tests/exampleSiteWithVideo/docker-compose.desktop.yml
@@ -5,7 +5,7 @@
      - type: bind
        source: ../../../
        target: /src
    command: ["hugo", "server", "--logLevel=info", "--bind=0.0.0.0", "--baseURL=http://hugo", "--disableLiveReload", "--source=/src/hugo-split-theme/tests/exampleSiteWithVideo", "--themesDir=/src"]
    command: ["hugo", "server", "--environment=production", "--logLevel=info", "--bind=0.0.0.0", "--baseURL=http://hugo", "--disableLiveReload", "--source=/src/hugo-split-theme/tests/exampleSiteWithVideo", "--themesDir=/src"]
    ports:
      - "1313:1313"
tests/exampleSiteWithVideo/docker-compose.mobile.yml
@@ -5,7 +5,7 @@
      - type: bind
        source: ../../../
        target: /src
    command: ["hugo", "server", "--logLevel=info", "--bind=0.0.0.0", "--baseURL=http://hugo", "--disableLiveReload", "--source=/src/hugo-split-theme/tests/exampleSiteWithVideo", "--themesDir=/src"]
    command: ["hugo", "server", "--environment=production", "--logLevel=info", "--bind=0.0.0.0", "--baseURL=http://hugo", "--disableLiveReload", "--source=/src/hugo-split-theme/tests/exampleSiteWithVideo", "--themesDir=/src"]
    ports:
      - "1313:1313"