File tree Expand file tree Collapse file tree
themes/cfbs-theme/layouts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ variables:
66 # build.js authenticates to the GitHub API with this token to avoid rate limits.
77 # The multiplatform buildx job reads EXTRA_DOCKER_ARGS (not the legacy inline
88 # --build-arg), so pass the token through there.
9- EXTRA_DOCKER_ARGS : " --build-arg GITHUB_USERNAME_TOKEN"
9+ EXTRA_DOCKER_ARGS : " --build-arg GITHUB_USERNAME_TOKEN --build-arg SEARCH_ENGINES_DISABLED=false " # do not disable search engines by default
1010 DOCKER_HOST :
1111 value : ' tcp://docker:2376'
1212 description : " Required to run dind inside k8s runners with TLS"
@@ -39,6 +39,9 @@ build:docker:
3939
4040build:docker-multiplatform :
4141 rules :
42+ - if : ' $CI_COMMIT_BRANCH == "master"'
43+ variables :
44+ EXTRA_DOCKER_ARGS : " --build-arg GITHUB_USERNAME_TOKEN --build-arg SEARCH_ENGINES_DISABLED=true" # disable if the branch is master (staging)
4245 - if : ' $CI_COMMIT_BRANCH =~ /^(master|production)$/'
4346
4447publish:image :
Original file line number Diff line number Diff line change 11FROM node:26-alpine AS build
22ARG GITHUB_USERNAME_TOKEN
3+
4+ ARG SEARCH_ENGINES_DISABLED
5+ ENV HUGO_PARAMS_SEARCHENGINES_DISABLED=$SEARCH_ENGINES_DISABLED
6+
37WORKDIR /build-website
48ADD https://github.com/gohugoio/hugo/releases/download/v0.167.0/hugo_0.167.0_Linux-64bit.tar.gz hugo.tar.gz
59RUN echo "4d84519b9f619e6d4c3fb45a50157abeabeb724f859c60605f44c23def6e1169 hugo.tar.gz" | sha256sum -c
Original file line number Diff line number Diff line change @@ -6,6 +6,12 @@ theme = "cfbs-theme"
66enableRobotsTXT = true
77syntaxCSS = true
88
9+ # this parameter is set by Hugo from HUGO_PARAMS_SEARCHENGINES_DISABLED environment variable
10+ # that we define on the build stage
11+ # it is false by defaut to avoid a case when it was accedntly not defined
12+ [params .searchengines ]
13+ disabled = false
14+
915# Number of posts per page
1016[pagination ]
1117pagerSize = 10
Original file line number Diff line number Diff line change 1+ User-agent: *
2+ {{ if .Site .Params .searchengines .disabled }}Disallow : /{{ end }}
You can’t perform that action at this time.
0 commit comments