Skip to content

Commit 8fadf93

Browse files
committed
w
Signed-off-by: Patrice Chalin <[email protected]>
1 parent f073e46 commit 8fadf93

File tree

5 files changed

+47
-7
lines changed

5 files changed

+47
-7
lines changed

content/en/_index.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
---
22
title: in-toto
3+
outputs:
4+
- HTML
5+
- REDIRECTS # Include this `content/en` ONLY
36
description: A framework to secure the integrity of software supply chains
47
---
58

content/en/about.md

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: About in-toto
33
linkTitle: About
44
menu: { main: { weight: 10 } }
5+
aliases: [/in-toto]
56
---
67

78
{{% blocks/cover title="About in-toto" height="auto" %}}

content/en/docs/specs.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
title: Specifications
33
linkTitle: Specs
4+
aliases: [/specs]
45
weight: 70
56
---
67

hugo.yaml

+10-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
baseURL: https://in-toto.io
22
title: in-toto
33

4-
# cSpell:ignore Catmull Libera noopener
4+
# cSpell:ignore AFRL Catmull DARPA docsy Libera noopener
55

66
disableKinds: [taxonomy]
77
theme: [docsy]
@@ -13,9 +13,16 @@ enableGitInfo: true
1313

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

16+
mediaTypes:
17+
text/netlify: {}
18+
19+
outputFormats:
20+
REDIRECTS:
21+
mediaType: text/netlify
22+
baseName: _redirects
23+
notAlternative: true
24+
1625
outputs:
17-
home: [HTML]
18-
page: [HTML]
1926
section: [HTML]
2027

2128
imaging:

static/_redirects layouts/index.redirects

+32-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
# Netlify redirects. See https://www.netlify.com/docs/redirects/
2+
{{/* cSpell:ignore cond wordmark */ -}}
3+
14
# No versions mentioned in the spec so assume v0.1
2-
Envelope/v0.1 https://github.com/in-toto/attestation/tree/v0.1.0/spec#envelope
3-
Predicate/v0.1 https://github.com/in-toto/attestation/tree/v0.1.0/spec#predicate
5+
Envelope/v0.1 https://github.com/in-toto/attestation/tree/v0.1.0/spec#envelope
6+
Predicate/v0.1 https://github.com/in-toto/attestation/tree/v0.1.0/spec#predicate
47

58
# Below version numbers are in the spec at the v0.1.0 tag.
69
Statement/v0.1 https://github.com/in-toto/attestation/tree/v0.1.0/spec#statement
@@ -9,8 +12,8 @@ Provenance/v0.1.0 https://github.com/in-toto/attestation/tree/v0.1.0/spec/predic
912
SPDX/v1.0.0 https://github.com/in-toto/attestation/blob/v0.1.0/spec/predicates/spdx.md
1013

1114
# Bonus: v0.1.0 <-> v0.1
12-
Envelope/v0.1.0 https://github.com/in-toto/attestation/tree/v0.1.0/spec#envelope
13-
Predicate/v0.1.0 https://github.com/in-toto/attestation/tree/v0.1.0/spec#predicate
15+
Envelope/v0.1.0 https://github.com/in-toto/attestation/tree/v0.1.0/spec#envelope
16+
Predicate/v0.1.0 https://github.com/in-toto/attestation/tree/v0.1.0/spec#predicate
1417
Provenance/v0.1 https://github.com/in-toto/attestation/tree/v0.1.0/spec/predicates/provenance.md
1518
Statement/v0.1.0 https://github.com/in-toto/attestation/tree/v0.1.0/spec#statement
1619

@@ -37,3 +40,28 @@ attestation/test-result/v* https://github.com/in-toto/attestation/tree/main/spec
3740

3841
attestation/vulns https://github.com/in-toto/attestation/tree/main/spec/predicates/vuln.md
3942
attestation/vulns/v* https://github.com/in-toto/attestation/tree/main/spec/predicates/vuln.md
43+
44+
{{ range $p := .Site.Pages -}}
45+
46+
{{ range $p.Aliases -}}
47+
{{ $alias := cond (strings.HasPrefix . "/")
48+
.
49+
(partial "relative-redirects-alias" (dict "alias" . "p" $p.Parent)) -}}
50+
{{ $alias | printf "%-35s" }} {{ $p.RelPermalink }}
51+
{{ end -}}
52+
53+
{{ end }}{{/* range $p */ -}}
54+
55+
{{- define "partials/relative-redirects-alias" -}}
56+
{{ $result := "" }}
57+
{{ if strings.HasPrefix .alias "../" }}
58+
{{ $result = (partial "relative-redirects-alias"
59+
(dict
60+
"alias" (strings.TrimPrefix "../" .alias)
61+
"p" .p.Parent ))
62+
}}
63+
{{ else }}
64+
{{ $result = path.Join .p.RelPermalink .alias }}
65+
{{ end }}
66+
{{ return $result }}
67+
{{ end }}

0 commit comments

Comments
 (0)