Skip to content

Commit

Permalink
impl: use Netlify redirects instead of HTML (#925)
Browse files Browse the repository at this point in the history
Switch to Netlify's HTTP-level redirects instead of HTML-level
`<meta refresh>` redirects. (Historical note: we originally used the
latter because GitHub Pages did not support HTTP-level redirects.)

Advantages:

- Preserves URL fragments.
  Example: slsa.dev/levels#build-l3 no longer drops the `#build-l3`.
- Supports directory redirection path components after the redirect.
  Example: slsa.dev/spec/v1/levels now works.
- Supports temporary redirects (302). The problem with `<meta refresh>`
  is that they are always interpreted as permanent, which is a problem
  when we do a version bump (e.g. /levels -> /spec/v1.0/levels).
- Cleans up our directory tree, which now only contains true content.

Signed-off-by: Mark Lodato <lodato@google.com>
  • Loading branch information
MarkLodato authored Jul 20, 2023
1 parent b72237f commit 46673cf
Show file tree
Hide file tree
Showing 26 changed files with 47 additions and 124 deletions.
7 changes: 0 additions & 7 deletions docs/_layouts/redirect.html

This file was deleted.

49 changes: 47 additions & 2 deletions docs/_redirects
Original file line number Diff line number Diff line change
@@ -1,4 +1,49 @@
# Documentation: https://docs.netlify.com/routing/redirects/redirect-options/
# vim: set sw=4 sts=4:
#
# Guidance:
# - Always specify 301 vs 302. (301 is the default, but better to be explicit.)
# - Only use 301 when it's OK for client to cache indefinitely. Common use case
# is for moved content, e.g. /foo is renamed to /bar.
# - Rule of thumb: if it's an alias, e.g. /foo -> /foo/v1, use 302.
# - Align columns on multiples of 4.

# Convenience aliases for the team. Remember to document on ../README.md.
/gh/* https://github.com/slsa-framework/slsa/:splat
# --- Team-internal convenience aliases ---
#
# Remember to document on ../README.md.

/gh/* https://github.com/slsa-framework/slsa/:splat 301

/notes/community https://docs.google.com/document/d/1JbJZxeZOWE7rxT24iEozX35LIUl_Yoqd-DeSm6309GA/edit 302
/notes/positioning https://docs.google.com/document/d/1tpPOXVzNSwtpWA7cXhTPLAO6HIP50obUvoP85XqgVHM/edit 302
/notes/spec https://docs.google.com/document/d/1PwhekVB1iDpcgCQRNVN_aesoVdOiTruoebCs896aGxw/edit 302
/notes/specification https://docs.google.com/document/d/1PwhekVB1iDpcgCQRNVN_aesoVdOiTruoebCs896aGxw/edit 302
/notes/tooling https://docs.google.com/document/d/18oj3CLJQhZj1dMHKDTq_1kKg0syysKCS7pLyXlw1SRc/edit 302

# --- Page renames and user-facing convenience aliases ---

# Quick links to the latest version.
/faq /spec/v1.0/faq 302
/levels /spec/v1.0/levels 302
/terminology /spec/v1.0/terminology 302
/threats /spec/v1.0/threats 302
/use-cases /spec/v1.0/use-cases 302

# Renamed files.
/getinvolved /community 301

/github-actions-workflow https://slsa-framework.github.io/github-actions-buildtypes/workflow/v1 301
/github-actions-workflow/v1-rc1 https://slsa-framework.github.io/github-actions-buildtypes/workflow/v1 301
/github-actions-workflow/v1 https://slsa-framework.github.io/github-actions-buildtypes/workflow/v1 301
/github-actions-workflow/v1.0 https://slsa-framework.github.io/github-actions-buildtypes/workflow/v1 301

/provenance /provenance/v1 302
/provenance/v0.2-draft /provenance/v0.2 301
/provenance/v1.0 /provenance/v1 302

/spec /spec/v1.0 302
/spec/faq /spec/v1.0/faq 302
/spec/v1/* /spec/v1.0/:splat 302

/verification_summary /verification_summary/v1 302
/verification_summary/v1.0 /verification_summary/v1 302
5 changes: 0 additions & 5 deletions docs/faq.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/getinvolved.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/github-actions-workflow/index.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/github-actions-workflow/v1-rc1.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/github-actions-workflow/v1.0.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/github-actions-workflow/v1.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/levels.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/notes/community.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/notes/positioning.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/notes/spec.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/notes/specification.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/notes/tooling.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/provenance/index.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/provenance/v0.2-draft.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/provenance/v1.0.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/requirements.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/spec/faq.md

This file was deleted.

4 changes: 0 additions & 4 deletions docs/spec/index.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/spec/v1.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/terminology.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/threats.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/use-cases.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/verification_summary/index.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/verification_summary/v1.0.md

This file was deleted.

0 comments on commit 46673cf

Please sign in to comment.