Skip to content

Commit

Permalink
docs(fix): Fix broken links, add CI to check (#2156)
Browse files Browse the repository at this point in the history
Signed-off-by: Dave Henderson <[email protected]>
  • Loading branch information
hairyhenderson authored Jun 29, 2024
1 parent c9643ca commit bdf4f8c
Show file tree
Hide file tree
Showing 47 changed files with 449 additions and 416 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,36 @@ jobs:
echo "Function docs are out of date. Please run 'make gen-func-docs' locally and commit the changes."
exit 1
fi
muffet:
runs-on: ubuntu-latest
steps:
- name: Hugo setup
uses: peaceiris/[email protected]
with:
# keep this in sync with netlify.toml
hugo-version: '0.128.0'
- uses: actions/checkout@v4
- name: Install muffet
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release --repo raviqqe/muffet download -p muffet_linux_amd64.tar.gz
tar xvf muffet_linux_amd64.tar.gz muffet
sudo mv muffet /usr/local/bin
- name: Serve the site and check links
run: |
set -ex
cd docs
hugo --renderToMemory
hugo serve --watch=false --renderToMemory &
sleep 2
muffet http://localhost:1313 \
-r8 --max-connections-per-host=4 --buffer-size=8192 \
--exclude="https://github\.com.*" \
--exclude="https://docs\.aws.*" \
--exclude="https://linux.die\.net.*" \
--exclude="https://jqplay\.org.*" \
kill %1
20 changes: 10 additions & 10 deletions docs-src/content/functions/aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ funcs:
alias: ec2meta
released: v1.8.0
description: |
Queries AWS [EC2 Instance Metadata](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) for information. This only retrieves data in the `meta-data` path -- for data in the `dynamic` path use `aws.EC2Dynamic`.
Queries AWS [EC2 Instance Metadata](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) for information. This only retrieves data in the `meta-data` path -- for data in the `dynamic` path use `aws.EC2Dynamic`.
For times when running outside EC2, or when the metadata API can't be reached, a `default` value can be provided.
pipeline: false
Expand All @@ -42,7 +42,7 @@ funcs:
alias: ec2dynamic
released: v1.8.0
description: |
Queries AWS [EC2 Instance Dynamic Metadata](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) for information. This only retrieves data in the `dynamic` path -- for data in the `meta-data` path use `aws.EC2Meta`.
Queries AWS [EC2 Instance Dynamic Metadata](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) for information. This only retrieves data in the `dynamic` path -- for data in the `meta-data` path use `aws.EC2Meta`.
For times when running outside EC2, or when the metadata API can't be reached, a `default` value can be provided.
pipeline: false
Expand Down Expand Up @@ -86,7 +86,7 @@ funcs:
alias: ec2tag
released: v3.8.0
description: |
Queries the AWS EC2 API to find the value of the given [user-defined tag](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). An optional default
Queries the AWS EC2 API to find the value of the given [user-defined tag](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). An optional default
can be provided.
pipeline: false
arguments:
Expand All @@ -107,7 +107,7 @@ funcs:
alias: ec2tags
released: v3.8.0
description: |
Queries the AWS EC2 API to find all the tags/values [user-defined tag](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html).
Queries the AWS EC2 API to find all the tags/values [user-defined tag](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html).
pipeline: false
arguments:
examples:
Expand Down Expand Up @@ -138,7 +138,7 @@ funcs:
See [the AWS documentation](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html)
for more details.
See also [`aws.KMSDecrypt`](#aws-kmsdecrypt).
See also [`aws.KMSDecrypt`](#awskmsdecrypt).
pipeline: true
arguments:
- name: keyID
Expand All @@ -162,7 +162,7 @@ funcs:
See [the AWS documentation](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html)
for more details.
See also [`aws.KMSEncrypt`](#aws-kmsencrypt).
See also [`aws.KMSEncrypt`](#awskmsencrypt).
pipeline: true
arguments:
- name: input
Expand All @@ -179,7 +179,7 @@ funcs:
Wraps the [STS GetCallerIdentity API](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html)
See also [`aws.UserID`](#aws-userid) and [`aws.ARN`](#aws-arn).
See also [`aws.UserID`](#awsuserid) and [`aws.ARN`](#awsarn).
pipeline: false
examples:
- |
Expand All @@ -192,7 +192,7 @@ funcs:
Wraps the [STS GetCallerIdentity API](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html)
See also [`aws.UserID`](#aws-userid) and [`aws.Account`](#aws-account).
See also [`aws.UserID`](#awsuserid) and [`aws.Account`](#awsaccount).
pipeline: false
examples:
- |
Expand All @@ -203,12 +203,12 @@ funcs:
description: |
Returns the unique identifier of the calling entity. The exact value
depends on the type of entity making the call. The values returned are those
listed in the `aws:userid` column in the [Principal table](http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable)
listed in the `aws:userid` column in the [Principal table](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable)
found on the Policy Variables reference page in the IAM User Guide.
Wraps the [STS GetCallerIdentity API](https://docs.aws.amazon.com/STS/latest/APIReference/API_GetCallerIdentity.html)
See also [`aws.ARN`](#aws-arn) and [`aws.Account`](#aws-account).
See also [`aws.ARN`](#awsarn) and [`aws.Account`](#awsaccount).
pipeline: false
examples:
- |
Expand Down
4 changes: 2 additions & 2 deletions docs-src/content/functions/base64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ funcs:
Decode a Base64 string. This supports both standard ([RFC4648 &sect;4](https://tools.ietf.org/html/rfc4648#section-4)) and URL-safe ([RFC4648 &sect;5](https://tools.ietf.org/html/rfc4648#section-5)) encodings.
This function outputs the data as a string, so it may not be appropriate
for decoding binary data. Use [`base64.DecodeBytes`](#base64.DecodeBytes)
for decoding binary data. Use [`base64.DecodeBytes`](#base64decodebytes)
for binary data.
pipeline: true
arguments:
Expand All @@ -44,7 +44,7 @@ funcs:
This function outputs the data as a byte array, so it's most useful for
outputting binary data that will be processed further.
Use [`base64.Decode`](#base64.Decode) to output a plain string.
Use [`base64.Decode`](#base64decode) to output a plain string.
pipeline: false
arguments:
- name: input
Expand Down
20 changes: 10 additions & 10 deletions docs-src/content/functions/coll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ funcs:
All keys are converted to strings.
This function is equivalent to [Sprig's `dict`](http://masterminds.github.io/sprig/dicts.html#dict)
function, as used in [Helm templates](https://docs.helm.sh/chart_template_guide#template-functions-and-pipelines).
function, as used in [Helm templates](https://helm.sh/docs/chart_template_guide/functions_and_pipelines/).
For creating more complex maps, see [`data.JSON`](../data/#data-json) or [`data.YAML`](../data/#data-yaml).
For creating more complex maps, see [`data.JSON`](../data/#datajson) or [`data.YAML`](../data/#datayaml).
For creating arrays, see [`coll.Slice`](#coll-slice).
For creating arrays, see [`coll.Slice`](#collslice-_deprecated_).
arguments:
- name: in...
required: true
Expand Down Expand Up @@ -63,7 +63,7 @@ funcs:
- name: coll.GoSlice
released: v4.0.0
description: |
This exposes the `slice` function from Go's [`text/template`](https://golang.org/pkg/text/template/#hdr-Functions)
This exposes the `slice` function from Go's [`text/template`](https://pkg.go.dev/text/template/#hdr-Functions)
package. Note that using `slice` will use the `coll.Slice` function instead,
which may not be desired.
For some background on this, see [this issue](https://github.com/hairyhenderson/gomplate/issues/1461).
Expand Down Expand Up @@ -209,7 +209,7 @@ funcs:
The keys will be ordered first by map position (if multiple maps are given),
then alphabetically.
See also [`coll.Values`](#coll-values).
See also [`coll.Values`](#collvalues).
pipeline: true
arguments:
- name: in...
Expand All @@ -230,7 +230,7 @@ funcs:
The values will be ordered first by map position (if multiple maps are given),
then alphabetically by key.
See also [`coll.Keys`](#coll-keys).
See also [`coll.Keys`](#collkeys).
pipeline: true
arguments:
- name: in...
Expand All @@ -250,7 +250,7 @@ funcs:
_Note that this function does not change the given list; it always produces a new one._
See also [`coll.Prepend`](#coll-prepend).
See also [`coll.Prepend`](#collprepend).
pipeline: true
arguments:
- name: value
Expand All @@ -271,7 +271,7 @@ funcs:
_Note that this function does not change the given list; it always produces a new one._
See also [`coll.Append`](#coll-append).
See also [`coll.Append`](#collappend).
pipeline: true
arguments:
- name: value
Expand Down Expand Up @@ -412,7 +412,7 @@ funcs:
The keys can either be separate arguments, or a slice (since v4.0.0).
This is the inverse of [`coll.Omit`](#coll-omit).
This is the inverse of [`coll.Omit`](#collomit).
_Note that this function does not modify the input._
pipeline: true
Expand Down Expand Up @@ -440,7 +440,7 @@ funcs:
The keys can either be separate arguments, or a slice (since v4.0.0).
This is the inverse of [`coll.Pick`](#coll-pick).
This is the inverse of [`coll.Pick`](#collpick).
_Note that this function does not modify the input._
pipeline: true
Expand Down
44 changes: 22 additions & 22 deletions docs-src/content/functions/conv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ funcs:
alias: bool
released: v0.2.0
description: |
**Note:** See also [`conv.ToBool`](#conv-tobool) for a more flexible variant.
**Note:** See also [`conv.ToBool`](#convtobool) for a more flexible variant.
Converts a true-ish string to a boolean. Can be used to simplify conditional statements based on environment variables or other text input.
pipeline: true
Expand Down Expand Up @@ -38,7 +38,7 @@ funcs:
Note that this will not provide a default for the case where the input is undefined
(i.e. referencing things like `.foo` where there is no `foo` field of `.`), but
[`conv.Has`](#conv-has) can be used for that.
[`coll.Has`](../coll/#collhas) can be used for that.
pipeline: true
arguments:
- name: default
Expand All @@ -52,7 +52,7 @@ funcs:
$ gomplate -i '{{ "" | default "foo" }} {{ "bar" | default "baz" }}'
foo bar
- name: conv.Dict
deprecated: Renamed to [`coll.Dict`](#coll-dict)
deprecated: Renamed to [`coll.Dict`](../coll/#colldict)
alias: dict
released: v3.0.0
description: |
Expand All @@ -64,11 +64,11 @@ funcs:
All keys are converted to strings.
This function is equivalent to [Sprig's `dict`](http://masterminds.github.io/sprig/dicts.html#dict)
function, as used in [Helm templates](https://docs.helm.sh/chart_template_guide#template-functions-and-pipelines).
function, as used in [Helm templates](https://helm.sh/docs/chart_template_guide/functions_and_pipelines/).
For creating more complex maps, see [`data.JSON`](../data/#data-json) or [`data.YAML`](../data/#data-yaml).
For creating more complex maps, see [`data.JSON`](../data/#datajson) or [`data.YAML`](../data/#datayaml).
For creating arrays, see [`coll.Slice`](#coll-slice).
For creating arrays, see [`coll.Slice`](../coll/#collslice-_deprecated_).
arguments:
- name: in...
required: true
Expand All @@ -89,7 +89,7 @@ funcs:
Hello world!
Hello everybody!
- name: conv.Slice
deprecated: Renamed to [`coll.Slice`](#coll-slice)
deprecated: Renamed to [`coll.Slice`](../coll/#collslice-_deprecated_)
alias: slice
released: v0.3.0
description: |
Expand All @@ -106,7 +106,7 @@ funcs:
Hello, Lisa
Hello, Maggie
- name: conv.Has
deprecated: Renamed to [`coll.Has`](#coll-has)
deprecated: Renamed to [`coll.Has`](../coll/#collhas)
alias: has
released: v1.5.0
description: |
Expand Down Expand Up @@ -153,7 +153,7 @@ funcs:
alias: urlParse
released: v2.0.0
description: |
Parses a string as a URL for later use. Equivalent to [url.Parse](https://golang.org/pkg/net/url/#Parse)
Parses a string as a URL for later use. Equivalent to [url.Parse](https://pkg.go.dev/net/url/#Parse)
Any of `url.URL`'s methods can be called on the result.
arguments:
Expand Down Expand Up @@ -185,9 +185,9 @@ funcs:
- name: conv.ParseInt
released: v1.4.0
description: |
_**Note:**_ See [`conv.ToInt64`](#conv-toint64) instead for a simpler and more flexible variant of this function.
_**Note:**_ See [`conv.ToInt64`](#convtoint64) instead for a simpler and more flexible variant of this function.
Parses a string as an int64. Equivalent to [strconv.ParseInt](https://golang.org/pkg/strconv/#ParseInt)
Parses a string as an int64. Equivalent to [strconv.ParseInt](https://pkg.go.dev/strconv/#ParseInt)
rawExamples:
- |
_`input.tmpl`:_
Expand All @@ -204,9 +204,9 @@ funcs:
- name: conv.ParseFloat
released: v1.4.0
description: |
_**Note:**_ See [`conv.ToFloat`](#conv-tofloat) instead for a simpler and more flexible variant of this function.
_**Note:**_ See [`conv.ToFloat64`](#convtofloat64) instead for a simpler and more flexible variant of this function.
Parses a string as an float64 for later use. Equivalent to [strconv.ParseFloat](https://golang.org/pkg/strconv/#ParseFloat)
Parses a string as an float64 for later use. Equivalent to [strconv.ParseFloat](https://pkg.go.dev/strconv/#ParseFloat)
rawExamples:
- |
_`input.tmpl`:_
Expand All @@ -224,7 +224,7 @@ funcs:
- name: conv.ParseUint
released: v1.4.0
description: |
Parses a string as an uint64 for later use. Equivalent to [strconv.ParseUint](https://golang.org/pkg/strconv/#ParseUint)
Parses a string as an uint64 for later use. Equivalent to [strconv.ParseUint](https://pkg.go.dev/strconv/#ParseUint)
rawExamples:
- |
_`input.tmpl`:_
Expand All @@ -241,9 +241,9 @@ funcs:
- name: conv.Atoi
released: v1.4.0
description: |
_**Note:**_ See [`conv.ToInt`](#conv-toint) and [`conv.ToInt64`](#conv-toint64) instead for simpler and more flexible variants of this function.
_**Note:**_ See [`conv.ToInt`](#convtoint) and [`conv.ToInt64`](#convtoint64) instead for simpler and more flexible variants of this function.
Parses a string as an int for later use. Equivalent to [strconv.Atoi](https://golang.org/pkg/strconv/#Atoi)
Parses a string as an int for later use. Equivalent to [strconv.Atoi](https://pkg.go.dev/strconv/#Atoi)
rawExamples:
- |
_`input.tmpl`:_
Expand Down Expand Up @@ -324,7 +324,7 @@ funcs:
released: v2.2.0
description: |
Converts the input to an `int` (signed integer, 32- or 64-bit depending
on platform). This is similar to [`conv.ToInt64`](#conv-toint64) on 64-bit
on platform). This is similar to [`conv.ToInt64`](#convtoint64) on 64-bit
platforms, but is useful when input to another function must be provided
as an `int`.
Expand All @@ -335,7 +335,7 @@ funcs:
[CWE-190](https://cwe.mitre.org/data/definitions/190.html) and
[CWE-681](https://cwe.mitre.org/data/definitions/681.html).
See also [`conv.ToInt64`](#conv-toint64).
See also [`conv.ToInt64`](#convtoint64).
arguments:
- name: in
required: true
Expand All @@ -357,7 +357,7 @@ funcs:
Unconvertable inputs will result in errors.
This delegates to [`conv.ToInt64`](#conv-toint64) for each input argument.
This delegates to [`conv.ToInt64`](#convtoint64) for each input argument.
arguments:
- name: in...
required: true
Expand All @@ -373,7 +373,7 @@ funcs:
Unconvertable inputs will result in errors.
This delegates to [`conv.ToInt`](#conv-toint) for each input argument.
This delegates to [`conv.ToInt`](#convtoint) for each input argument.
arguments:
- name: in...
required: true
Expand Down Expand Up @@ -409,7 +409,7 @@ funcs:
Unconvertable inputs will result in errors.
This delegates to [`conv.ToFloat64`](#conv-tofloat64) for each input argument.
This delegates to [`conv.ToFloat64`](#convtofloat64) for each input argument.
arguments:
- name: in...
required: true
Expand Down Expand Up @@ -441,7 +441,7 @@ funcs:
description: |
Converts the inputs (of any type) to an array of `string`s
This delegates to [`conv.ToString`](#conv-tostring) for each input argument.
This delegates to [`conv.ToString`](#convtostring) for each input argument.
arguments:
- name: in...
required: true
Expand Down
Loading

0 comments on commit bdf4f8c

Please sign in to comment.