Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
fix: compare base url with list of full urls
Browse files Browse the repository at this point in the history
  • Loading branch information
XavierChanth committed Nov 7, 2022
1 parent 7f752f9 commit 4729e18
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions config/_default/params.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
ProductionURLs:
- 'https://docs.atsign.com/'

# Theme Color for Chrome Browser

themeColor: '#fff'
Expand Down
2 changes: 1 addition & 1 deletion layouts/docs/codelab.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ define "main" }} {{ $section := .CurrentSection }} {{ $page := .Page }}
{{ .Scratch.Set "class" "codelab" }}
{{ if eq .CurrentSection.Params.layout "codelab-list" }}
{{ if ne (.Site.BaseURL) "https://docs.atsign.com" -}}
{{ if not (in .Site.Params.ProductionURLs (string .Site.BaseURL)) -}}
{{ $options := (dict "targetPath" "codelab.css" "enableSourceMap" true "includePaths" (slice "node_modules")) -}}
{{ $css := resources.Get "scss/codelab.scss" | toCSS $options -}}
<link rel="stylesheet" href="{{ $css.Permalink | relURL }}">
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/footer/script-footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@

{{ $js := $slice | resources.Concat "main.js" -}}

{{ if ne (.Site.BaseURL) "https://docs.atsign.com" -}}
{{ if not (in .Site.Params.ProductionURLs (string .Site.BaseURL)) -}}
{{ if .Site.Params.options.bootStrapJs -}}
<script src="{{ $bs.RelPermalink }}" defer></script>
{{ end -}}
Expand Down
2 changes: 1 addition & 1 deletion layouts/partials/head/script-header.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{ $alertInit := resources.Get "js/alert-init.js" | js.Build | minify -}}
<script>{{ $alertInit.Content | safeJS }}</script>
{{- end -}}
{{ if eq (.Site.BaseURL) "https://docs.atsign.com" -}}
{{ if in .Site.Params.ProductionURLs (string .Site.BaseURL) -}}
{{ $matomo := resources.Get "js/matomo.js" | js.Build | minify -}}
<script>{{ $matomo.Content | safeJS }}</script>
{{ end -}}
2 changes: 1 addition & 1 deletion layouts/robots.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
User-agent: *
{{ if eq (.Site.BaseURL) "https://docs.atsign.com" -}}
{{ if in .Site.Params.ProductionURLs (string .Site.BaseURL) -}}
Allow: /
{{ else -}}
Disallow: /
Expand Down
2 changes: 1 addition & 1 deletion layouts_docs/_default/codelab.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{ define "main" }} {{ $section := .CurrentSection }} {{ $page := .Page }}
{{ .Scratch.Set "class" "codelab" }}
{{ if eq .CurrentSection.Params.layout "codelab-list" }}
{{ if ne (.Site.BaseURL) "https://docs.atsign.com" -}}
{{ if not (in .Site.Params.ProductionURLs (string .Site.BaseURL)) -}}
{{ $options := (dict "targetPath" "codelab.css" "enableSourceMap" true "includePaths" (slice "node_modules")) -}}
{{ $css := resources.Get "scss/codelab.scss" | toCSS $options -}}
<link rel="stylesheet" href="{{ $css.Permalink | relURL }}">
Expand Down

0 comments on commit 4729e18

Please sign in to comment.