From eeae6bc997b19b5e25415740b3b68424adde6e8c Mon Sep 17 00:00:00 2001 From: Andreas Hnida Date: Thu, 18 Apr 2024 14:27:33 +0200 Subject: [PATCH] reverted changes for environment variable --- .gitea/workflows/build-and-deploy-pipeline.yaml | 4 ++-- hugo.toml | 4 ++++ readme.md | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitea/workflows/build-and-deploy-pipeline.yaml b/.gitea/workflows/build-and-deploy-pipeline.yaml index d13af32..e54a3e6 100644 --- a/.gitea/workflows/build-and-deploy-pipeline.yaml +++ b/.gitea/workflows/build-and-deploy-pipeline.yaml @@ -15,8 +15,8 @@ jobs: uses: SebRollen/toml-action@v1.2.0 id: read_toml with: - file: './config/_default/params.toml' - field: 'environment' + file: 'hugo.toml' + field: 'params.environment' - name: Echo environment run: echo "Environment is ${{ steps.read_toml.outputs.value }}" diff --git a/hugo.toml b/hugo.toml index 113cddb..5692795 100755 --- a/hugo.toml +++ b/hugo.toml @@ -18,6 +18,10 @@ disableLanguages = ["en"] hasCJKLanguage = false # If hasCJKLanguage true, auto-detect Chinese/Japanese/Korean Languages in the content. see: https://gohugo.io/getting-started/configuration/#hascjklanguage enableRobotsTXT = true +########################### Deployment ############################# +# set to "development" or "production". This deploys the site to the correct environment and sets the robot.txt to disallow all pages when in development mode. +[params] +environment = "development" ########################### Services ############################# [services] diff --git a/readme.md b/readme.md index 284d9ff..68136be 100755 --- a/readme.md +++ b/readme.md @@ -36,7 +36,7 @@ git push -u origin main Deployment is done via Gitea Runners. The deployment is triggered by a push to the `main` branch. The deployment will automatically build the site and deploy it to the production or preview environment. -You can control where the site is deployed by setting the 'params.environment' variable in the `hugo.toml` file. The value should be either `production` or `development`. +You can control where the site is deployed by setting the 'environment' variable in the `hugo.toml` file. The value should be either `production` or `development`. This also controls the creation of the robots.txt file. If the value is `development`, the robots.txt file will be created with the following content: