Skip to content

Commit

Permalink
Use Netlify redirects instead of Hugo aliases (#836)
Browse files Browse the repository at this point in the history
  • Loading branch information
chalin authored Oct 17, 2021
1 parent 1db3ac2 commit a1e6b14
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
17 changes: 16 additions & 1 deletion config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
baseURL: https://opentelemetry.io
disableKinds: [taxonomy, taxonomyTerm]
theme: [docsy]

disableAliases: true # We do redirects via Netlify's _redirects file
enableGitInfo: true

# Language settings
Expand Down Expand Up @@ -33,6 +33,19 @@ markup:
highlight:
style: tango

# Netlify _redirects file
mediaTypes:
text/netlify: {}

outputFormats:
REDIRECTS:
mediaType: text/netlify
baseName: _redirects
notAlternative: true

outputs:
home: [HTML, REDIRECTS, RSS]

permalinks:
blog: /:section/:year/:month/:day/:slug/

Expand All @@ -51,11 +64,13 @@ params:
github_repo: https://github.com/open-telemetry/opentelemetry.io
github_branch: main
gcs_engine_id: bde3d634eca9cd335

ui:
navbar_logo: true
navbar_translucent_over_cover_disable: true
sidebar_search_disable: true
footer_about_disable: true

links:
user:
- name: Mailing Lists
Expand Down
6 changes: 6 additions & 0 deletions layouts/index.redirects
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Netlify redirects. See https://www.netlify.com/docs/redirects/
{{ range $p := .Site.Pages -}}
{{ range .Aliases -}}
{{ . | printf "%-35s" }} {{ $p.RelPermalink }}
{{ end -}}
{{ end -}}

0 comments on commit a1e6b14

Please sign in to comment.