Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Netlify redirects instead of Hugo aliases #836

Merged
merged 1 commit into from
Oct 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 -}}