Skip to content

Commit

Permalink
download: redirect to docs/introduction/installation
Browse files Browse the repository at this point in the history
This change unifies our handling of install-related URLs/docs, suitable
for go-live, but allowing each affected URL to have unique content
written for it as & when we choose.

It does this by:

- re-enabling Hugo's "aliases" (client-side redirects)
- teaching /docs/introduction/installation that it has these aliases:
  - /docs/install
  - /download
  - /install
  - /dl
- removing the Netlify-level redirection of /download to /docs/install
  (which was a 404 until this change)

These aliases' redirections will get overwritten by any page content
that's created for the above 4 URLs in the future, as per
https://gohugo.io/content-management/urls/#how-aliases-work. So,
*unlike* the Netlify redirect, future content authors won't have to
figure out why content added at /download doesn't get served.

There should be no SEO impact, as the client-side redirect provides a
"canonical" link element alongside a meta robots element that should
stop the alias getting indexed.

The only consumer who will be affected by this change will be those
using user-agents that don't follow or expose meta-based redirections
(`http-equiv="refresh"`), such as Curl. Given the human-centric nature
of this page's content, this doesn't seem onerous.

For: cue-lang/docs-and-content#52
For: cue-lang/docs-and-content#63
Preview-Path: /docs/install
Preview-Path: /download
Preview-Path: /install
Preview-Path: /dl
Change-Id: I99a04f6a1520dd309f1cc00751ac00abc31e7b28
Signed-off-by: Jonathan Matthews <github@hello.jonathanmatthews.com>
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cuelang.org/+/1168925
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Paul Jolly <paul@myitcv.io>
  • Loading branch information
jpluscplusm committed Sep 20, 2023
1 parent 1af38a8 commit 8b8bea3
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 10 deletions.
5 changes: 5 additions & 0 deletions content/docs/introduction/installation/en.md
@@ -1,6 +1,11 @@
---
title: Installation
weight: 20
aliases:
- /docs/install
- /download
- /install
- /dl
---

The Go APIs for CUE are defined in the
Expand Down
6 changes: 5 additions & 1 deletion hugo/config/_default/config.toml
Expand Up @@ -9,7 +9,11 @@ enableMissingTranslationPlaceholders = true # Useful when translating
enableRobotsTXT = true # Render robots.txt
enableGitInfo = true # Will give git-info values to .Lastmod etc.
disableKinds = ["RSS", "taxonomy", "term"]
disableAliases = true # We use Netlify server-side redirects instead of generated aliases

# We use Netlify server-side redirects instead of generated aliases,
# but the 2 aren't mutually exclusive. Allow Hugo to generate aliases
# if requested.
disableAliases = false

# Hugo allows theme composition (and inheritance). Precedence is from left to right.
# theme = ["docsy"]
Expand Down
5 changes: 5 additions & 0 deletions hugo/content/en/docs/introduction/installation/index.md
@@ -1,6 +1,11 @@
---
title: Installation
weight: 20
aliases:
- /docs/install
- /download
- /install
- /dl
---

The Go APIs for CUE are defined in the
Expand Down
3 changes: 0 additions & 3 deletions internal/ci/netlify/netlify.cue
Expand Up @@ -80,9 +80,6 @@ config: #config & {
}, {
from: "/issue/*"
to: "https://github.com/cue-lang/cue/issues/:splat"
}, {
from: "/download"
to: "/docs/install"
}, {
from: "/issues/*"
to: "https://github.com/cue-lang/cue/issues/:splat"
Expand Down
6 changes: 0 additions & 6 deletions netlify.toml
Expand Up @@ -50,12 +50,6 @@
status = 302
force = true

[[redirects]]
from = "/download"
to = "/docs/install"
status = 302
force = true

[[redirects]]
from = "/issues/*"
to = "https://github.com/cue-lang/cue/issues/:splat"
Expand Down

0 comments on commit 8b8bea3

Please sign in to comment.