mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-30 10:12:40 +00:00
Compare commits
163 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5ff6323320 | |||
| 6d5b44305e | |||
| 1ccd3147a0 | |||
| e40b9fbbcf | |||
| 9cd8fbb332 | |||
| abcc61002a | |||
| 648d00c7d8 | |||
| 8adba648cc | |||
| 6f13430d4a | |||
| 00b46fed8e | |||
| eb9f1eb657 | |||
| 5186e762ac | |||
| e321c3502a | |||
| 255e0a9718 | |||
| 558f3258a7 | |||
| 6580cd30ad | |||
| 7617de86cd | |||
| d19ed4d4e6 | |||
| 35dec7c96f | |||
| 9f978d387f | |||
| 14d85ec136 | |||
| 171836cdfa | |||
| 9ea7103db7 | |||
| 3fc42da3d0 | |||
| d24da1712f | |||
| 4583b41305 | |||
| 507f4e356b | |||
| a7e721e02d | |||
| 2627b91d3a | |||
| 6d4b012412 | |||
| e536d461a5 | |||
| bfc325f561 | |||
| 36a60f65d0 | |||
| de2fcc5e1d | |||
| 26a8ec207f | |||
| 9ca889ba49 | |||
| e2a624dd6c | |||
| 4fb40ee873 | |||
| bc93a36133 | |||
| 3e5bc6f3b3 | |||
| 7c47036f18 | |||
| 4d07e1fe8a | |||
| 1c41232e61 | |||
| f11ca0fad4 | |||
| 30a18e8825 | |||
| d7a2f3f980 | |||
| b4c5df42ff | |||
| ef12d169c8 | |||
| a62bbfa9ea | |||
| 8d32ca223d | |||
| 5887230b7d | |||
| a4a66b8216 | |||
| 813390b5a2 | |||
| d528bbd6d0 | |||
| af7f6c8b3e | |||
| e70849ea79 | |||
| dd6cd6268d | |||
| 27620daa20 | |||
| 80d2fdbaa0 | |||
| 805cc1773b | |||
| 0bde6931ac | |||
| ac7cffa7e2 | |||
| f11bca5fec | |||
| 9315a2d2c4 | |||
| cee3a56a91 | |||
| da2a8e6402 | |||
| a4892a07b4 | |||
| cb98e9061b | |||
| 5fa97ee964 | |||
| 4d38f47250 | |||
| 80f793c38d | |||
| a9079d7a63 | |||
| 4914b7f18c | |||
| 9e06fd3394 | |||
| 9c2b2414d2 | |||
| ab21433689 | |||
| 23fcfb7f74 | |||
| 47bf2fcbe2 | |||
| 16fb2cae88 | |||
| 2bedcf3d18 | |||
| 935999e2fa | |||
| 20c3bae2c4 | |||
| 29b6e133a8 | |||
| 7f8ab74681 | |||
| 59bcc098cf | |||
| e26ba752d2 | |||
| bcf07fa639 | |||
| b6a7568131 | |||
| acf01bfb78 | |||
| 27b22cd87e | |||
| a2488b1c95 | |||
| 8f60c0c1ec | |||
| 9dc608084b | |||
| a349aafb7f | |||
| b8fbd4a578 | |||
| e2b2092ce6 | |||
| f4df7b88b3 | |||
| 3d9bd404ee | |||
| 5f5e55aa8d | |||
| aaaf1c8df5 | |||
| 0baa4f9837 | |||
| d3d4ab41a9 | |||
| 28d844642a | |||
| eb5fd3127f | |||
| 3ed28e4bfe | |||
| db14238ba3 | |||
| 3f64b5a3de | |||
| 66904097e0 | |||
| e54139c85b | |||
| 3710a5ec7e | |||
| 705e3cd5f5 | |||
| 8c61fd2541 | |||
| d3145e4e5d | |||
| 743a1da3ef | |||
| 123901b741 | |||
| 71fd79a3f4 | |||
| c4a530f104 | |||
| 272484f8bf | |||
| de4e466036 | |||
| c23a0c4a0f | |||
| a95670b981 | |||
| 46bdc03885 | |||
| 5160c7efa5 | |||
| e2dd4cd05f | |||
| e509cac533 | |||
| fd38171810 | |||
| 2eca1b3cc1 | |||
| 625162674d | |||
| a692278bc6 | |||
| d4016dd5cd | |||
| 4910312ee7 | |||
| 1b5f78b6b7 | |||
| d5d0f420d8 | |||
| 5993afa4c5 | |||
| d1b4458536 | |||
| 274852bcf2 | |||
| 37a2d5eb4e | |||
| 4c95389c25 | |||
| 3af8bded26 | |||
| 46da0b7aaa | |||
| 75f56b4ce6 | |||
| d234a963eb | |||
| b84644c008 | |||
| a9d19dbdd6 | |||
| 12d713176f | |||
| 6b65b2fae6 | |||
| 1768684d8b | |||
| 9aec42c545 | |||
| eb0ed33dfd | |||
| 6a246d1152 | |||
| ef0e7149d6 | |||
| c32094ace1 | |||
| a262fd4ddb | |||
| f0d32455d2 | |||
| e8bc8e6d02 | |||
| f9b3c0f486 | |||
| 11fcda971c | |||
| f31375d4cc | |||
| 6415b599be | |||
| 1e9b87f760 | |||
| 275c0acbf6 | |||
| f9163155d3 | |||
| 79a17d9e55 |
@@ -4,7 +4,7 @@ parameters:
|
||||
defaults: &defaults
|
||||
resource_class: large
|
||||
docker:
|
||||
- image: bepsays/ci-hugoreleaser:1.22000.20100
|
||||
- image: bepsays/ci-hugoreleaser:1.22100.20500
|
||||
environment: &buildenv
|
||||
GOMODCACHE: /root/project/gomodcache
|
||||
version: 2
|
||||
@@ -60,7 +60,7 @@ jobs:
|
||||
environment:
|
||||
<<: [*buildenv]
|
||||
docker:
|
||||
- image: bepsays/ci-hugoreleaser-linux-arm64:1.22000.20100
|
||||
- image: bepsays/ci-hugoreleaser-linux-arm64:1.22100.20500
|
||||
steps:
|
||||
- *restore-cache
|
||||
- &attach-workspace
|
||||
|
||||
@@ -30,7 +30,7 @@ jobs:
|
||||
**/go.sum
|
||||
**/go.mod
|
||||
- name: Install Ruby
|
||||
uses: ruby/setup-ruby@ee2113536afb7f793eed4ce60e8d3b26db912da4
|
||||
uses: ruby/setup-ruby@036ef458ddccddb148a2b9fb67e95a22fdbf728b
|
||||
with:
|
||||
ruby-version: '2.7'
|
||||
bundler-cache: true #
|
||||
|
||||
@@ -32,7 +32,7 @@ jobs:
|
||||
**/go.sum
|
||||
**/go.mod
|
||||
- name: Install Ruby
|
||||
uses: ruby/setup-ruby@ee2113536afb7f793eed4ce60e8d3b26db912da4
|
||||
uses: ruby/setup-ruby@036ef458ddccddb148a2b9fb67e95a22fdbf728b
|
||||
with:
|
||||
ruby-version: '2.7'
|
||||
bundler-cache: true #
|
||||
@@ -58,11 +58,11 @@ jobs:
|
||||
brew install pandoc
|
||||
- if: matrix.os == 'windows-latest'
|
||||
run: |
|
||||
Choco-Install -PackageName pandoc
|
||||
choco install pandoc
|
||||
- run: pandoc -v
|
||||
- if: matrix.os == 'windows-latest'
|
||||
run: |
|
||||
Choco-Install -PackageName mingw -ArgumentList "--version","12.2.0","--allow-downgrade"
|
||||
choco install mingw
|
||||
- if: matrix.os == 'ubuntu-latest'
|
||||
name: Install dart-sass Linux
|
||||
run: |
|
||||
|
||||
@@ -122,8 +122,6 @@ cd hugo
|
||||
go install
|
||||
```
|
||||
|
||||
>Note: Some Go tools may not be fully updated to support Go Modules yet. One example would be LiteIDE. Follow [this workaround](https://github.com/visualfc/liteide/issues/986#issuecomment-428117702) for how to continue to work with Hugo below `GOPATH`.
|
||||
|
||||
For some convenient build and test targets, you also will want to install Mage:
|
||||
|
||||
```bash
|
||||
|
||||
@@ -33,7 +33,7 @@ A fast and flexible static site generator built with love by [bep], [spf13], and
|
||||
[](https://github.com/gohugoio/hugo/actions?query=workflow%3ATest)
|
||||
[](https://goreportcard.com/report/github.com/gohugoio/hugo)
|
||||
|
||||
[Website] | [Installation] | [Documentation] | [Support] | [Contributing] | [Twitter]
|
||||
[Website] | [Installation] | [Documentation] | [Support] | [Contributing] | <a rel="me" href="https://fosstodon.org/@gohugoio">Mastodon</a>
|
||||
|
||||
## Overview
|
||||
|
||||
@@ -142,40 +142,40 @@ Hugo stands on the shoulders of great open source libraries. Run `hugo env --log
|
||||
|
||||
```text
|
||||
cloud.google.com/go/compute/metadata="v0.2.3"
|
||||
cloud.google.com/go/iam="v1.1.0"
|
||||
cloud.google.com/go/storage="v1.30.1"
|
||||
cloud.google.com/go="v0.110.2"
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore="v1.6.1"
|
||||
cloud.google.com/go/iam="v1.1.3"
|
||||
cloud.google.com/go/storage="v1.31.0"
|
||||
cloud.google.com/go="v0.110.8"
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azcore="v1.7.0"
|
||||
github.com/Azure/azure-sdk-for-go/sdk/azidentity="v1.3.0"
|
||||
github.com/Azure/azure-sdk-for-go/sdk/internal="v1.3.0"
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob="v1.0.0"
|
||||
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob="v1.1.0"
|
||||
github.com/Azure/go-autorest/autorest/to="v0.4.0"
|
||||
github.com/AzureAD/microsoft-authentication-library-for-go="v1.0.0"
|
||||
github.com/BurntSushi/locker="v0.0.0-20171006230638-a6e239ea1c69"
|
||||
github.com/PuerkitoBio/purell="v1.1.1"
|
||||
github.com/PuerkitoBio/urlesc="v0.0.0-20170810143723-de5bf2ad4578"
|
||||
github.com/alecthomas/chroma/v2="v2.7.0"
|
||||
github.com/alecthomas/chroma/v2="v2.11.1"
|
||||
github.com/armon/go-radix="v1.0.0"
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream="v1.4.10"
|
||||
github.com/aws/aws-sdk-go-v2/config="v1.18.27"
|
||||
github.com/aws/aws-sdk-go-v2/credentials="v1.13.26"
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds="v1.13.4"
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager="v1.11.70"
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources="v1.1.34"
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2="v2.4.28"
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini="v1.3.35"
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a="v1.0.26"
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding="v1.9.11"
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum="v1.1.29"
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url="v1.9.28"
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared="v1.14.3"
|
||||
github.com/aws/aws-sdk-go-v2/service/s3="v1.35.0"
|
||||
github.com/aws/aws-sdk-go-v2/service/sso="v1.12.12"
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc="v1.14.12"
|
||||
github.com/aws/aws-sdk-go-v2/service/sts="v1.19.2"
|
||||
github.com/aws/aws-sdk-go-v2="v1.18.1"
|
||||
github.com/aws/aws-sdk-go="v1.44.284"
|
||||
github.com/aws/smithy-go="v1.13.5"
|
||||
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream="v1.4.11"
|
||||
github.com/aws/aws-sdk-go-v2/config="v1.18.32"
|
||||
github.com/aws/aws-sdk-go-v2/credentials="v1.13.31"
|
||||
github.com/aws/aws-sdk-go-v2/feature/ec2/imds="v1.13.7"
|
||||
github.com/aws/aws-sdk-go-v2/feature/s3/manager="v1.11.76"
|
||||
github.com/aws/aws-sdk-go-v2/internal/configsources="v1.1.37"
|
||||
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2="v2.4.31"
|
||||
github.com/aws/aws-sdk-go-v2/internal/ini="v1.3.38"
|
||||
github.com/aws/aws-sdk-go-v2/internal/v4a="v1.1.0"
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding="v1.9.12"
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/checksum="v1.1.32"
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url="v1.9.31"
|
||||
github.com/aws/aws-sdk-go-v2/service/internal/s3shared="v1.15.0"
|
||||
github.com/aws/aws-sdk-go-v2/service/s3="v1.38.1"
|
||||
github.com/aws/aws-sdk-go-v2/service/sso="v1.13.1"
|
||||
github.com/aws/aws-sdk-go-v2/service/ssooidc="v1.15.1"
|
||||
github.com/aws/aws-sdk-go-v2/service/sts="v1.21.1"
|
||||
github.com/aws/aws-sdk-go-v2="v1.20.0"
|
||||
github.com/aws/aws-sdk-go="v1.48.2"
|
||||
github.com/aws/smithy-go="v1.14.0"
|
||||
github.com/bep/clocks="v0.5.0"
|
||||
github.com/bep/debounce="v1.2.0"
|
||||
github.com/bep/gitmap="v1.1.2"
|
||||
@@ -183,45 +183,45 @@ github.com/bep/goat="v0.5.0"
|
||||
github.com/bep/godartsass/v2="v2.0.0"
|
||||
github.com/bep/godartsass="v1.2.0"
|
||||
github.com/bep/golibsass="v1.1.1"
|
||||
github.com/bep/gowebp="v0.2.0"
|
||||
github.com/bep/gowebp="v0.3.0"
|
||||
github.com/bep/lazycache="v0.2.0"
|
||||
github.com/bep/logg="v0.2.0"
|
||||
github.com/bep/logg="v0.3.0"
|
||||
github.com/bep/mclib="v1.20400.20402"
|
||||
github.com/bep/overlayfs="v0.6.0"
|
||||
github.com/bep/simplecobra="v0.3.2"
|
||||
github.com/bep/tmc="v0.5.1"
|
||||
github.com/clbanning/mxj/v2="v2.5.7"
|
||||
github.com/clbanning/mxj/v2="v2.7.0"
|
||||
github.com/cli/safeexec="v1.0.1"
|
||||
github.com/cpuguy83/go-md2man/v2="v2.0.2"
|
||||
github.com/disintegration/gift="v1.2.1"
|
||||
github.com/dlclark/regexp2="v1.10.0"
|
||||
github.com/dustin/go-humanize="v1.0.1"
|
||||
github.com/evanw/esbuild="v0.18.5"
|
||||
github.com/fatih/color="v1.15.0"
|
||||
github.com/frankban/quicktest="v1.14.5"
|
||||
github.com/fsnotify/fsnotify="v1.6.0"
|
||||
github.com/getkin/kin-openapi="v0.118.0"
|
||||
github.com/evanw/esbuild="v0.19.7"
|
||||
github.com/fatih/color="v1.16.0"
|
||||
github.com/frankban/quicktest="v1.14.6"
|
||||
github.com/fsnotify/fsnotify="v1.7.0"
|
||||
github.com/getkin/kin-openapi="v0.120.0"
|
||||
github.com/ghodss/yaml="v1.0.0"
|
||||
github.com/go-openapi/jsonpointer="v0.19.6"
|
||||
github.com/go-openapi/swag="v0.22.3"
|
||||
github.com/go-openapi/swag="v0.22.4"
|
||||
github.com/gobuffalo/flect="v1.0.2"
|
||||
github.com/gobwas/glob="v0.2.3"
|
||||
github.com/gohugoio/go-i18n/v2="v2.1.3-0.20210430103248-4c28c89f8013"
|
||||
github.com/gohugoio/go-i18n/v2="v2.1.3-0.20230805085216-e63c13218d0e"
|
||||
github.com/gohugoio/locales="v0.14.0"
|
||||
github.com/gohugoio/localescompressed="v1.0.1"
|
||||
github.com/golang-jwt/jwt/v4="v4.5.0"
|
||||
github.com/golang/groupcache="v0.0.0-20210331224755-41bb18bfe9da"
|
||||
github.com/golang/protobuf="v1.5.3"
|
||||
github.com/google/go-cmp="v0.5.9"
|
||||
github.com/google/s2a-go="v0.1.4"
|
||||
github.com/google/uuid="v1.3.0"
|
||||
github.com/google/go-cmp="v0.6.0"
|
||||
github.com/google/s2a-go="v0.1.7"
|
||||
github.com/google/uuid="v1.4.0"
|
||||
github.com/google/wire="v0.5.0"
|
||||
github.com/googleapis/enterprise-certificate-proxy="v0.2.5"
|
||||
github.com/googleapis/gax-go/v2="v2.11.0"
|
||||
github.com/gorilla/websocket="v1.5.0"
|
||||
github.com/hairyhenderson/go-codeowners="v0.3.0"
|
||||
github.com/googleapis/enterprise-certificate-proxy="v0.3.2"
|
||||
github.com/googleapis/gax-go/v2="v2.12.0"
|
||||
github.com/gorilla/websocket="v1.5.1"
|
||||
github.com/hairyhenderson/go-codeowners="v0.4.0"
|
||||
github.com/hashicorp/golang-lru/v2="v2.0.1"
|
||||
github.com/invopop/yaml="v0.1.0"
|
||||
github.com/invopop/yaml="v0.2.0"
|
||||
github.com/jdkato/prose="v1.2.1"
|
||||
github.com/jmespath/go-jmespath="v0.4.0"
|
||||
github.com/josharian/intern="v1.0.0"
|
||||
@@ -230,9 +230,9 @@ github.com/kr/text="v0.2.0"
|
||||
github.com/kylelemons/godebug="v1.1.0"
|
||||
github.com/kyokomi/emoji/v2="v2.2.12"
|
||||
github.com/mailru/easyjson="v0.7.7"
|
||||
github.com/marekm4/color-extractor="v1.2.0"
|
||||
github.com/marekm4/color-extractor="v1.2.1"
|
||||
github.com/mattn/go-colorable="v0.1.13"
|
||||
github.com/mattn/go-isatty="v0.0.19"
|
||||
github.com/mattn/go-isatty="v0.0.20"
|
||||
github.com/mattn/go-runewidth="v0.0.9"
|
||||
github.com/mitchellh/hashstructure="v1.1.0"
|
||||
github.com/mitchellh/mapstructure="v1.5.0"
|
||||
@@ -240,51 +240,53 @@ github.com/mohae/deepcopy="v0.0.0-20170929034955-c48cc78d4826"
|
||||
github.com/muesli/smartcrop="v0.3.0"
|
||||
github.com/niklasfasching/go-org="v1.7.0"
|
||||
github.com/olekukonko/tablewriter="v0.0.5"
|
||||
github.com/pelletier/go-toml/v2="v2.0.8"
|
||||
github.com/perimeterx/marshmallow="v1.1.4"
|
||||
github.com/pelletier/go-toml/v2="v2.1.0"
|
||||
github.com/perimeterx/marshmallow="v1.1.5"
|
||||
github.com/pkg/browser="v0.0.0-20210911075715-681adbf594b8"
|
||||
github.com/pkg/errors="v0.9.1"
|
||||
github.com/rogpeppe/go-internal="v1.10.1-0.20230508101108-a4f6fabd84c5"
|
||||
github.com/rogpeppe/go-internal="v1.11.0"
|
||||
github.com/russross/blackfriday/v2="v2.1.0"
|
||||
github.com/rwcarlsen/goexif="v0.0.0-20190401172101-9e8deecbddbd"
|
||||
github.com/sanity-io/litter="v1.5.5"
|
||||
github.com/sass/dart-sass/compiler="1.63.6"
|
||||
github.com/sass/dart-sass/implementation="1.63.6"
|
||||
github.com/sass/dart-sass/protocol="2.1.0"
|
||||
github.com/sass/dart-sass/compiler="1.63.2"
|
||||
github.com/sass/dart-sass/implementation="1.63.2"
|
||||
github.com/sass/dart-sass/protocol="2.0.0"
|
||||
github.com/sass/libsass="3.6.5"
|
||||
github.com/spf13/afero="v1.9.5"
|
||||
github.com/spf13/afero="v1.10.0"
|
||||
github.com/spf13/cast="v1.5.1"
|
||||
github.com/spf13/cobra="v1.7.0"
|
||||
github.com/spf13/fsync="v0.9.0"
|
||||
github.com/spf13/pflag="v1.0.5"
|
||||
github.com/tdewolff/minify/v2="v2.12.7"
|
||||
github.com/tdewolff/parse/v2="v2.6.6"
|
||||
github.com/webmproject/libwebp="v1.2.4"
|
||||
github.com/yuin/goldmark="v1.5.4"
|
||||
github.com/tdewolff/minify/v2="v2.20.7"
|
||||
github.com/tdewolff/parse/v2="v2.7.5"
|
||||
github.com/webmproject/libwebp="v1.3.2"
|
||||
github.com/yuin/goldmark-emoji="v1.0.2"
|
||||
github.com/yuin/goldmark="v1.6.0"
|
||||
go.opencensus.io="v0.24.0"
|
||||
go.uber.org/atomic="v1.11.0"
|
||||
go.uber.org/automaxprocs="v1.5.2"
|
||||
gocloud.dev="v0.30.0"
|
||||
golang.org/x/crypto="v0.10.0"
|
||||
golang.org/x/exp="v0.0.0-20230321023759-10a507213a29"
|
||||
golang.org/x/image="v0.8.0"
|
||||
golang.org/x/mod="v0.10.0"
|
||||
golang.org/x/net="v0.11.0"
|
||||
golang.org/x/oauth2="v0.9.0"
|
||||
golang.org/x/sync="v0.3.0"
|
||||
golang.org/x/sys="v0.9.0"
|
||||
golang.org/x/text="v0.10.0"
|
||||
golang.org/x/tools="v0.9.3"
|
||||
go.uber.org/automaxprocs="v1.5.3"
|
||||
gocloud.dev="v0.34.0"
|
||||
golang.org/x/crypto="v0.15.0"
|
||||
golang.org/x/exp="v0.0.0-20221031165847-c99f073a8326"
|
||||
golang.org/x/image="v0.13.0"
|
||||
golang.org/x/mod="v0.14.0"
|
||||
golang.org/x/net="v0.18.0"
|
||||
golang.org/x/oauth2="v0.13.0"
|
||||
golang.org/x/sync="v0.5.0"
|
||||
golang.org/x/sys="v0.14.0"
|
||||
golang.org/x/text="v0.14.0"
|
||||
golang.org/x/time="v0.3.0"
|
||||
golang.org/x/tools="v0.15.0"
|
||||
golang.org/x/xerrors="v0.0.0-20220907171357-04be3eba64a2"
|
||||
google.golang.org/api="v0.128.0"
|
||||
google.golang.org/appengine="v1.6.7"
|
||||
google.golang.org/genproto/googleapis/api="v0.0.0-20230530153820-e85fd2cbaebc"
|
||||
google.golang.org/genproto/googleapis/rpc="v0.0.0-20230530153820-e85fd2cbaebc"
|
||||
google.golang.org/genproto="v0.0.0-20230530153820-e85fd2cbaebc"
|
||||
google.golang.org/grpc="v1.56.0"
|
||||
google.golang.org/protobuf="v1.30.0"
|
||||
google.golang.org/api="v0.151.0"
|
||||
google.golang.org/genproto/googleapis/api="v0.0.0-20231016165738-49dd2c1f3d0b"
|
||||
google.golang.org/genproto/googleapis/rpc="v0.0.0-20231030173426-d783a09b4405"
|
||||
google.golang.org/genproto="v0.0.0-20231016165738-49dd2c1f3d0b"
|
||||
google.golang.org/grpc="v1.59.0"
|
||||
google.golang.org/protobuf="v1.31.0"
|
||||
gopkg.in/yaml.v2="v2.4.0"
|
||||
gopkg.in/yaml.v3="v3.0.1"
|
||||
howett.net/plist="v1.0.0"
|
||||
software.sslmate.com/src/go-pkcs12="v0.2.0"
|
||||
```
|
||||
</details>
|
||||
|
||||
+11
-18
@@ -38,6 +38,7 @@ import (
|
||||
|
||||
"github.com/gohugoio/hugo/common/hstrings"
|
||||
"github.com/gohugoio/hugo/common/htime"
|
||||
"github.com/gohugoio/hugo/common/hugo"
|
||||
"github.com/gohugoio/hugo/common/loggers"
|
||||
"github.com/gohugoio/hugo/common/paths"
|
||||
"github.com/gohugoio/hugo/config"
|
||||
@@ -50,9 +51,7 @@ import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var (
|
||||
errHelp = errors.New("help requested")
|
||||
)
|
||||
var errHelp = errors.New("help requested")
|
||||
|
||||
// Execute executes a command.
|
||||
func Execute(args []string) error {
|
||||
@@ -182,11 +181,9 @@ func (r *rootCommand) ConfigFromConfig(key int32, oldConf *commonConfig) (*commo
|
||||
cfg: oldConf.cfg,
|
||||
fs: fs,
|
||||
}, nil
|
||||
|
||||
})
|
||||
|
||||
return cc, err
|
||||
|
||||
}
|
||||
|
||||
func (r *rootCommand) ConfigFromProvider(key int32, cfg config.Provider) (*commonConfig, error) {
|
||||
@@ -211,7 +208,7 @@ func (r *rootCommand) ConfigFromProvider(key int32, cfg config.Provider) (*commo
|
||||
if !cfg.IsSet("workingDir") {
|
||||
cfg.Set("workingDir", dir)
|
||||
} else {
|
||||
if err := os.MkdirAll(cfg.GetString("workingDir"), 0777); err != nil {
|
||||
if err := os.MkdirAll(cfg.GetString("workingDir"), 0o777); err != nil {
|
||||
return nil, fmt.Errorf("failed to create workingDir: %w", err)
|
||||
}
|
||||
}
|
||||
@@ -303,7 +300,6 @@ func (r *rootCommand) ConfigFromProvider(key int32, cfg config.Provider) (*commo
|
||||
})
|
||||
|
||||
return cc, err
|
||||
|
||||
}
|
||||
|
||||
func (r *rootCommand) HugFromConfig(conf *commonConfig) (*hugolib.HugoSites, error) {
|
||||
@@ -348,7 +344,6 @@ func (r *rootCommand) Run(ctx context.Context, cd *simplecobra.Commandeer, args
|
||||
err := b.build()
|
||||
return err
|
||||
}()
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -434,26 +429,26 @@ func (r *rootCommand) createLogger(running bool) (loggers.Logger, error) {
|
||||
}
|
||||
} else {
|
||||
if r.verbose {
|
||||
helpers.Deprecated("--verbose", "use --logLevel info", false)
|
||||
hugo.Deprecate("--verbose", "use --logLevel info", "v0.114.0")
|
||||
hugo.Deprecate("--verbose", "use --logLevel info", "v0.114.0")
|
||||
level = logg.LevelInfo
|
||||
}
|
||||
|
||||
if r.debug {
|
||||
helpers.Deprecated("--debug", "use --logLevel debug", false)
|
||||
hugo.Deprecate("--debug", "use --logLevel debug", "v0.114.0")
|
||||
level = logg.LevelDebug
|
||||
}
|
||||
}
|
||||
|
||||
optsLogger := loggers.Options{
|
||||
Distinct: true,
|
||||
Level: level,
|
||||
Stdout: r.Out,
|
||||
Stderr: r.Out,
|
||||
StoreErrors: running,
|
||||
DistinctLevel: logg.LevelWarn,
|
||||
Level: level,
|
||||
Stdout: r.Out,
|
||||
Stderr: r.Out,
|
||||
StoreErrors: running,
|
||||
}
|
||||
|
||||
return loggers.New(optsLogger), nil
|
||||
|
||||
}
|
||||
|
||||
func (r *rootCommand) Reset() {
|
||||
@@ -519,7 +514,6 @@ func applyLocalFlagsBuildConfig(cmd *cobra.Command, r *rootCommand) {
|
||||
_ = cmd.Flags().SetAnnotation("cacheDir", cobra.BashCompSubdirsInDir, []string{})
|
||||
cmd.Flags().StringP("contentDir", "c", "", "filesystem path to content directory")
|
||||
_ = cmd.Flags().SetAnnotation("theme", cobra.BashCompSubdirsInDir, []string{"themes"})
|
||||
|
||||
}
|
||||
|
||||
// Flags needed to do a build (used by hugo and hugo server commands)
|
||||
@@ -558,7 +552,6 @@ func applyLocalFlagsBuild(cmd *cobra.Command, r *rootCommand) {
|
||||
cmd.Flags().StringSlice("disableKinds", []string{}, "disable different kind of pages (home, RSS etc.)")
|
||||
cmd.Flags().Bool("minify", false, "minify any supported output format (HTML, XML etc.)")
|
||||
_ = cmd.Flags().SetAnnotation("destination", cobra.BashCompSubdirsInDir, []string{})
|
||||
|
||||
}
|
||||
|
||||
func (r *rootCommand) timeTrack(start time.Time, name string) {
|
||||
|
||||
@@ -25,9 +25,9 @@ func init() {
|
||||
// This message to show to Windows users if Hugo is opened from explorer.exe
|
||||
cobra.MousetrapHelpText = `
|
||||
|
||||
Hugo is a command-line tool for generating static website.
|
||||
Hugo is a command-line tool for generating static websites.
|
||||
|
||||
You need to open PowerShell and run Hugo from there.
|
||||
|
||||
You need to open cmd.exe and run Hugo from there.
|
||||
|
||||
Visit https://gohugo.io/ for more information.`
|
||||
}
|
||||
|
||||
+7
-3
@@ -211,7 +211,12 @@ Install a specific version:
|
||||
|
||||
hugo mod get github.com/gohugoio/testshortcodes@v0.3.0
|
||||
|
||||
Install the latest versions of all module dependencies:
|
||||
Install the latest versions of all direct module dependencies:
|
||||
|
||||
hugo mod get
|
||||
hugo mod get ./... (recursive)
|
||||
|
||||
Install the latest versions of all module dependencies (direct and indirect):
|
||||
|
||||
hugo mod get -u
|
||||
hugo mod get -u ./... (recursive)
|
||||
@@ -281,7 +286,6 @@ Run "go help get" for more information. All flags available for "go get" is also
|
||||
npmCommand,
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
type modCommands struct {
|
||||
@@ -303,7 +307,7 @@ func (c *modCommands) Run(ctx context.Context, cd *simplecobra.Commandeer, args
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
//config := conf.configs.Base
|
||||
// config := conf.configs.Base
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -63,7 +63,6 @@ Ensure you run this within the root directory of your site.`,
|
||||
cmd.Flags().StringVarP(&contentType, "kind", "k", "", "content type to create")
|
||||
cmd.Flags().String("editor", "", "edit new content with this editor, if provided")
|
||||
cmd.Flags().BoolVarP(&force, "force", "f", false, "overwrite file if it already exists")
|
||||
cmd.Flags().StringVar(&format, "format", "toml", "preferred file format (toml, yaml or json)")
|
||||
applyLocalFlagsBuildConfig(cmd, r)
|
||||
|
||||
},
|
||||
|
||||
+1
-1
@@ -927,7 +927,7 @@ func (c *serverCommand) serve() error {
|
||||
|
||||
for i := range baseURLs {
|
||||
mu, listener, serverURL, endpoint, err := srv.createEndpoint(i)
|
||||
var srv *http.Server
|
||||
var srv *http.Server
|
||||
if c.tlsCertFile != "" && c.tlsKeyFile != "" {
|
||||
srv = &http.Server{
|
||||
Addr: endpoint,
|
||||
|
||||
@@ -16,9 +16,6 @@ package constants
|
||||
// Error IDs.
|
||||
// Do not change these values.
|
||||
const (
|
||||
ErrIDAmbigousDisableKindTaxonomy = "error-disable-taxonomy"
|
||||
ErrIDAmbigousOutputKindTaxonomy = "error-output-taxonomy"
|
||||
|
||||
// IDs for remote errors in tpl/data.
|
||||
ErrRemoteGetJSON = "error-remote-getjson"
|
||||
ErrRemoteGetCSV = "error-remote-getcsv"
|
||||
|
||||
@@ -15,14 +15,12 @@
|
||||
package herrors
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
// PrintStackTrace prints the current stacktrace to w.
|
||||
@@ -49,16 +47,6 @@ func Recover(args ...any) {
|
||||
}
|
||||
}
|
||||
|
||||
// GetGID the current goroutine id. Used only for debugging.
|
||||
func GetGID() uint64 {
|
||||
b := make([]byte, 64)
|
||||
b = b[:runtime.Stack(b, false)]
|
||||
b = bytes.TrimPrefix(b, []byte("goroutine "))
|
||||
b = b[:bytes.IndexByte(b, ' ')]
|
||||
n, _ := strconv.ParseUint(string(b), 10, 64)
|
||||
return n
|
||||
}
|
||||
|
||||
// IsFeatureNotAvailableError returns true if the given error is or contains a FeatureNotAvailableError.
|
||||
func IsFeatureNotAvailableError(err error) bool {
|
||||
return errors.Is(err, &FeatureNotAvailableError{})
|
||||
|
||||
@@ -99,3 +99,26 @@ var reCache = regexpCache{re: make(map[string]*regexp.Regexp)}
|
||||
func GetOrCompileRegexp(pattern string) (re *regexp.Regexp, err error) {
|
||||
return reCache.getOrCompileRegexp(pattern)
|
||||
}
|
||||
|
||||
// InSlice checks if a string is an element of a slice of strings
|
||||
// and returns a boolean value.
|
||||
func InSlice(arr []string, el string) bool {
|
||||
for _, v := range arr {
|
||||
if v == el {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// InSlicEqualFold checks if a string is an element of a slice of strings
|
||||
// and returns a boolean value.
|
||||
// It uses strings.EqualFold to compare.
|
||||
func InSlicEqualFold(arr []string, el string) bool {
|
||||
for _, v := range arr {
|
||||
if strings.EqualFold(v, el) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
+64
-7
@@ -22,14 +22,15 @@ import (
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
godartsassv1 "github.com/bep/godartsass"
|
||||
"github.com/bep/logg"
|
||||
"github.com/mitchellh/mapstructure"
|
||||
|
||||
"time"
|
||||
|
||||
"github.com/bep/godartsass/v2"
|
||||
"github.com/gohugoio/hugo/common/hexec"
|
||||
"github.com/gohugoio/hugo/common/loggers"
|
||||
"github.com/gohugoio/hugo/hugofs/files"
|
||||
|
||||
"github.com/spf13/afero"
|
||||
@@ -78,10 +79,22 @@ func (i HugoInfo) Generator() template.HTML {
|
||||
return template.HTML(fmt.Sprintf(`<meta name="generator" content="Hugo %s">`, CurrentVersion.String()))
|
||||
}
|
||||
|
||||
// IsDevelopment reports whether the current running environment is "development".
|
||||
func (i HugoInfo) IsDevelopment() bool {
|
||||
return i.Environment == EnvironmentDevelopment
|
||||
}
|
||||
|
||||
// IsProduction reports whether the current running environment is "production".
|
||||
func (i HugoInfo) IsProduction() bool {
|
||||
return i.Environment == EnvironmentProduction
|
||||
}
|
||||
|
||||
// IsServer reports whether the built-in server is running.
|
||||
func (i HugoInfo) IsServer() bool {
|
||||
return i.conf.Running()
|
||||
}
|
||||
|
||||
// IsExtended reports whether the Hugo binary is the extended version.
|
||||
func (i HugoInfo) IsExtended() bool {
|
||||
return IsExtended
|
||||
}
|
||||
@@ -99,6 +112,7 @@ func (i HugoInfo) Deps() []*Dependency {
|
||||
// ConfigProvider represents the config options that are relevant for HugoInfo.
|
||||
type ConfigProvider interface {
|
||||
Environment() string
|
||||
Running() bool
|
||||
WorkingDir() string
|
||||
}
|
||||
|
||||
@@ -170,8 +184,10 @@ type buildInfo struct {
|
||||
*debug.BuildInfo
|
||||
}
|
||||
|
||||
var bInfo *buildInfo
|
||||
var bInfoInit sync.Once
|
||||
var (
|
||||
bInfo *buildInfo
|
||||
bInfoInit sync.Once
|
||||
)
|
||||
|
||||
func getBuildInfo() *buildInfo {
|
||||
bInfoInit.Do(func() {
|
||||
@@ -198,7 +214,6 @@ func getBuildInfo() *buildInfo {
|
||||
bInfo.GoArch = s.Value
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
return bInfo
|
||||
@@ -237,12 +252,12 @@ func GetDependencyListNonGo() []string {
|
||||
deps = append(
|
||||
deps,
|
||||
formatDep("github.com/sass/libsass", "3.6.5"),
|
||||
formatDep("github.com/webmproject/libwebp", "v1.2.4"),
|
||||
formatDep("github.com/webmproject/libwebp", "v1.3.2"),
|
||||
)
|
||||
}
|
||||
|
||||
if dartSass := dartSassVersion(); dartSass.ProtocolVersion != "" {
|
||||
var dartSassPath = "github.com/sass/dart-sass-embedded"
|
||||
dartSassPath := "github.com/sass/dart-sass-embedded"
|
||||
if IsDartSassV2() {
|
||||
dartSassPath = "github.com/sass/dart-sass"
|
||||
}
|
||||
@@ -333,3 +348,45 @@ var (
|
||||
func IsDartSassV2() bool {
|
||||
return !strings.Contains(DartSassBinaryName, "embedded")
|
||||
}
|
||||
|
||||
// Deprecate informs about a deprecation starting at the given version.
|
||||
//
|
||||
// A deprecation typically needs a simple change in the template, but doing so will make the template incompatible with older versions.
|
||||
// Theme maintainers generally want
|
||||
// 1. No warnings or errors in the console when building a Hugo site.
|
||||
// 2. Their theme to work for at least the last few Hugo versions.
|
||||
func Deprecate(item, alternative string, version string) {
|
||||
level := deprecationLogLevelFromVersion(version)
|
||||
DeprecateLevel(item, alternative, version, level)
|
||||
}
|
||||
|
||||
// DeprecateLevel informs about a deprecation logging at the given level.
|
||||
func DeprecateLevel(item, alternative, version string, level logg.Level) {
|
||||
var msg string
|
||||
if level == logg.LevelError {
|
||||
msg = fmt.Sprintf("%s was deprecated in Hugo %s and will be removed in Hugo %s. %s", item, version, CurrentVersion.Next().ReleaseVersion(), alternative)
|
||||
} else {
|
||||
msg = fmt.Sprintf("%s was deprecated in Hugo %s and will be removed in a future release. %s", item, version, alternative)
|
||||
}
|
||||
|
||||
loggers.Log().Logger().WithLevel(level).WithField(loggers.FieldNameCmd, "deprecated").Logf(msg)
|
||||
}
|
||||
|
||||
// We ususally do about one minor version a month.
|
||||
// We want people to run at least the current and previous version without any warnings.
|
||||
// We want people who don't update Hugo that often to see the warnings and errors before we remove the feature.
|
||||
func deprecationLogLevelFromVersion(ver string) logg.Level {
|
||||
from := MustParseVersion(ver)
|
||||
to := CurrentVersion
|
||||
minorDiff := to.Minor - from.Minor
|
||||
switch {
|
||||
case minorDiff >= 12:
|
||||
// Start failing the build after about a year.
|
||||
return logg.LevelError
|
||||
case minorDiff >= 6:
|
||||
// Start printing warnings after about six months.
|
||||
return logg.LevelWarn
|
||||
default:
|
||||
return logg.LevelInfo
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,13 +17,14 @@ import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/bep/logg"
|
||||
qt "github.com/frankban/quicktest"
|
||||
)
|
||||
|
||||
func TestHugoInfo(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
|
||||
conf := testConfig{environment: "production", workingDir: "/mywork"}
|
||||
conf := testConfig{environment: "production", workingDir: "/mywork", running: false}
|
||||
hugoInfo := NewInfo(conf, nil)
|
||||
|
||||
c.Assert(hugoInfo.Version(), qt.Equals, CurrentVersion.Version())
|
||||
@@ -38,15 +39,34 @@ func TestHugoInfo(t *testing.T) {
|
||||
}
|
||||
c.Assert(hugoInfo.Environment, qt.Equals, "production")
|
||||
c.Assert(string(hugoInfo.Generator()), qt.Contains, fmt.Sprintf("Hugo %s", hugoInfo.Version()))
|
||||
c.Assert(hugoInfo.IsDevelopment(), qt.Equals, false)
|
||||
c.Assert(hugoInfo.IsProduction(), qt.Equals, true)
|
||||
c.Assert(hugoInfo.IsExtended(), qt.Equals, IsExtended)
|
||||
c.Assert(hugoInfo.IsServer(), qt.Equals, false)
|
||||
|
||||
devHugoInfo := NewInfo(testConfig{environment: "development"}, nil)
|
||||
devHugoInfo := NewInfo(testConfig{environment: "development", running: true}, nil)
|
||||
c.Assert(devHugoInfo.IsDevelopment(), qt.Equals, true)
|
||||
c.Assert(devHugoInfo.IsProduction(), qt.Equals, false)
|
||||
c.Assert(devHugoInfo.IsServer(), qt.Equals, true)
|
||||
}
|
||||
|
||||
func TestDeprecationLogLevelFromVersion(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
|
||||
c.Assert(deprecationLogLevelFromVersion("0.55.0"), qt.Equals, logg.LevelError)
|
||||
ver := CurrentVersion
|
||||
c.Assert(deprecationLogLevelFromVersion(ver.String()), qt.Equals, logg.LevelInfo)
|
||||
ver.Minor -= 1
|
||||
c.Assert(deprecationLogLevelFromVersion(ver.String()), qt.Equals, logg.LevelInfo)
|
||||
ver.Minor -= 6
|
||||
c.Assert(deprecationLogLevelFromVersion(ver.String()), qt.Equals, logg.LevelWarn)
|
||||
ver.Minor -= 6
|
||||
c.Assert(deprecationLogLevelFromVersion(ver.String()), qt.Equals, logg.LevelError)
|
||||
}
|
||||
|
||||
type testConfig struct {
|
||||
environment string
|
||||
running bool
|
||||
workingDir string
|
||||
}
|
||||
|
||||
@@ -54,6 +74,10 @@ func (c testConfig) Environment() string {
|
||||
return c.environment
|
||||
}
|
||||
|
||||
func (c testConfig) Running() bool {
|
||||
return c.running
|
||||
}
|
||||
|
||||
func (c testConfig) WorkingDir() string {
|
||||
return c.workingDir
|
||||
}
|
||||
|
||||
@@ -67,8 +67,11 @@ func (h VersionString) String() string {
|
||||
|
||||
// Compare implements the compare.Comparer interface.
|
||||
func (h VersionString) Compare(other any) int {
|
||||
v := MustParseVersion(h.String())
|
||||
return compareVersions(v, other)
|
||||
return compareVersions(h.Version(), other)
|
||||
}
|
||||
|
||||
func (h VersionString) Version() Version {
|
||||
return MustParseVersion(h.String())
|
||||
}
|
||||
|
||||
// Eq implements the compare.Eqer interface.
|
||||
@@ -264,7 +267,6 @@ func compareFloatWithVersion(v1 float64, v2 Version) int {
|
||||
|
||||
if v1maj > v2.Major {
|
||||
return 1
|
||||
|
||||
}
|
||||
|
||||
if v1maj < v2.Major {
|
||||
@@ -276,7 +278,6 @@ func compareFloatWithVersion(v1 float64, v2 Version) int {
|
||||
}
|
||||
|
||||
return -1
|
||||
|
||||
}
|
||||
|
||||
func GoMinorVersion() int {
|
||||
|
||||
@@ -17,7 +17,7 @@ package hugo
|
||||
// This should be the only one.
|
||||
var CurrentVersion = Version{
|
||||
Major: 0,
|
||||
Minor: 119,
|
||||
Minor: 122,
|
||||
PatchLevel: 0,
|
||||
Suffix: "-DEV",
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ type Options struct {
|
||||
Level logg.Level
|
||||
Stdout io.Writer
|
||||
Stderr io.Writer
|
||||
Distinct bool
|
||||
DistinctLevel logg.Level
|
||||
StoreErrors bool
|
||||
HandlerPost func(e *logg.Entry) error
|
||||
SuppressStatements map[string]bool
|
||||
@@ -92,8 +92,8 @@ func New(opts Options) Logger {
|
||||
logHandler = multi.New(handlers...)
|
||||
|
||||
var logOnce *logOnceHandler
|
||||
if opts.Distinct {
|
||||
logOnce = newLogOnceHandler(logg.LevelWarn)
|
||||
if opts.DistinctLevel != 0 {
|
||||
logOnce = newLogOnceHandler(opts.DistinctLevel)
|
||||
logHandler = newStopHandler(logOnce, logHandler)
|
||||
}
|
||||
|
||||
@@ -137,10 +137,10 @@ func New(opts Options) Logger {
|
||||
// NewDefault creates a new logger with the default options.
|
||||
func NewDefault() Logger {
|
||||
opts := Options{
|
||||
Distinct: true,
|
||||
Level: logg.LevelWarn,
|
||||
Stdout: os.Stdout,
|
||||
Stderr: os.Stdout,
|
||||
DistinctLevel: logg.LevelWarn,
|
||||
Level: logg.LevelWarn,
|
||||
Stdout: os.Stdout,
|
||||
Stderr: os.Stdout,
|
||||
}
|
||||
return New(opts)
|
||||
}
|
||||
|
||||
@@ -29,10 +29,10 @@ func TestLogDistinct(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
|
||||
opts := loggers.Options{
|
||||
Distinct: true,
|
||||
StoreErrors: true,
|
||||
Stdout: io.Discard,
|
||||
Stderr: io.Discard,
|
||||
DistinctLevel: logg.LevelWarn,
|
||||
StoreErrors: true,
|
||||
Stdout: io.Discard,
|
||||
Stderr: io.Discard,
|
||||
}
|
||||
|
||||
l := loggers.New(opts)
|
||||
@@ -85,7 +85,6 @@ func TestOptionStoreErrors(t *testing.T) {
|
||||
|
||||
c.Assert(sb.String(), qt.Contains, "error 1")
|
||||
c.Assert(sb.String(), qt.Contains, "ERROR")
|
||||
|
||||
}
|
||||
|
||||
func TestLogCount(t *testing.T) {
|
||||
@@ -124,17 +123,16 @@ func TestSuppressStatements(t *testing.T) {
|
||||
c.Assert(errorsStr, qt.Not(qt.Contains), "error 1")
|
||||
c.Assert(errorsStr, qt.Contains, "error 2")
|
||||
c.Assert(l.LoggCount(logg.LevelError), qt.Equals, 1)
|
||||
|
||||
}
|
||||
|
||||
func TestReset(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
|
||||
opts := loggers.Options{
|
||||
StoreErrors: true,
|
||||
Distinct: true,
|
||||
Stdout: io.Discard,
|
||||
Stderr: io.Discard,
|
||||
StoreErrors: true,
|
||||
DistinctLevel: logg.LevelWarn,
|
||||
Stdout: io.Discard,
|
||||
Stderr: io.Discard,
|
||||
}
|
||||
|
||||
l := loggers.New(opts)
|
||||
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
"github.com/bep/logg"
|
||||
)
|
||||
|
||||
func InitGlobalLogger(panicOnWarnings bool) {
|
||||
func InitGlobalLogger(level logg.Level, panicOnWarnings bool) {
|
||||
logMu.Lock()
|
||||
defer logMu.Unlock()
|
||||
var logHookLast func(e *logg.Entry) error
|
||||
@@ -31,8 +31,9 @@ func InitGlobalLogger(panicOnWarnings bool) {
|
||||
|
||||
log = New(
|
||||
Options{
|
||||
Distinct: true,
|
||||
HandlerPost: logHookLast,
|
||||
Level: level,
|
||||
DistinctLevel: logg.LevelInfo,
|
||||
HandlerPost: logHookLast,
|
||||
},
|
||||
)
|
||||
}
|
||||
@@ -49,5 +50,5 @@ func Log() Logger {
|
||||
var log Logger
|
||||
|
||||
func init() {
|
||||
InitGlobalLogger(false)
|
||||
InitGlobalLogger(logg.LevelWarn, false)
|
||||
}
|
||||
|
||||
@@ -32,8 +32,9 @@ func TestPara(t *testing.T) {
|
||||
t.Skipf("skip para test, CPU count is %d", runtime.NumCPU())
|
||||
}
|
||||
|
||||
if !htesting.IsCI() {
|
||||
t.Skip("skip para test when not running on CI")
|
||||
// TODO(bep)
|
||||
if htesting.IsCI() {
|
||||
t.Skip("skip para test when running on CI")
|
||||
}
|
||||
|
||||
c := qt.New(t)
|
||||
|
||||
+14
-9
@@ -51,9 +51,10 @@ var pb pathBridge
|
||||
|
||||
// MakePermalink combines base URL with content path to create full URL paths.
|
||||
// Example
|
||||
// base: http://spf13.com/
|
||||
// path: post/how-i-blog
|
||||
// result: http://spf13.com/post/how-i-blog
|
||||
//
|
||||
// base: http://spf13.com/
|
||||
// path: post/how-i-blog
|
||||
// result: http://spf13.com/post/how-i-blog
|
||||
func MakePermalink(host, plink string) *url.URL {
|
||||
base, err := url.Parse(host)
|
||||
if err != nil {
|
||||
@@ -70,6 +71,8 @@ func MakePermalink(host, plink string) *url.URL {
|
||||
}
|
||||
|
||||
base.Path = path.Join(base.Path, p.Path)
|
||||
base.Fragment = p.Fragment
|
||||
base.RawQuery = p.RawQuery
|
||||
|
||||
// path.Join will strip off the last /, so put it back if it was there.
|
||||
hadTrailingSlash := (plink == "" && strings.HasSuffix(host, "/")) || strings.HasSuffix(p.Path, "/")
|
||||
@@ -117,17 +120,19 @@ func PrettifyURL(in string) string {
|
||||
|
||||
// PrettifyURLPath takes a URL path to a content and converts it
|
||||
// to enable pretty URLs.
|
||||
// /section/name.html becomes /section/name/index.html
|
||||
// /section/name/ becomes /section/name/index.html
|
||||
// /section/name/index.html becomes /section/name/index.html
|
||||
//
|
||||
// /section/name.html becomes /section/name/index.html
|
||||
// /section/name/ becomes /section/name/index.html
|
||||
// /section/name/index.html becomes /section/name/index.html
|
||||
func PrettifyURLPath(in string) string {
|
||||
return prettifyPath(in, pb)
|
||||
}
|
||||
|
||||
// Uglify does the opposite of PrettifyURLPath().
|
||||
// /section/name/index.html becomes /section/name.html
|
||||
// /section/name/ becomes /section/name.html
|
||||
// /section/name.html becomes /section/name.html
|
||||
//
|
||||
// /section/name/index.html becomes /section/name.html
|
||||
// /section/name/ becomes /section/name.html
|
||||
// /section/name.html becomes /section/name.html
|
||||
func Uglify(in string) string {
|
||||
if path.Ext(in) == "" {
|
||||
if len(in) < 2 {
|
||||
|
||||
@@ -31,6 +31,7 @@ func TestMakePermalink(t *testing.T) {
|
||||
{"http://abc.com", "bar", "http://abc.com/bar"},
|
||||
{"http://abc.com/foo/bar", "post/bar", "http://abc.com/foo/bar/post/bar"},
|
||||
{"http://abc.com/foo/bar", "post/bar/", "http://abc.com/foo/bar/post/bar/"},
|
||||
{"http://abc.com/foo", "post/bar?a=b#c", "http://abc.com/foo/post/bar?a=b#c"},
|
||||
}
|
||||
|
||||
for i, d := range data {
|
||||
|
||||
@@ -27,6 +27,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/gohugoio/hugo/cache/filecache"
|
||||
"github.com/gohugoio/hugo/common/hugo"
|
||||
"github.com/gohugoio/hugo/common/loggers"
|
||||
"github.com/gohugoio/hugo/common/maps"
|
||||
"github.com/gohugoio/hugo/common/urls"
|
||||
@@ -784,7 +785,7 @@ func fromLoadConfigResult(fs afero.Fs, logger loggers.Logger, res config.LoadCon
|
||||
// We accidentally allowed it in the past, so we need to support it a little longer,
|
||||
// But log a warning.
|
||||
if _, found := params[kk]; !found {
|
||||
helpers.Deprecated(fmt.Sprintf("config: languages.%s.%s: custom params on the language top level", k, kk), fmt.Sprintf("Put the value below [languages.%s.params]. See https://gohugo.io/content-management/multilingual/#changes-in-hugo-01120", k), false)
|
||||
hugo.Deprecate(fmt.Sprintf("config: languages.%s.%s: custom params on the language top level", k, kk), fmt.Sprintf("Put the value below [languages.%s.params]. See https://gohugo.io/content-management/multilingual/#changes-in-hugo-01120", k), "v0.112.0")
|
||||
params[kk] = vv
|
||||
}
|
||||
}
|
||||
|
||||
@@ -228,3 +228,7 @@ func (c ConfigLanguage) PaginatePath() string {
|
||||
func (c ConfigLanguage) StaticDirs() []string {
|
||||
return c.config.staticDirs()
|
||||
}
|
||||
|
||||
func (c ConfigLanguage) EnableEmoji() bool {
|
||||
return c.config.EnableEmoji
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ import (
|
||||
hglob "github.com/gohugoio/hugo/hugofs/glob"
|
||||
"github.com/gohugoio/hugo/modules"
|
||||
"github.com/gohugoio/hugo/parser/metadecoders"
|
||||
"github.com/gohugoio/hugo/tpl"
|
||||
"github.com/spf13/afero"
|
||||
)
|
||||
|
||||
@@ -91,12 +90,9 @@ func LoadConfig(d ConfigSourceDescriptor) (*Configs, error) {
|
||||
return nil, fmt.Errorf("failed to init config: %w", err)
|
||||
}
|
||||
|
||||
// This is unfortunate, but these are global settings.
|
||||
tpl.SetSecurityAllowActionJSTmpl(configs.Base.Security.GoTemplates.AllowActionJSTmpl)
|
||||
loggers.InitGlobalLogger(configs.Base.PanicOnWarning)
|
||||
loggers.InitGlobalLogger(d.Logger.Level(), configs.Base.PanicOnWarning)
|
||||
|
||||
return configs, nil
|
||||
|
||||
}
|
||||
|
||||
// ConfigSourceDescriptor describes where to find the config (e.g. config.toml etc.).
|
||||
@@ -330,7 +326,6 @@ func (l *configLoader) envStringToVal(k, v string) any {
|
||||
default:
|
||||
return v
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (l *configLoader) loadConfigMain(d ConfigSourceDescriptor) (config.LoadConfigResult, modules.ModulesConfig, error) {
|
||||
|
||||
@@ -66,6 +66,7 @@ type AllProvider interface {
|
||||
StaticDirs() []string
|
||||
IgnoredErrors() map[string]bool
|
||||
WorkingDir() string
|
||||
EnableEmoji() bool
|
||||
}
|
||||
|
||||
// Provider provides the configuration settings for Hugo.
|
||||
@@ -94,9 +95,3 @@ func GetStringSlicePreserveString(cfg Provider, key string) []string {
|
||||
sd := cfg.Get(key)
|
||||
return types.ToStringSlicePreserveString(sd)
|
||||
}
|
||||
|
||||
func setIfNotSet(cfg Provider, key string, value any) {
|
||||
if !cfg.IsSet(key) {
|
||||
cfg.Set(key, value)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,9 +68,6 @@ type Config struct {
|
||||
|
||||
// Allow inline shortcodes
|
||||
EnableInlineShortcodes bool `json:"enableInlineShortcodes"`
|
||||
|
||||
// Go templates related security config.
|
||||
GoTemplates GoTemplates `json:"goTemplates"`
|
||||
}
|
||||
|
||||
// Exec holds os/exec policies.
|
||||
@@ -96,15 +93,6 @@ type HTTP struct {
|
||||
MediaTypes Whitelist `json:"mediaTypes"`
|
||||
}
|
||||
|
||||
type GoTemplates struct {
|
||||
|
||||
// Enable to allow template actions inside bakcticks in ES6 template literals.
|
||||
// This was blocked in Hugo 0.114.0 for security reasons and you now get errors on the form
|
||||
// "... appears in a JS template literal" if you have this in your templates.
|
||||
// See https://github.com/golang/go/issues/59234
|
||||
AllowActionJSTmpl bool
|
||||
}
|
||||
|
||||
// ToTOML converts c to TOML with [security] as the root.
|
||||
func (c Config) ToTOML() string {
|
||||
sec := c.ToSecurityMap()
|
||||
@@ -127,7 +115,6 @@ func (c Config) CheckAllowedExec(name string) error {
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
}
|
||||
|
||||
func (c Config) CheckAllowedGetEnv(name string) error {
|
||||
@@ -176,7 +163,6 @@ func (c Config) ToSecurityMap() map[string]any {
|
||||
"security": m,
|
||||
}
|
||||
return sec
|
||||
|
||||
}
|
||||
|
||||
// DecodeConfig creates a privacy Config from a given Hugo configuration.
|
||||
@@ -206,15 +192,14 @@ func DecodeConfig(cfg config.Provider) (Config, error) {
|
||||
}
|
||||
|
||||
return sc, nil
|
||||
|
||||
}
|
||||
|
||||
func stringSliceToWhitelistHook() mapstructure.DecodeHookFuncType {
|
||||
return func(
|
||||
f reflect.Type,
|
||||
t reflect.Type,
|
||||
data any) (any, error) {
|
||||
|
||||
data any,
|
||||
) (any, error) {
|
||||
if t != reflect.TypeOf(Whitelist{}) {
|
||||
return data, nil
|
||||
}
|
||||
@@ -222,7 +207,6 @@ func stringSliceToWhitelistHook() mapstructure.DecodeHookFuncType {
|
||||
wl := types.ToStringSlicePreserveString(data)
|
||||
|
||||
return NewWhitelist(wl...)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,6 @@ getEnv=["a", "b"]
|
||||
c.Assert(pc.Exec.OsEnv.Accept("e"), qt.IsFalse)
|
||||
c.Assert(pc.Funcs.Getenv.Accept("a"), qt.IsTrue)
|
||||
c.Assert(pc.Funcs.Getenv.Accept("c"), qt.IsFalse)
|
||||
|
||||
})
|
||||
|
||||
c.Run("String whitelist", func(c *qt.C) {
|
||||
@@ -80,7 +79,6 @@ osEnv="b"
|
||||
c.Assert(pc.Exec.Allow.Accept("d"), qt.IsFalse)
|
||||
c.Assert(pc.Exec.OsEnv.Accept("b"), qt.IsTrue)
|
||||
c.Assert(pc.Exec.OsEnv.Accept("e"), qt.IsFalse)
|
||||
|
||||
})
|
||||
|
||||
c.Run("Default exec.osEnv", func(c *qt.C) {
|
||||
@@ -105,7 +103,6 @@ allow="a"
|
||||
c.Assert(pc.Exec.Allow.Accept("a"), qt.IsTrue)
|
||||
c.Assert(pc.Exec.OsEnv.Accept("PATH"), qt.IsTrue)
|
||||
c.Assert(pc.Exec.OsEnv.Accept("e"), qt.IsFalse)
|
||||
|
||||
})
|
||||
|
||||
c.Run("Enable inline shortcodes, legacy", func(c *qt.C) {
|
||||
@@ -129,9 +126,7 @@ osEnv="b"
|
||||
pc, err := DecodeConfig(cfg)
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(pc.EnableInlineShortcodes, qt.IsTrue)
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
func TestToTOML(t *testing.T) {
|
||||
@@ -140,7 +135,7 @@ func TestToTOML(t *testing.T) {
|
||||
got := DefaultConfig.ToTOML()
|
||||
|
||||
c.Assert(got, qt.Equals,
|
||||
"[security]\n enableInlineShortcodes = false\n\n [security.exec]\n allow = ['^(dart-)?sass(-embedded)?$', '^go$', '^npx$', '^postcss$']\n osEnv = ['(?i)^((HTTPS?|NO)_PROXY|PATH(EXT)?|APPDATA|TE?MP|TERM|GO\\w+|(XDG_CONFIG_)?HOME|USERPROFILE|SSH_AUTH_SOCK|DISPLAY|LANG)$']\n\n [security.funcs]\n getenv = ['^HUGO_', '^CI$']\n\n [security.goTemplates]\n AllowActionJSTmpl = false\n\n [security.http]\n methods = ['(?i)GET|POST']\n urls = ['.*']",
|
||||
"[security]\n enableInlineShortcodes = false\n\n [security.exec]\n allow = ['^(dart-)?sass(-embedded)?$', '^go$', '^npx$', '^postcss$']\n osEnv = ['(?i)^((HTTPS?|NO)_PROXY|PATH(EXT)?|APPDATA|TE?MP|TERM|GO\\w+|(XDG_CONFIG_)?HOME|USERPROFILE|SSH_AUTH_SOCK|DISPLAY|LANG)$']\n\n [security.funcs]\n getenv = ['^HUGO_', '^CI$']\n\n [security.http]\n methods = ['(?i)GET|POST']\n urls = ['.*']",
|
||||
)
|
||||
}
|
||||
|
||||
@@ -169,5 +164,4 @@ func TestDecodeConfigDefault(t *testing.T) {
|
||||
c.Assert(pc.Exec.OsEnv.Accept("a"), qt.IsFalse)
|
||||
c.Assert(pc.Exec.OsEnv.Accept("e"), qt.IsFalse)
|
||||
c.Assert(pc.Exec.OsEnv.Accept("MYSECRET"), qt.IsFalse)
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0">
|
||||
<meta name="viewport" content="width=device-width">
|
||||
<title>{{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }}</title>
|
||||
{{ partialCached "head/css.html" . }}
|
||||
{{ partialCached "head/js.html" . }}
|
||||
|
||||
@@ -27,6 +27,12 @@ Renders a menu for the given menu ID.
|
||||
{{- else if $page.HasMenuCurrent .Menu .}}
|
||||
{{- $attrs = merge $attrs (dict "class" "ancestor" "aria-current" "true") }}
|
||||
{{- end }}
|
||||
{{- $name := .Name }}
|
||||
{{- with .Identifier }}
|
||||
{{- with T . }}
|
||||
{{- $name = . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
<li>
|
||||
<a
|
||||
{{- range $k, $v := $attrs }}
|
||||
@@ -34,7 +40,7 @@ Renders a menu for the given menu ID.
|
||||
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
>{{ or (T .Identifier) .Name | safeHTML }}</a>
|
||||
>{{ $name }}</a>
|
||||
{{- with .Children }}
|
||||
<ul>
|
||||
{{- partial "inline/menu/walk.html" (dict "page" $page "menuEntries" .) }}
|
||||
|
||||
Vendored
+7
-2
@@ -33,7 +33,6 @@ import (
|
||||
// There will be normally only one instance of deps in play
|
||||
// at a given time, i.e. one per Site built.
|
||||
type Deps struct {
|
||||
|
||||
// The logger to use.
|
||||
Log loggers.Logger `json:"-"`
|
||||
|
||||
@@ -77,6 +76,9 @@ type Deps struct {
|
||||
// BuildStartListeners will be notified before a build starts.
|
||||
BuildStartListeners *Listeners
|
||||
|
||||
// BuildEndListeners will be notified after a build finishes.
|
||||
BuildEndListeners *Listeners
|
||||
|
||||
// Resources that gets closed when the build is done or the server shuts down.
|
||||
BuildClosers *Closers
|
||||
|
||||
@@ -97,7 +99,6 @@ func (d Deps) Clone(s page.Site, conf config.AllProvider) (*Deps, error) {
|
||||
}
|
||||
|
||||
return &d, nil
|
||||
|
||||
}
|
||||
|
||||
func (d *Deps) SetTempl(t *tpl.TemplateHandlers) {
|
||||
@@ -132,6 +133,10 @@ func (d *Deps) Init() error {
|
||||
d.BuildStartListeners = &Listeners{}
|
||||
}
|
||||
|
||||
if d.BuildEndListeners == nil {
|
||||
d.BuildEndListeners = &Listeners{}
|
||||
}
|
||||
|
||||
if d.BuildClosers == nil {
|
||||
d.BuildClosers = &Closers{}
|
||||
}
|
||||
|
||||
+123
-351
@@ -1,361 +1,133 @@
|
||||
{
|
||||
"version": "0.2",
|
||||
"words": [
|
||||
"aaabaab",
|
||||
"aabb",
|
||||
"aabba",
|
||||
"aabbaa",
|
||||
"aabbaabb",
|
||||
"aabbaabbab",
|
||||
"abbaa",
|
||||
"abourget",
|
||||
"absurl",
|
||||
"adoc",
|
||||
"algolia",
|
||||
"allowfullscreen",
|
||||
"ananke",
|
||||
"anchorize",
|
||||
"anthonyfok",
|
||||
"asciidoctor",
|
||||
"attrlink",
|
||||
"azblob",
|
||||
"baseof",
|
||||
"bbaa",
|
||||
"bcde",
|
||||
"bcdef",
|
||||
"beevelop",
|
||||
"Bergevin",
|
||||
"bibtex",
|
||||
"Bjørn",
|
||||
"blackfriday",
|
||||
"blogue",
|
||||
"bogem",
|
||||
"Bootcamp",
|
||||
"brlink",
|
||||
"Brotli",
|
||||
"Browsersync",
|
||||
"canonicalization",
|
||||
"canonify",
|
||||
"Catmull",
|
||||
"Catwoman",
|
||||
"changefreq",
|
||||
"Cheatsheet",
|
||||
"choco",
|
||||
"chromastyles",
|
||||
"clockoon",
|
||||
"Cloudinary",
|
||||
"CNAME",
|
||||
"Codecademy's",
|
||||
"CODEOWNERS",
|
||||
"Coen",
|
||||
"Commento",
|
||||
"Cond",
|
||||
"contentdir",
|
||||
"Contentful",
|
||||
"Copr",
|
||||
"copyrighthtml",
|
||||
"corejs",
|
||||
"countrunes",
|
||||
"countwords",
|
||||
"crossreferences",
|
||||
"daftaupe",
|
||||
"datatable",
|
||||
"DATOCMS",
|
||||
"debugconfig",
|
||||
"defang",
|
||||
"Deindent",
|
||||
"DELIM",
|
||||
"dhersam",
|
||||
"digitalcraftsman",
|
||||
"Disqus",
|
||||
"Dmdh",
|
||||
"doas",
|
||||
"dokuwiki",
|
||||
"dpkg",
|
||||
"DRING",
|
||||
"Eiqc",
|
||||
"Eliott",
|
||||
"embeddable",
|
||||
"Emojify",
|
||||
"Enwrite",
|
||||
"eopkg",
|
||||
"eparis",
|
||||
"errorf",
|
||||
"erroridf",
|
||||
"esbuild",
|
||||
"Evernote",
|
||||
"Exif",
|
||||
"exitwp",
|
||||
"expirydate",
|
||||
"Feminella",
|
||||
"firstpost",
|
||||
"Flickr",
|
||||
"Formspree",
|
||||
"fpath",
|
||||
"Francia",
|
||||
"freenode",
|
||||
"frontmatter",
|
||||
"funcs",
|
||||
"funcsig",
|
||||
"Garen",
|
||||
"Garuda",
|
||||
"gcloud",
|
||||
"Getenv",
|
||||
"getjson",
|
||||
"getpage",
|
||||
"Gitee",
|
||||
"Gmfc",
|
||||
"Goel",
|
||||
"Gohugo",
|
||||
"gohugoio",
|
||||
"goldenbridge",
|
||||
"Goldmark",
|
||||
"gomodules",
|
||||
"GOPATH",
|
||||
"govendor",
|
||||
"Gowans",
|
||||
"Grayscale",
|
||||
"Gregor",
|
||||
"Gruber",
|
||||
"gtag",
|
||||
"gvfs",
|
||||
"hidecaption",
|
||||
"hmac",
|
||||
"Hokus",
|
||||
"hola",
|
||||
"hügó",
|
||||
"hugodeps",
|
||||
"hugodoc",
|
||||
"Hugofy",
|
||||
"hugolang",
|
||||
"hugoversion",
|
||||
"Hyas",
|
||||
"Hyvor",
|
||||
"iframes",
|
||||
"ifttt",
|
||||
"iife",
|
||||
"imgproc",
|
||||
"importr",
|
||||
"IMWQ",
|
||||
"indice",
|
||||
"innershortcode",
|
||||
"Intelli",
|
||||
"interdoc",
|
||||
"IPTC",
|
||||
"ismenucurrent",
|
||||
"Isset",
|
||||
"Isso",
|
||||
"Jaco",
|
||||
"JIRN",
|
||||
"johnpatitucci",
|
||||
"Joomla",
|
||||
"JRBR",
|
||||
"jsonify",
|
||||
"Karmada",
|
||||
"katex",
|
||||
"keycdn",
|
||||
"KEYVALS",
|
||||
"kubernetes",
|
||||
"Kubuntu",
|
||||
"Lanczos",
|
||||
"langformatnumber",
|
||||
"lastmod",
|
||||
"libwebp",
|
||||
"linktitle",
|
||||
"Lipi",
|
||||
"lrwxr",
|
||||
"Lubuntu",
|
||||
"maingo",
|
||||
"markdownified",
|
||||
"markdownify",
|
||||
"mathjax",
|
||||
"mdhender",
|
||||
"mdshortcode",
|
||||
"MENUENTRY",
|
||||
"mercredi",
|
||||
"Milli",
|
||||
"Mittwoch",
|
||||
"mkdir",
|
||||
"modh",
|
||||
"monokai",
|
||||
"Morling",
|
||||
"mspowerpoint",
|
||||
"Multihost",
|
||||
"Muut",
|
||||
"myclass",
|
||||
"mydeployment",
|
||||
"myindex",
|
||||
"mylayout",
|
||||
"mylogin",
|
||||
"mypage",
|
||||
"mypartials",
|
||||
"mypost",
|
||||
"mysite",
|
||||
"myspa",
|
||||
"mystyle",
|
||||
"mytextpartial",
|
||||
"mytheme",
|
||||
"NDJSON",
|
||||
"needsexample",
|
||||
"Netravali",
|
||||
"newparam",
|
||||
"Nichlas",
|
||||
"Nikhil",
|
||||
"Nikola",
|
||||
"Njjy",
|
||||
"nlist",
|
||||
"nobr",
|
||||
"nocopy",
|
||||
"Norsk",
|
||||
"nosniff",
|
||||
"NOSQL",
|
||||
"notoc",
|
||||
"novembre",
|
||||
"numfmt",
|
||||
"NUMWORKERMULTIPLIER",
|
||||
"Obhu",
|
||||
"octohug",
|
||||
"Octopress",
|
||||
"oldparam",
|
||||
"onrender",
|
||||
"opengraph",
|
||||
"OWASP",
|
||||
"Pandoc",
|
||||
"partialcached",
|
||||
"Pastorius",
|
||||
"Patitucci",
|
||||
"PCRE",
|
||||
"peaceiris",
|
||||
"Pedersen",
|
||||
"Pekka",
|
||||
"permalinkable",
|
||||
"plainify",
|
||||
"POSIX",
|
||||
"postprocess",
|
||||
"Poupin",
|
||||
"prerender",
|
||||
"println",
|
||||
"Pritchard",
|
||||
"publishdate",
|
||||
"Pygments",
|
||||
"qref",
|
||||
"querify",
|
||||
"QVOMC",
|
||||
"Racic",
|
||||
"Rclone",
|
||||
"rdwatters",
|
||||
"readfile",
|
||||
"rebinded",
|
||||
"recommendedby",
|
||||
"REDIR",
|
||||
"reftext",
|
||||
"relatedfuncs",
|
||||
"relref",
|
||||
"relurl",
|
||||
"remarkjs",
|
||||
"rgba",
|
||||
"Riku",
|
||||
"rlimit",
|
||||
"roboto",
|
||||
"rssxml",
|
||||
"rwxrwxrwx",
|
||||
"RYUGV",
|
||||
"safehtml",
|
||||
"safejs",
|
||||
"Samsa",
|
||||
"schemaorg",
|
||||
"setx",
|
||||
"Shekhar",
|
||||
"Shortcode",
|
||||
"Shortcodes",
|
||||
"signup",
|
||||
"Silvola",
|
||||
"Sindre",
|
||||
"sitemapindex",
|
||||
"sitemapxml",
|
||||
"slugorfilename",
|
||||
"Smartcrop",
|
||||
"Sobre",
|
||||
"Sprintf",
|
||||
"Startseite",
|
||||
"strconv",
|
||||
"stringifier",
|
||||
"struct",
|
||||
"structs",
|
||||
"subdir",
|
||||
"svgs",
|
||||
"symdiff",
|
||||
"Talkyard",
|
||||
"taxo",
|
||||
"taxonomyname",
|
||||
"tbody",
|
||||
"tdewolff",
|
||||
"testshortcodes",
|
||||
"thead",
|
||||
"Thinkful",
|
||||
"Tknx",
|
||||
"TLDR",
|
||||
"TMPDIR",
|
||||
"toclevels",
|
||||
"TOCSS",
|
||||
"todos",
|
||||
"tojson",
|
||||
"Tomango",
|
||||
"topologix",
|
||||
"Torikian",
|
||||
"totoml",
|
||||
"toyaml",
|
||||
"twitteruser",
|
||||
"Unmarshal",
|
||||
"unpublishdate",
|
||||
"Unsharp",
|
||||
"urlize",
|
||||
"urlset",
|
||||
"utimestamp",
|
||||
"vendored",
|
||||
"vimrc",
|
||||
"wanghc",
|
||||
"Wappalyzer",
|
||||
"warnf",
|
||||
"webp",
|
||||
"Wercker",
|
||||
"wibble",
|
||||
"wordcount",
|
||||
"workson",
|
||||
"Wowchemy",
|
||||
"wpxr",
|
||||
"Xbaabbab",
|
||||
"Xubuntu",
|
||||
"xvzf",
|
||||
"yoyoyo",
|
||||
"yunbox",
|
||||
"Zgotmpl",
|
||||
"Zorin",
|
||||
"zzbbaabb",
|
||||
"مدونتي"
|
||||
],
|
||||
"language": "en,en-US,de,fr",
|
||||
"allowCompoundWords": true,
|
||||
"files": [
|
||||
"**/*.md"
|
||||
],
|
||||
"ignoreRegExpList": [
|
||||
"<!-- prettier-ignore -->\\n(`{3,})\\w*\\n[\\s\\S]+?\\1",
|
||||
"\\[(\\*{2})?@\\w+?\\1\\]",
|
||||
"\\[`\\w+`\\]",
|
||||
"ve{2,}r{2,}y",
|
||||
"ve+r+y+long\\w*",
|
||||
"\\/.*?\\/",
|
||||
"\\_\\w+",
|
||||
"\\#\\w+"
|
||||
"flagWords": [
|
||||
"alot",
|
||||
"hte",
|
||||
"reccommend",
|
||||
"seperate"
|
||||
],
|
||||
"ignorePaths": [
|
||||
".cspell.json",
|
||||
"**/node_modules/**",
|
||||
"*.min.*",
|
||||
"**/news/*",
|
||||
"**/showcase/*"
|
||||
"**/emojis.md",
|
||||
"**/commands/*",
|
||||
"**/showcase/*",
|
||||
"**/tools/*"
|
||||
],
|
||||
"useGitignore": true,
|
||||
"enabled": true
|
||||
"ignoreRegExpList": [
|
||||
"# cspell: ignore fenced code blocks",
|
||||
"^(\\s*`{3,}).*[\\s\\S]*?^\\1",
|
||||
"# cspell: ignore words joined with dot",
|
||||
"\\w+\\.\\w+",
|
||||
"# cspell: ignore strings within backticks",
|
||||
"`.+`",
|
||||
"# cspell: ignore strings within single quotes",
|
||||
"'.+'",
|
||||
"# cspell: ignore strings within double quotes",
|
||||
"\".+\"",
|
||||
"# cspell: ignore strings within brackets",
|
||||
"\\[.+\\]",
|
||||
"# cspell: ignore strings within parentheses",
|
||||
"\\(.+\\)",
|
||||
"# cspell: ignore words that begin with a slash",
|
||||
"/\\w+",
|
||||
"# cspell: ignore everything within action delimiters",
|
||||
"\\{\\{.+\\}\\}",
|
||||
"# cspell: ignore everything after a right arrow",
|
||||
"\\s+→\\s+.+"
|
||||
],
|
||||
"language": "en",
|
||||
"words": [
|
||||
"antialiasing",
|
||||
"codeowners",
|
||||
"composability",
|
||||
"configurators",
|
||||
"defang",
|
||||
"deindent",
|
||||
"downscale",
|
||||
"downscaled",
|
||||
"downscaling",
|
||||
"exif",
|
||||
"geolocalized",
|
||||
"grayscale",
|
||||
"marshal",
|
||||
"marshaling",
|
||||
"multihost",
|
||||
"performantly",
|
||||
"preconfigured",
|
||||
"prerendering",
|
||||
"redirection",
|
||||
"redirections",
|
||||
"shortcode",
|
||||
"shortcodes",
|
||||
"subexpression",
|
||||
"subexpressions",
|
||||
"suppressable",
|
||||
"templating",
|
||||
"transpile",
|
||||
"transpiles",
|
||||
"unmarshal",
|
||||
"unmarshaling",
|
||||
"# ----------------------------------------------------------------------",
|
||||
"# cspell: ignore foreign language words",
|
||||
"# ----------------------------------------------------------------------",
|
||||
"bezpieczeństwo",
|
||||
"dokumentation",
|
||||
"libros",
|
||||
"miesiąc",
|
||||
"miesiąc",
|
||||
"miesięcy",
|
||||
"miesięcy",
|
||||
"misérables",
|
||||
"projekt",
|
||||
"régime",
|
||||
"# ----------------------------------------------------------------------",
|
||||
"# cspell: ignore proper nouns",
|
||||
"# ----------------------------------------------------------------------",
|
||||
"Eliott",
|
||||
"Gregor",
|
||||
"Jaco",
|
||||
"Noll",
|
||||
"Pastorius",
|
||||
"Samsa",
|
||||
"# ----------------------------------------------------------------------",
|
||||
"# cspell: ignore operating systems and software packages",
|
||||
"# ----------------------------------------------------------------------",
|
||||
"asciidoctor",
|
||||
"brotli",
|
||||
"corejs",
|
||||
"disqus",
|
||||
"doas",
|
||||
"eopkg",
|
||||
"gitee",
|
||||
"goldmark",
|
||||
"kubuntu",
|
||||
"lubuntu",
|
||||
"nosql",
|
||||
"pandoc",
|
||||
"pkgin",
|
||||
"rclone",
|
||||
"xubuntu",
|
||||
"# ----------------------------------------------------------------------",
|
||||
"# cspell: ignore miscellaneous",
|
||||
"# ----------------------------------------------------------------------",
|
||||
"dring",
|
||||
"getenv",
|
||||
"gohugo",
|
||||
"inor",
|
||||
"jdoe",
|
||||
"milli",
|
||||
"rgba",
|
||||
"rsmith",
|
||||
"stringifier",
|
||||
"struct",
|
||||
"tdewolff",
|
||||
"tjones",
|
||||
"toclevels",
|
||||
"vals",
|
||||
"xfeff",
|
||||
"zgotmplz"
|
||||
]
|
||||
}
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
|
||||
+5
-4
@@ -1,9 +1,9 @@
|
||||
name: "Check spelling"
|
||||
on: # rebuild any PRs and main branch changes
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
branches-ignore:
|
||||
- "dependabot/**"
|
||||
pull_request:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -12,10 +12,11 @@ jobs:
|
||||
spellcheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: streetsidesoftware/cspell-action@v2
|
||||
- uses: actions/checkout@v4
|
||||
- uses: streetsidesoftware/cspell-action@v4
|
||||
with:
|
||||
check_dot_files: false
|
||||
files: content/**/*.md
|
||||
incremental_files_only: true
|
||||
inline: warning
|
||||
strict: false
|
||||
|
||||
+2
-2
@@ -18,10 +18,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Lint Code Base
|
||||
uses: github/super-linter/slim@v4
|
||||
uses: super-linter/super-linter/slim@v5
|
||||
env:
|
||||
DEFAULT_BRANCH: master
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
+168
-161
@@ -1,194 +1,201 @@
|
||||
Apache License
|
||||
==============
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
_Version 2.0, January 2004_
|
||||
_<<http://www.apache.org/licenses/>>_
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
### Terms and Conditions for use, reproduction, and distribution
|
||||
1. Definitions.
|
||||
|
||||
#### 1. Definitions
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
“License” shall mean the terms and conditions for use, reproduction, and
|
||||
distribution as defined by Sections 1 through 9 of this document.
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
“Licensor” shall mean the copyright owner or entity authorized by the copyright
|
||||
owner that is granting the License.
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
“Legal Entity” shall mean the union of the acting entity and all other entities
|
||||
that control, are controlled by, or are under common control with that entity.
|
||||
For the purposes of this definition, “control” means **(i)** the power, direct or
|
||||
indirect, to cause the direction or management of such entity, whether by
|
||||
contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or **(iii)** beneficial ownership of such entity.
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
“You” (or “Your”) shall mean an individual or Legal Entity exercising
|
||||
permissions granted by this License.
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
“Source” form shall mean the preferred form for making modifications, including
|
||||
but not limited to software source code, documentation source, and configuration
|
||||
files.
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
“Object” form shall mean any form resulting from mechanical transformation or
|
||||
translation of a Source form, including but not limited to compiled object code,
|
||||
generated documentation, and conversions to other media types.
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
“Work” shall mean the work of authorship, whether in Source or Object form, made
|
||||
available under the License, as indicated by a copyright notice that is included
|
||||
in or attached to the work (an example is provided in the Appendix below).
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
“Derivative Works” shall mean any work, whether in Source or Object form, that
|
||||
is based on (or derived from) the Work and for which the editorial revisions,
|
||||
annotations, elaborations, or other modifications represent, as a whole, an
|
||||
original work of authorship. For the purposes of this License, Derivative Works
|
||||
shall not include works that remain separable from, or merely link (or bind by
|
||||
name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
“Contribution” shall mean any work of authorship, including the original version
|
||||
of the Work and any modifications or additions to that Work or Derivative Works
|
||||
thereof, that is intentionally submitted to Licensor for inclusion in the Work
|
||||
by the copyright owner or by an individual or Legal Entity authorized to submit
|
||||
on behalf of the copyright owner. For the purposes of this definition,
|
||||
“submitted” means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems, and
|
||||
issue tracking systems that are managed by, or on behalf of, the Licensor for
|
||||
the purpose of discussing and improving the Work, but excluding communication
|
||||
that is conspicuously marked or otherwise designated in writing by the copyright
|
||||
owner as “Not a Contribution.”
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
“Contributor” shall mean Licensor and any individual or Legal Entity on behalf
|
||||
of whom a Contribution has been received by Licensor and subsequently
|
||||
incorporated within the Work.
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
#### 2. Grant of Copyright License
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
Subject to the terms and conditions of this License, each Contributor hereby
|
||||
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
||||
irrevocable copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the Work and such
|
||||
Derivative Works in Source or Object form.
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
#### 3. Grant of Patent License
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
Subject to the terms and conditions of this License, each Contributor hereby
|
||||
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
||||
irrevocable (except as stated in this section) patent license to make, have
|
||||
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
|
||||
such license applies only to those patent claims licensable by such Contributor
|
||||
that are necessarily infringed by their Contribution(s) alone or by combination
|
||||
of their Contribution(s) with the Work to which such Contribution(s) was
|
||||
submitted. If You institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
|
||||
Contribution incorporated within the Work constitutes direct or contributory
|
||||
patent infringement, then any patent licenses granted to You under this License
|
||||
for that Work shall terminate as of the date such litigation is filed.
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
#### 4. Redistribution
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
You may reproduce and distribute copies of the Work or Derivative Works thereof
|
||||
in any medium, with or without modifications, and in Source or Object form,
|
||||
provided that You meet the following conditions:
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
* **(a)** You must give any other recipients of the Work or Derivative Works a copy of
|
||||
this License; and
|
||||
* **(b)** You must cause any modified files to carry prominent notices stating that You
|
||||
changed the files; and
|
||||
* **(c)** You must retain, in the Source form of any Derivative Works that You distribute,
|
||||
all copyright, patent, trademark, and attribution notices from the Source form
|
||||
of the Work, excluding those notices that do not pertain to any part of the
|
||||
Derivative Works; and
|
||||
* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any
|
||||
Derivative Works that You distribute must include a readable copy of the
|
||||
attribution notices contained within such NOTICE file, excluding those notices
|
||||
that do not pertain to any part of the Derivative Works, in at least one of the
|
||||
following places: within a NOTICE text file distributed as part of the
|
||||
Derivative Works; within the Source form or documentation, if provided along
|
||||
with the Derivative Works; or, within a display generated by the Derivative
|
||||
Works, if and wherever such third-party notices normally appear. The contents of
|
||||
the NOTICE file are for informational purposes only and do not modify the
|
||||
License. You may add Your own attribution notices within Derivative Works that
|
||||
You distribute, alongside or as an addendum to the NOTICE text from the Work,
|
||||
provided that such additional attribution notices cannot be construed as
|
||||
modifying the License.
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and may provide
|
||||
additional or different license terms and conditions for use, reproduction, or
|
||||
distribution of Your modifications, or for any such Derivative Works as a whole,
|
||||
provided Your use, reproduction, and distribution of the Work otherwise complies
|
||||
with the conditions stated in this License.
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
#### 5. Submission of Contributions
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
Unless You explicitly state otherwise, any Contribution intentionally submitted
|
||||
for inclusion in the Work by You to the Licensor shall be under the terms and
|
||||
conditions of this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify the terms of
|
||||
any separate license agreement you may have executed with Licensor regarding
|
||||
such Contributions.
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
#### 6. Trademarks
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
This License does not grant permission to use the trade names, trademarks,
|
||||
service marks, or product names of the Licensor, except as required for
|
||||
reasonable and customary use in describing the origin of the Work and
|
||||
reproducing the content of the NOTICE file.
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
#### 7. Disclaimer of Warranty
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Unless required by applicable law or agreed to in writing, Licensor provides the
|
||||
Work (and each Contributor provides its Contributions) on an “AS IS” BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
||||
including, without limitation, any warranties or conditions of TITLE,
|
||||
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
|
||||
solely responsible for determining the appropriateness of using or
|
||||
redistributing the Work and assume any risks associated with Your exercise of
|
||||
permissions under this License.
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
#### 8. Limitation of Liability
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
In no event and under no legal theory, whether in tort (including negligence),
|
||||
contract, or otherwise, unless required by applicable law (such as deliberate
|
||||
and grossly negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special, incidental,
|
||||
or consequential damages of any character arising as a result of this License or
|
||||
out of the use or inability to use the Work (including but not limited to
|
||||
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
|
||||
any and all other commercial damages or losses), even if such Contributor has
|
||||
been advised of the possibility of such damages.
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
#### 9. Accepting Warranty or Additional Liability
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
While redistributing the Work or Derivative Works thereof, You may choose to
|
||||
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
|
||||
other liability obligations and/or rights consistent with this License. However,
|
||||
in accepting such obligations, You may act only on Your own behalf and on Your
|
||||
sole responsibility, not on behalf of any other Contributor, and only if You
|
||||
agree to indemnify, defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason of your
|
||||
accepting any such warranty or additional liability.
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
_END OF TERMS AND CONDITIONS_
|
||||
|
||||
### APPENDIX: How to apply the Apache License to your work
|
||||
|
||||
To apply the Apache License to your work, attach the following boilerplate
|
||||
notice, with the fields enclosed by brackets `[]` replaced with your own
|
||||
identifying information. (Don't include the brackets!) The text should be
|
||||
enclosed in the appropriate comment syntax for the file format. We also
|
||||
recommend that a file or class name and description of purpose be included on
|
||||
the same “printed page” as the copyright notice for easier identification within
|
||||
third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
+3
-4
@@ -19,12 +19,11 @@ Spelling fixes are most welcomed, and if you want to contribute longer sections
|
||||
* For example, try to find short snippets that teaches people about the concept. If the example is also useful as-is (copy and paste), then great. Don't list long and similar examples just so people can use them on their sites.
|
||||
* Hugo has users from all over the world, so easy to understand and [simple English](https://simple.wikipedia.org/wiki/Basic_English) is good.
|
||||
|
||||
|
||||
## Edit the theme
|
||||
|
||||
If you want to do docs-related theme changes, the simplest way is to have both `hugoDocs` and `gohugoioTheme` cloned as sibling directories, and then run:
|
||||
|
||||
```
|
||||
```sh
|
||||
HUGO_MODULE_WORKSPACE=hugo.work hugo server --ignoreVendorPaths "**"
|
||||
```
|
||||
|
||||
@@ -37,7 +36,7 @@ HUGO_MODULE_WORKSPACE=hugo.work hugo server --ignoreVendorPaths "**"
|
||||
|
||||
To view the documentation site locally, you need to clone this repository:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
git clone https://github.com/gohugoio/hugoDocs.git
|
||||
```
|
||||
|
||||
@@ -45,7 +44,7 @@ Also note that the documentation version for a given version of Hugo can also be
|
||||
|
||||
Then to view the docs in your browser, run Hugo and open up the link:
|
||||
|
||||
```bash
|
||||
```sh
|
||||
▶ hugo server
|
||||
|
||||
Started building sites ...
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
@media print {
|
||||
#page-footer,
|
||||
body > footer,
|
||||
body > nav {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
#right-sidebar {
|
||||
scrollbar-width: none; /* hide scrollbar: Firefox */
|
||||
-ms-overflow-style: none; /* hide scrollbar: Internet Explorer 10+ */
|
||||
height: calc(100vh - 9rem);
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
#right-sidebar::-webkit-scrollbar { /* hide scrollbar: WebKit */
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
Make h6 elements behave like dt elements. Initially implemented to support
|
||||
linkable glossary entries.
|
||||
|
||||
Yes, it's a hack. That's why it's in the shame file.
|
||||
*/
|
||||
|
||||
h6 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
|
||||
h6:first-of-type {
|
||||
margin-top: 3em;
|
||||
}
|
||||
|
||||
h6 ~ p {
|
||||
margin: 0.5em 0 2em 0;
|
||||
}
|
||||
+33
-4
@@ -1,5 +1,8 @@
|
||||
.facebook, .twitter, .instagram, .youtube {
|
||||
fill: #BABABA;
|
||||
.facebook,
|
||||
.twitter,
|
||||
.instagram,
|
||||
.youtube {
|
||||
fill: #bababa;
|
||||
}
|
||||
.facebook:hover {
|
||||
fill: #3b5998;
|
||||
@@ -10,10 +13,9 @@
|
||||
}
|
||||
|
||||
.twitter:hover {
|
||||
fill: #BABABA;
|
||||
fill: #bababa;
|
||||
}
|
||||
|
||||
|
||||
.instagram:hover {
|
||||
fill: #e95950;
|
||||
}
|
||||
@@ -21,3 +23,30 @@
|
||||
.youtube:hover {
|
||||
fill: #bb0000;
|
||||
}
|
||||
|
||||
.mstdn {
|
||||
display: inline-block;
|
||||
background-color: #282c37;
|
||||
color: #d9e1e8;
|
||||
text-decoration: none;
|
||||
padding: 4px 10px 4px 30px;
|
||||
border-radius: 4px;
|
||||
font-size: 16px;
|
||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2261.076954mm%22%20height%3D%2265.47831mm%22%20viewBox%3D%220%200%20216.4144%20232.00976%22%3E%3Cpath%20d%3D%22M211.80734%20139.0875c-3.18125%2016.36625-28.4925%2034.2775-57.5625%2037.74875-15.15875%201.80875-30.08375%203.47125-45.99875%202.74125-26.0275-1.1925-46.565-6.2125-46.565-6.2125%200%202.53375.15625%204.94625.46875%207.2025%203.38375%2025.68625%2025.47%2027.225%2046.39125%2027.9425%2021.11625.7225%2039.91875-5.20625%2039.91875-5.20625l.8675%2019.09s-14.77%207.93125-41.08125%209.39c-14.50875.7975-32.52375-.365-53.50625-5.91875C9.23234%20213.82%201.40609%20165.31125.20859%20116.09125c-.365-14.61375-.14-28.39375-.14-39.91875%200-50.33%2032.97625-65.0825%2032.97625-65.0825C49.67234%203.45375%2078.20359.2425%20107.86484%200h.72875c29.66125.2425%2058.21125%203.45375%2074.8375%2011.09%200%200%2032.975%2014.7525%2032.975%2065.0825%200%200%20.41375%2037.13375-4.59875%2062.915%22%20fill%3D%22%233088d4%22%2F%3E%3Cpath%20d%3D%22M177.50984%2080.077v60.94125h-24.14375v-59.15c0-12.46875-5.24625-18.7975-15.74-18.7975-11.6025%200-17.4175%207.5075-17.4175%2022.3525v32.37625H96.20734V85.42325c0-14.845-5.81625-22.3525-17.41875-22.3525-10.49375%200-15.74%206.32875-15.74%2018.7975v59.15H38.90484V80.077c0-12.455%203.17125-22.3525%209.54125-29.675%206.56875-7.3225%2015.17125-11.07625%2025.85-11.07625%2012.355%200%2021.71125%204.74875%2027.8975%2014.2475l6.01375%2010.08125%206.015-10.08125c6.185-9.49875%2015.54125-14.2475%2027.8975-14.2475%2010.6775%200%2019.28%203.75375%2025.85%2011.07625%206.36875%207.3225%209.54%2017.22%209.54%2029.675%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E");
|
||||
background-size: 16px;
|
||||
background-repeat: no-repeat;
|
||||
background-position: top 50% left 8px;
|
||||
transition: all 0.5s;
|
||||
}
|
||||
.mstdn:hover {
|
||||
background-color: #484c56;
|
||||
}
|
||||
|
||||
.mstdn > span {
|
||||
color: #9baec8;
|
||||
font-size: 12px;
|
||||
padding-left: 3px;
|
||||
}
|
||||
.mstdn > span:before {
|
||||
content: "@";
|
||||
}
|
||||
|
||||
@@ -21,18 +21,18 @@
|
||||
@import '_no-js';
|
||||
@import '_social-icons';
|
||||
@import '_stickyheader';
|
||||
|
||||
@import '_right-sidebar';
|
||||
@import '_svg';
|
||||
@import '_chroma';
|
||||
@import '_variables';
|
||||
@import '_print';
|
||||
@import '_shame';
|
||||
|
||||
.nested-blockquote blockquote {
|
||||
border-left: 4px solid var(--primary-color);
|
||||
padding-left: 1em;
|
||||
/*margin: 0;*/
|
||||
}
|
||||
|
||||
|
||||
.mw-90 {
|
||||
max-width:90%;
|
||||
}
|
||||
|
||||
+74
-31
@@ -804,8 +804,6 @@ img { max-width: 100%; }
|
||||
.b--washed-red { border-color: #ffdfdf; }
|
||||
.b--transparent { border-color: transparent; }
|
||||
.b--inherit { border-color: inherit; }
|
||||
.b--initial { border-color: currentColor; border-color: initial; }
|
||||
.b--unset { border-color: unset; }
|
||||
/*
|
||||
|
||||
BORDER RADIUS
|
||||
@@ -854,9 +852,6 @@ img { max-width: 100%; }
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.br-inherit { border-radius: inherit; }
|
||||
.br-initial { border-radius: 0; border-radius: initial; }
|
||||
.br-unset { border-radius: unset; }
|
||||
@media screen and (min-width: 30em) {
|
||||
.br0-ns { border-radius: 0; }
|
||||
.br1-ns { border-radius: .125rem; }
|
||||
@@ -881,9 +876,6 @@ img { max-width: 100%; }
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.br-inherit-ns { border-radius: inherit; }
|
||||
.br-initial-ns { border-radius: 0; border-radius: initial; }
|
||||
.br-unset-ns { border-radius: unset; }
|
||||
}
|
||||
@media screen and (min-width: 30em) and (max-width: 60em) {
|
||||
.br0-m { border-radius: 0; }
|
||||
@@ -909,9 +901,6 @@ img { max-width: 100%; }
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.br-inherit-m { border-radius: inherit; }
|
||||
.br-initial-m { border-radius: 0; border-radius: initial; }
|
||||
.br-unset-m { border-radius: unset; }
|
||||
}
|
||||
@media screen and (min-width: 60em) {
|
||||
.br0-l { border-radius: 0; }
|
||||
@@ -937,9 +926,6 @@ img { max-width: 100%; }
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.br-inherit-l { border-radius: inherit; }
|
||||
.br-initial-l { border-radius: 0; border-radius: initial; }
|
||||
.br-unset-l { border-radius: unset; }
|
||||
}
|
||||
/*
|
||||
|
||||
@@ -2381,7 +2367,6 @@ img { max-width: 100%; }
|
||||
.washed-yellow { color: #fffceb; }
|
||||
.washed-red { color: #ffdfdf; }
|
||||
.color-inherit { color: inherit; }
|
||||
/* Background colors */
|
||||
.bg-black-90 { background-color: rgba(0, 0, 0, .9); }
|
||||
.bg-black-80 { background-color: rgba(0, 0, 0, .8); }
|
||||
.bg-black-70 { background-color: rgba(0, 0, 0, .7); }
|
||||
@@ -2401,6 +2386,7 @@ img { max-width: 100%; }
|
||||
.bg-white-30 { background-color: rgba(255, 255, 255, .3); }
|
||||
.bg-white-20 { background-color: rgba(255, 255, 255, .2); }
|
||||
.bg-white-10 { background-color: rgba(255, 255, 255, .1); }
|
||||
/* Background colors */
|
||||
.bg-black { background-color: #000; }
|
||||
.bg-near-black { background-color: #111; }
|
||||
.bg-dark-gray { background-color: #333; }
|
||||
@@ -4685,7 +4671,6 @@ h6:hover .header-link {
|
||||
.searchbox__input::-webkit-input-placeholder{color:#aaa}
|
||||
.searchbox__input:-ms-input-placeholder{color:#aaa}
|
||||
.searchbox__input::-ms-input-placeholder{color:#aaa}
|
||||
.searchbox__input::-moz-placeholder{color:#aaa}
|
||||
.searchbox__input::placeholder{color:#aaa}
|
||||
.searchbox__submit{position:absolute;top:0;margin:0;border:0;border-radius:16px 0 0 16px;background-color:rgba(69, 142, 225, 0);padding:0;width:32px;height:100%;vertical-align:middle;text-align:center;font-size:inherit;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;right:inherit;left:0}
|
||||
.searchbox__submit:before{display:inline-block;margin-right:-4px;height:100%;vertical-align:middle;content:""}
|
||||
@@ -4919,14 +4904,14 @@ pre {
|
||||
text-decoration: none;
|
||||
|
||||
}
|
||||
.column-count-2 {-webkit-column-count: 1;-moz-column-count: 1;column-count: 1}
|
||||
.column-gap-1 {-webkit-column-gap: 0;-moz-column-gap: 0;column-gap: 0}
|
||||
.break-inside-avoid {-webkit-column-break-inside: auto;page-break-inside: auto;break-inside: auto}
|
||||
.column-count-2 {-webkit-column-count: 1;column-count: 1}
|
||||
.column-gap-1 {-webkit-column-gap: 0;column-gap: 0}
|
||||
.break-inside-avoid {-webkit-column-break-inside: auto;break-inside: auto}
|
||||
@media screen and (min-width: 60em) {
|
||||
.column-count-3-l {-webkit-column-count: 3;-moz-column-count: 3;column-count: 3}
|
||||
.column-count-2-l {-webkit-column-count: 2;-moz-column-count: 2;column-count: 2}
|
||||
.column-gap-1-l {-webkit-column-gap: 1;-moz-column-gap: 1;column-gap: 1}
|
||||
.break-inside-avoid-l {-webkit-column-break-inside: avoid;page-break-inside: avoid;break-inside: avoid}
|
||||
.column-count-3-l {-webkit-column-count: 3;column-count: 3}
|
||||
.column-count-2-l {-webkit-column-count: 2;column-count: 2}
|
||||
.column-gap-1-l {-webkit-column-gap: 1;column-gap: 1}
|
||||
.break-inside-avoid-l {-webkit-column-break-inside: avoid;break-inside: avoid}
|
||||
}
|
||||
.prose ul, .prose ol {
|
||||
margin-bottom: 2em;
|
||||
@@ -4937,10 +4922,6 @@ pre {
|
||||
.prose li:hover {
|
||||
background-color: #eee
|
||||
}
|
||||
.prose ::-moz-selection {
|
||||
background: #0594CB; /* WebKit/Blink Browsers */
|
||||
color: white;
|
||||
}
|
||||
.prose ::selection {
|
||||
background: #0594CB; /* WebKit/Blink Browsers */
|
||||
color: white;
|
||||
@@ -5132,8 +5113,11 @@ code, .code, pre code, .highlight pre {
|
||||
-webkit-transition: opacity .15s ease-in;
|
||||
transition: opacity .15s ease-in;
|
||||
}
|
||||
.facebook, .twitter, .instagram, .youtube {
|
||||
fill: #BABABA;
|
||||
.facebook,
|
||||
.twitter,
|
||||
.instagram,
|
||||
.youtube {
|
||||
fill: #bababa;
|
||||
}
|
||||
.facebook:hover {
|
||||
fill: #3b5998;
|
||||
@@ -5142,7 +5126,7 @@ code, .code, pre code, .highlight pre {
|
||||
fill: #55acee;
|
||||
}
|
||||
.twitter:hover {
|
||||
fill: #BABABA;
|
||||
fill: #bababa;
|
||||
}
|
||||
.instagram:hover {
|
||||
fill: #e95950;
|
||||
@@ -5150,6 +5134,32 @@ code, .code, pre code, .highlight pre {
|
||||
.youtube:hover {
|
||||
fill: #bb0000;
|
||||
}
|
||||
.mstdn {
|
||||
display: inline-block;
|
||||
background-color: #282c37;
|
||||
color: #d9e1e8;
|
||||
text-decoration: none;
|
||||
padding: 4px 10px 4px 30px;
|
||||
border-radius: 4px;
|
||||
font-size: 16px;
|
||||
background-image: url("data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2261.076954mm%22%20height%3D%2265.47831mm%22%20viewBox%3D%220%200%20216.4144%20232.00976%22%3E%3Cpath%20d%3D%22M211.80734%20139.0875c-3.18125%2016.36625-28.4925%2034.2775-57.5625%2037.74875-15.15875%201.80875-30.08375%203.47125-45.99875%202.74125-26.0275-1.1925-46.565-6.2125-46.565-6.2125%200%202.53375.15625%204.94625.46875%207.2025%203.38375%2025.68625%2025.47%2027.225%2046.39125%2027.9425%2021.11625.7225%2039.91875-5.20625%2039.91875-5.20625l.8675%2019.09s-14.77%207.93125-41.08125%209.39c-14.50875.7975-32.52375-.365-53.50625-5.91875C9.23234%20213.82%201.40609%20165.31125.20859%20116.09125c-.365-14.61375-.14-28.39375-.14-39.91875%200-50.33%2032.97625-65.0825%2032.97625-65.0825C49.67234%203.45375%2078.20359.2425%20107.86484%200h.72875c29.66125.2425%2058.21125%203.45375%2074.8375%2011.09%200%200%2032.975%2014.7525%2032.975%2065.0825%200%200%20.41375%2037.13375-4.59875%2062.915%22%20fill%3D%22%233088d4%22%2F%3E%3Cpath%20d%3D%22M177.50984%2080.077v60.94125h-24.14375v-59.15c0-12.46875-5.24625-18.7975-15.74-18.7975-11.6025%200-17.4175%207.5075-17.4175%2022.3525v32.37625H96.20734V85.42325c0-14.845-5.81625-22.3525-17.41875-22.3525-10.49375%200-15.74%206.32875-15.74%2018.7975v59.15H38.90484V80.077c0-12.455%203.17125-22.3525%209.54125-29.675%206.56875-7.3225%2015.17125-11.07625%2025.85-11.07625%2012.355%200%2021.71125%204.74875%2027.8975%2014.2475l6.01375%2010.08125%206.015-10.08125c6.185-9.49875%2015.54125-14.2475%2027.8975-14.2475%2010.6775%200%2019.28%203.75375%2025.85%2011.07625%206.36875%207.3225%209.54%2017.22%209.54%2029.675%22%20fill%3D%22%23fff%22%2F%3E%3C%2Fsvg%3E");
|
||||
background-size: 16px;
|
||||
background-repeat: no-repeat;
|
||||
background-position: top 50% left 8px;
|
||||
-webkit-transition: all 0.5s;
|
||||
transition: all 0.5s;
|
||||
}
|
||||
.mstdn:hover {
|
||||
background-color: #484c56;
|
||||
}
|
||||
.mstdn > span {
|
||||
color: #9baec8;
|
||||
font-size: 12px;
|
||||
padding-left: 3px;
|
||||
}
|
||||
.mstdn > span:before {
|
||||
content: "@";
|
||||
}
|
||||
@media (min-width: 75em) {
|
||||
|
||||
[data-scrolldir="down"] .sticky {
|
||||
@@ -5164,6 +5174,16 @@ code, .code, pre code, .highlight pre {
|
||||
right:0;
|
||||
}
|
||||
}
|
||||
#right-sidebar {
|
||||
scrollbar-width: none; /* hide scrollbar: Firefox */
|
||||
-ms-overflow-style: none; /* hide scrollbar: Internet Explorer 10+ */
|
||||
height: calc(100vh - 9rem);
|
||||
overflow-y: auto;
|
||||
}
|
||||
#right-sidebar::-webkit-scrollbar { /* hide scrollbar: WebKit */
|
||||
width: 0;
|
||||
height: 0;
|
||||
}
|
||||
.fill-current { fill: currentColor; }
|
||||
/* Background */
|
||||
.chroma { background-color: #ffffff }
|
||||
@@ -5295,10 +5315,33 @@ code, .code, pre code, .highlight pre {
|
||||
.chroma .gt { color: #aa0000 }
|
||||
/* TextWhitespace */
|
||||
.chroma .w { color: #bbbbbb }
|
||||
@media print {
|
||||
#page-footer,
|
||||
body > footer,
|
||||
body > nav {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
/*
|
||||
Make h6 elements behave like dt elements. Initially implemented to support
|
||||
linkable glossary entries.
|
||||
|
||||
Yes, it's a hack. That's why it's in the shame file.
|
||||
*/
|
||||
h6 {
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
font-size: 1.125rem;
|
||||
}
|
||||
h6:first-of-type {
|
||||
margin-top: 3em;
|
||||
}
|
||||
h6 ~ p {
|
||||
margin: 0.5em 0 2em 0;
|
||||
}
|
||||
.nested-blockquote blockquote {
|
||||
border-left: 4px solid #0594CB;
|
||||
padding-left: 1em;
|
||||
/*margin: 0;*/
|
||||
}
|
||||
.mw-90 {
|
||||
max-width:90%;
|
||||
|
||||
File diff suppressed because one or more lines are too long
Generated
+1
-1
@@ -1,5 +1,5 @@
|
||||
<h{{ .Level }} id="{{ .Anchor | safeURL }}">{{ .Text | safeHTML }}
|
||||
{{- if and (ge .Level 2) (le .Level 4) }}{{" " -}}
|
||||
{{- if in (slice 2 3 4 6) .Level }}{{" " -}}
|
||||
<a class="header-link" href="#{{ .Anchor | safeURL }}"><svg class="fill-current o-60 hover-accent-color-light" height="22px" viewBox="0 0 24 24" width="22px" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1zM8 13h8v-2H8v2zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5z"/></svg></a>
|
||||
{{- end -}}
|
||||
</h{{ .Level }}>
|
||||
|
||||
+250
@@ -0,0 +1,250 @@
|
||||
{{- /* Last modified: 2023-09-04T09:23:04-07:00 */}}
|
||||
|
||||
{{- /*
|
||||
Copyright 2023 Veriphor LLC
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
use this file except in compliance with the License. You may obtain a copy of
|
||||
the License at
|
||||
|
||||
https://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing permissions and limitations under
|
||||
the License.
|
||||
*/}}
|
||||
|
||||
{{- /*
|
||||
This render hook resolves internal destinations by looking for a matching:
|
||||
|
||||
1. Content page
|
||||
2. Page resource (a file in the current page bundle)
|
||||
3. Section resource (a file in the current section)
|
||||
4. Global resource (a file in the assets directory)
|
||||
|
||||
It skips the section resource lookup if the current page is a leaf bundle.
|
||||
|
||||
External destinations are not modified.
|
||||
|
||||
You must place global resources in the assets directory. If you have placed
|
||||
your resources in the static directory, and you are unable or unwilling to move
|
||||
them, you must mount the static directory to the assets directory by including
|
||||
both of these entries in your site configuration:
|
||||
|
||||
[[module.mounts]]
|
||||
source = 'assets'
|
||||
target = 'assets'
|
||||
|
||||
[[module.mounts]]
|
||||
source = 'static'
|
||||
target = 'assets'
|
||||
|
||||
By default, if this render hook is unable to resolve a destination, including a
|
||||
fragment if present, it passes the destination through without modification. To
|
||||
emit a warning or error, set the error level in your site configuration:
|
||||
|
||||
[params.render_hooks.link]
|
||||
errorLevel = 'warning' # ignore (default), warning, or error (fails the build)
|
||||
|
||||
When you set the error level to warning, and you are in a development
|
||||
environment, you can visually highlight broken internal links:
|
||||
|
||||
[params.render_hooks.link]
|
||||
errorLevel = 'warning' # ignore (default), warning, or error (fails the build)
|
||||
highlightBroken = true # true or false (default)
|
||||
|
||||
This will add a "broken" class to anchor elements with invalid src attributes.
|
||||
Add a rule to your CSS targeting the broken links:
|
||||
|
||||
a.broken {
|
||||
background: #ff0;
|
||||
border: 2px solid #f00;
|
||||
padding: 0.1em 0.2em;
|
||||
}
|
||||
|
||||
This render hook may be unable to resolve destinations created with the ref and
|
||||
relref shortcodes. Unless you set the error level to ignore you should not use
|
||||
either of these shortcodes in conjunction with this render hook.
|
||||
|
||||
@context {string} Destination The link destination.
|
||||
@context {page} Page A reference to the page containing the link.
|
||||
@context {string} PlainText The link description as plain text.
|
||||
@context {string} Text The link description.
|
||||
@context {string} Title The link title.
|
||||
|
||||
@returns {template.html}
|
||||
*/}}
|
||||
|
||||
{{- /* Initialize. */}}
|
||||
{{- $renderHookName := "link" }}
|
||||
|
||||
{{- /* Verify minimum required version. */}}
|
||||
{{- $minHugoVersion := "0.120.0" }}
|
||||
{{- if lt hugo.Version $minHugoVersion }}
|
||||
{{- errorf "The %q render hook requires Hugo v%s or later." $renderHookName $minHugoVersion }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Error level when unable to resolve destination: ignore, warning, or error. */}}
|
||||
{{- $errorLevel := or site.Params.render_hooks.link.errorLevel "ignore" | lower }}
|
||||
|
||||
{{- /* If true, adds "broken" class to broken links. Applicable in development environment when errorLevel is warning. */}}
|
||||
{{- $highlightBrokenLinks := or site.Params.render_hooks.link.highlightBroken false }}
|
||||
|
||||
{{- /* Validate error level. */}}
|
||||
{{- if not (in (slice "ignore" "warning" "error") $errorLevel) }}
|
||||
{{- errorf "The %q render hook is misconfigured. The errorLevel %q is invalid. Please check your site configuration." $renderHookName $errorLevel }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Determine content path for warning and error messages. */}}
|
||||
{{- $contentPath := "" }}
|
||||
{{- with .Page.File }}
|
||||
{{- $contentPath = .Path }}
|
||||
{{- else }}
|
||||
{{- $contentPath = .Path }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Parse destination. */}}
|
||||
{{- $u := urls.Parse .Destination }}
|
||||
|
||||
{{- /* Set common message. */}}
|
||||
{{- $msg := printf "The %q render hook was unable to resolve the destination %q in %s" $renderHookName $u.String $contentPath }}
|
||||
|
||||
{{- /* Set attributes for anchor element. */}}
|
||||
{{- $attrs := dict "href" $u.String }}
|
||||
{{- if $u.IsAbs }}
|
||||
{{- /* Destination is a remote resource. */}}
|
||||
{{- $attrs = merge $attrs (dict "rel" "external") }}
|
||||
{{- else }}
|
||||
{{- with $u.Path }}
|
||||
{{- with $p := or ($.Page.GetPage .) ($.Page.GetPage (strings.TrimRight "/" .)) }}
|
||||
{{- /* Destination is a page. */}}
|
||||
{{- $href := .RelPermalink }}
|
||||
{{- with $u.RawQuery }}
|
||||
{{- $href = printf "%s?%s" $href . }}
|
||||
{{- end }}
|
||||
{{- with $u.Fragment }}
|
||||
{{- $ctx := dict
|
||||
"contentPath" $contentPath
|
||||
"errorLevel" $errorLevel
|
||||
"page" $p
|
||||
"parsedURL" $u
|
||||
"renderHookName" $renderHookName
|
||||
}}
|
||||
{{- partial "inline/h-rh-l/validate-fragment.html" $ctx }}
|
||||
{{- $href = printf "%s#%s" $href . }}
|
||||
{{- end }}
|
||||
{{- $attrs = dict "href" $href }}
|
||||
{{- else }}
|
||||
{{- with $.Page.Resources.Get $u.Path }}
|
||||
{{- /* Destination is a page resource; drop query and fragment. */}}
|
||||
{{- $attrs = dict "href" .RelPermalink }}
|
||||
{{- else }}
|
||||
{{- with (and (ne $.Page.BundleType "leaf") ($.Page.CurrentSection.Resources.Get $u.Path)) }}
|
||||
{{- /* Destination is a section resource, and current page is not a leaf bundle. */}}
|
||||
{{- $attrs = dict "href" .RelPermalink }}
|
||||
{{- else }}
|
||||
{{- with resources.Get $u.Path }}
|
||||
{{- /* Destination is a global resource; drop query and fragment. */}}
|
||||
{{- $attrs = dict "href" .RelPermalink }}
|
||||
{{- else }}
|
||||
{{- if eq $errorLevel "warning" }}
|
||||
{{- warnf $msg }}
|
||||
{{- if and $highlightBrokenLinks hugo.IsDevelopment }}
|
||||
{{- $attrs = merge $attrs (dict "class" "broken") }}
|
||||
{{- end }}
|
||||
{{- else if eq $errorLevel "error" }}
|
||||
{{- errorf $msg }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- with $u.Fragment }}
|
||||
{{- /* Destination is on the same page; prepend relative permalink. */}}
|
||||
{{- $ctx := dict
|
||||
"contentPath" $contentPath
|
||||
"errorLevel" $errorLevel
|
||||
"page" $.Page
|
||||
"parsedURL" $u
|
||||
"renderHookName" $renderHookName
|
||||
}}
|
||||
{{- partial "inline/h-rh-l/validate-fragment.html" $ctx }}
|
||||
{{- $attrs = dict "href" (printf "%s#%s" $.Page.RelPermalink .) }}
|
||||
{{- else }}
|
||||
{{- if eq $errorLevel "warning" }}
|
||||
{{- warnf $msg }}
|
||||
{{- if and $highlightBrokenLinks hugo.IsDevelopment }}
|
||||
{{- $attrs = merge $attrs (dict "class" "broken") }}
|
||||
{{- end }}
|
||||
{{- else if eq $errorLevel "error" }}
|
||||
{{- errorf $msg }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with .Title }}
|
||||
{{- $attrs = merge $attrs (dict "title" .) }}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Render anchor element. */ -}}
|
||||
<a
|
||||
{{- range $k, $v := $attrs }}
|
||||
{{- printf " %s=%q" $k $v | safeHTMLAttr }}
|
||||
{{- end -}}
|
||||
>{{ .Text | safeHTML }}</a>
|
||||
|
||||
{{- define "partials/inline/h-rh-l/validate-fragment.html" }}
|
||||
{{- /*
|
||||
Validates the fragment portion of a link destination.
|
||||
|
||||
@context {string} contentPath The page containing the link.
|
||||
@context {srting} errorLevel The error level when unable to resolve destination; ignore (default), warning, or error.
|
||||
@context {page} page The page corresponding to the link destination
|
||||
@context {struct} parsedURL The link destination parsed by urls.Parse.
|
||||
@context {string} renderHookName The name of the render hook.
|
||||
*/}}
|
||||
|
||||
{{- /* Initialize. */}}
|
||||
{{- $contentPath := .contentPath }}
|
||||
{{- $errorLevel := .errorLevel }}
|
||||
{{- $p := .page }}
|
||||
{{- $u := .parsedURL }}
|
||||
{{- $renderHookName := .renderHookName }}
|
||||
|
||||
{{- /* Validate. */}}
|
||||
{{- with $u.Fragment }}
|
||||
{{- if $p.Fragments.Identifiers.Contains . }}
|
||||
{{- if gt ($p.Fragments.Identifiers.Count .) 1 }}
|
||||
{{- $msg := printf "The %q render hook detected duplicate heading IDs %q in %s" $renderHookName . $contentPath }}
|
||||
{{- if eq $errorLevel "warning" }}
|
||||
{{- warnf $msg }}
|
||||
{{- else if eq $errorLevel "error" }}
|
||||
{{- errorf $msg }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- /* Determine target path for warning and error message. */}}
|
||||
{{- $targetPath := "" }}
|
||||
{{- with $p.File }}
|
||||
{{- $targetPath = .Path }}
|
||||
{{- else }}
|
||||
{{- $targetPath = .Path }}
|
||||
{{- end }}
|
||||
{{- /* Set common message. */}}
|
||||
{{- $msg := printf "The %q render hook was unable to find heading ID %q in %s. See %s" $renderHookName . $targetPath $contentPath }}
|
||||
{{- if eq $targetPath $contentPath }}
|
||||
{{- $msg = printf "The %q render hook was unable to find heading ID %q in %s" $renderHookName . $targetPath }}
|
||||
{{- end }}
|
||||
{{- /* Throw warning or error. */}}
|
||||
{{- if eq $errorLevel "warning" }}
|
||||
{{- warnf $msg }}
|
||||
{{- else if eq $errorLevel "error" }}
|
||||
{{- errorf $msg }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- end -}}
|
||||
+3
-3
@@ -95,7 +95,7 @@
|
||||
{{- partial "opengraph/twitter_cards.html" . -}}
|
||||
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ partial "gtag" . }}
|
||||
{{ partial "gtag.html" . }}
|
||||
{{ end }}
|
||||
|
||||
</head>
|
||||
@@ -104,7 +104,7 @@
|
||||
class="ma0 sans-serif bg-primary-color-light{{ with getenv "HUGO_ENV" }}
|
||||
{{ . }}
|
||||
{{ end }}">
|
||||
{{ partial "hooks/after-body-start" . }}
|
||||
{{ partial "hooks/after-body-start.html" . }}
|
||||
{{ block "nav" . }}{{ partial "site-nav.html" . }}{{ end }}
|
||||
{{ block "header" . }}{{ end }}
|
||||
<main role="main" class="content-with-sidebar min-vh-100 pb7 pb0-ns">
|
||||
@@ -113,7 +113,7 @@
|
||||
|
||||
{{ block "footer" . }}{{ partialCached "site-footer.html" . }}{{ end }}
|
||||
|
||||
{{ partial "hooks/before-body-end" . }}
|
||||
{{ partial "hooks/before-body-end.html" . }}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
+24
-13
@@ -1,23 +1,30 @@
|
||||
<header class="flex-none w-100">
|
||||
{{ if .Params.categories }}
|
||||
{{ range .Params.categories }}
|
||||
<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}" class="f6 fw8 mb0 link mid-gray dim mr3">
|
||||
{{ humanize . | upper }}
|
||||
{{ if in (slice "functions" "methods") .Type }}
|
||||
{{ with .FirstSection }}
|
||||
<a href="{{ .RelPermalink }}" class="f6 fw8 mb0 link mid-gray dim mr3">
|
||||
{{ humanize .Title | upper }}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{end}}
|
||||
{{ with .CurrentSection }}
|
||||
<a href="{{ .RelPermalink }}" class="f6 fw8 mb0 link mid-gray dim mr3">
|
||||
{{ humanize .Title | upper }}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ range .Params.categories }}
|
||||
<a href="{{ "/categories/" | relLangURL }}{{ . | urlize }}" class="f6 fw8 mb0 link mid-gray dim mr3">
|
||||
{{ humanize . | upper }}
|
||||
</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
<h1 class="lh-title mb3 mv0 pt3 primary-color-dark">
|
||||
{{- if eq .Section "functions" -}}
|
||||
{{ .LinkTitle }}
|
||||
{{- else -}}
|
||||
{{ .Title }}
|
||||
{{- end -}}
|
||||
{{ .Title }}
|
||||
</h1>
|
||||
</header>
|
||||
|
||||
<aside class="bt bw1 pt3 mt2 mid-gray b--mid-gray fn w-100">
|
||||
{{ with .Params.description }}
|
||||
<div class="f4 fw4 lh-copy">
|
||||
<div class="mb4 f4 fw4 lh-copy">
|
||||
{{ . | markdownify }}
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -31,7 +38,11 @@
|
||||
<img src="{{ . }}" alt="Featured Image for {{ $.Title }}" class="mw-100">
|
||||
{{ end }}
|
||||
|
||||
<div class="prose prose-{{ .Type }}" id="prose">
|
||||
{{- partial "docs/functions-signature.html" . -}}
|
||||
<div class="prose" id="prose">
|
||||
<div class="mb4">
|
||||
{{- partial "docs/functions-signatures.html" . -}}
|
||||
{{- partial "docs/functions-return-type.html" . -}}
|
||||
{{- partial "docs/functions-aliases.html" . -}}
|
||||
</div>
|
||||
{{ .Content }}
|
||||
</div>
|
||||
|
||||
+8
-10
@@ -2,26 +2,24 @@
|
||||
<article class="w-100 ph4 pb5 pb6-ns pt1 pt5-ns">
|
||||
<div class="flex-l">
|
||||
|
||||
<div class="order-2 w-100 w-20-l ph5-m ph0-l mb4 sticky">
|
||||
{{- partial "toc.html" . -}}
|
||||
<div class="order-0 w-20 dn db-l">
|
||||
{{ partial "nav-links-docs.html" . }}
|
||||
</div>
|
||||
|
||||
<div class="order-1 w-60-l mw7 ph0 ph5-ns mid-gray nested-copy-line-height no-underline nested-links nested-img nested-copy-seperator nested-blockquote mt0-ns" style="flex-grow:1;">
|
||||
<div class="documentation-copy center measure-wide-l">
|
||||
<div id="readout" class="fixed right-0 bottom-0">
|
||||
</div>
|
||||
<div class="order-1 flex-grow-1 ph0 ph5-ns mt0-ns mid-gray nested-copy-line-height no-underline nested-links nested-img nested-copy-seperator nested-blockquote">
|
||||
<div style="max-width: 40rem;" class="documentation-copy">
|
||||
<div id="readout" class="fixed right-0 bottom-0"></div>
|
||||
{{ .Render "page" }}
|
||||
{{ partial "related.html" . }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="order-0 w-20 dn db-l">
|
||||
{{ partial "nav-links-docs.html" . }}
|
||||
<div id="right-sidebar" class="order-2 w-20 dn db-l sticky pt2">
|
||||
{{ partial "right-sidebar.html" . }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<div class="w-100 bg-light-gray">
|
||||
<div id="page-footer" class="w-100 bg-light-gray">
|
||||
<div class="mw7 pa4 center nested-lh-copy lh-copy">
|
||||
{{ partial "docs/page-meta-data.html" . }}
|
||||
{{ partial "page-edit.html" . }}
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
{{ define "header" }}
|
||||
{{ partial "hero" . }}
|
||||
{{ partial "boxes-small-news" . }}
|
||||
{{ partial "hero.html" . }}
|
||||
{{ partial "boxes-small-news.html" . }}
|
||||
{{ end }}
|
||||
|
||||
{{ define "main" }}
|
||||
<section class="w-100 ph4 ph5-ns pv4">
|
||||
{{- partial "home-page-sections/features-icons" . -}}
|
||||
{{- partial "home-page-sections/features-icons.html" . -}}
|
||||
</section>
|
||||
|
||||
{{ partial "home-page-sections/sponsors.html" (dict "cx" . "gtag" "home" ) }}
|
||||
|
||||
{{- partial "home-page-sections/features-single" . -}}
|
||||
{{- partial "home-page-sections/features-single.html" . -}}
|
||||
|
||||
{{- partial "home-page-sections/showcase.html" . -}}
|
||||
{{- partial "home-page-sections/showcase.html" . -}}
|
||||
|
||||
<section class="w-100 ph4 ph5-ns pv4 pv6-ns mid-gray bg-white bb bt b--light-gray">
|
||||
{{- partial "home-page-sections/installation" . -}}
|
||||
{{- partial "home-page-sections/installation.html" . -}}
|
||||
</section>
|
||||
|
||||
<section class="w-100 ph4 ph5-ns pv4 pv6-ns mid-gray bg-accent-color-dark">
|
||||
{{- partial "home-page-sections/tweets" . -}}
|
||||
{{- partial "home-page-sections/tweets.html" . -}}
|
||||
</section>
|
||||
<section class="w-100 ph4 ph5-ns pt4 pb5 mid-gray bg-primary-color-light bb bt b--light-gray ">
|
||||
{{- partial "home-page-sections/open-source-involvement" . -}}
|
||||
{{- partial "home-page-sections/open-source-involvement.html" . -}}
|
||||
</section>
|
||||
{{ end }}
|
||||
|
||||
Generated
@@ -10,32 +10,61 @@
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<!-- TODO: May be a good idea in this case to add monthly archives -->
|
||||
|
||||
<div class="flex flex-wrap">
|
||||
{{/* [wip] add archive lists
|
||||
<div class="w-100 w-20-ns dn">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="#">
|
||||
archive section
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div> */}}
|
||||
|
||||
{{ $interior_classes := $.Site.Params.flex_box_interior_classes }}
|
||||
<section class="flex-ns flex-wrap justify-between w-100 w-80-nsTK v-top">
|
||||
{{ $paginator := .Paginate (.Pages | lang.Merge (where .Sites.First.RegularPages "Section" .Section)) -}}
|
||||
{{ range $paginator.Pages }}
|
||||
{{ partial "boxes-section-summaries" (dict "context" . "classes" $interior_classes "fullcontent" false) }}
|
||||
|
||||
{{ $news_items := slice }}
|
||||
|
||||
{{/* Get releases from GitHub. */}}
|
||||
{{ $u := "https://api.github.com/repos/gohugoio/hugo/releases" }}
|
||||
{{ $releases := partial "inline/get-remote-data.html" $u }}
|
||||
{{ $releases = where $releases "draft" false }}
|
||||
{{ $releases = where $releases "prerelease" false }}
|
||||
{{ range $releases | first 20 }}
|
||||
{{ $ctx := dict
|
||||
"Date" (.published_at | time.AsTime)
|
||||
"Title" (printf "Release %s" .name)
|
||||
"Permalink" .html_url
|
||||
"Section" "news"
|
||||
"Summary" ""
|
||||
}}
|
||||
{{ $news_items = $news_items | append $ctx }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Get content pages from news section. */}}
|
||||
{{ range .Pages }}
|
||||
{{ $ctx := dict
|
||||
"Date" .Date
|
||||
"Title" .Title
|
||||
"RelPermalink" .RelPermalink
|
||||
"Section" "news"
|
||||
"Summary" .Summary
|
||||
"Params" (dict "description" .Description)
|
||||
}}
|
||||
{{ $news_items = $news_items | append $ctx }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Sort by date (descending) and render. */}}
|
||||
{{ range sort $news_items "Date" "desc" }}
|
||||
{{ partial "boxes-section-summaries.html" (dict "context" . "classes" $interior_classes "fullcontent" false) }}
|
||||
{{ end }}
|
||||
|
||||
</section>
|
||||
</div>
|
||||
<div class="nested-list-reset nested-links">
|
||||
{{/* pagination.html: https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/template_embedded.go#L117 */}}
|
||||
{{ template "_internal/pagination.html" . }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
{{ define "partials/inline/get-remote-data.html" }}
|
||||
{{ $u := . }}
|
||||
{{ $r := "" }}
|
||||
{{ with $r = resources.GetRemote $u }}
|
||||
{{ with .Err }}
|
||||
{{ errorf "%s" . }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ errorf "Unable to get remote resource %q" $u }}
|
||||
{{ end }}
|
||||
{{ return ($r | transform.Unmarshal) }}
|
||||
{{ end }}
|
||||
|
||||
@@ -34,9 +34,6 @@
|
||||
Go to <a href="https://github.com/gohugoio/hugo/releases" class="link primary-color dim">Hugo Releases</a> for the release downloads.
|
||||
</p>
|
||||
{{ end }}
|
||||
<!--
|
||||
NOTE: Removed to test builds without it.
|
||||
partial "components/author-github-data" (dict "context" . "size" "110") -->
|
||||
|
||||
<div class="nested-links mt4">
|
||||
{{- partial "previous-next-links-in-section.html" . -}}
|
||||
|
||||
Generated
+27
-16
@@ -1,35 +1,46 @@
|
||||
<div class="relative {{ .classes }} weight-{{ .context.Weight }}">
|
||||
|
||||
<div class="bg-white mb2 pa3 pa4-l gray">
|
||||
|
||||
{{ $href := .context.RelPermalink }}
|
||||
{{ if eq .context.Section "news" }}
|
||||
<date class="f6 db" datetime="{{ .Date.Format "2006-01-02T15:04:05Z07:00" }}">
|
||||
{{ $href = .context.Permalink }}
|
||||
<time class="f6 db" datetime="{{ .context.Date.Format `2006-01-02T15:04:05Z07:00` }}">
|
||||
{{ .context.Date.Format "January 2, 2006" }}
|
||||
</date>
|
||||
</time>
|
||||
{{ end }}
|
||||
|
||||
<h1 class="near-black f3">
|
||||
<a href="{{ .context.RelPermalink }}" class="link primary-color dim">
|
||||
{{- if eq .context.Section "functions" -}}
|
||||
{{ .context.LinkTitle }}
|
||||
{{- else -}}
|
||||
<a href="{{ $href }}" class="link primary-color dim">
|
||||
{{ .context.Title }}
|
||||
{{- end -}}
|
||||
</a>
|
||||
</h1>
|
||||
|
||||
<div class="lh-copy links">
|
||||
{{ if .context.Params.description }}
|
||||
{{ if eq .context.Section "commands" }}
|
||||
{{ replaceRE `(?s).*?##\s.*?\n\n(.*?)\n.*` "$1" .context.RawContent }}
|
||||
{{ else }}
|
||||
|
||||
{{ if in (slice "functions" "methods") .context.Type }}
|
||||
{{ with $signature := index .context.Params.action.signatures 0 }}
|
||||
{{ if $.context.Params.action.returnType }}
|
||||
{{ $signature = printf "%s ⟼ %s" $signature $.context.Params.action.returnType }}
|
||||
{{ end }}
|
||||
<pre class="f6 mb3 ph3 pv2 bg-light-gray overflow-x-auto">
|
||||
{{- $signature -}}
|
||||
</pre>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ if .context.Params.description }}
|
||||
{{ .context.Params.description | markdownify }}
|
||||
{{ else }}
|
||||
{{ .context.Summary }}
|
||||
{{ end }}
|
||||
|
||||
{{ end }}
|
||||
|
||||
<a href="{{ .context.RelPermalink }}" class="f6 mt2 db link primary-color dim">
|
||||
Read More »
|
||||
</a>
|
||||
|
||||
<a href="{{ $href }}" class="f6 mt2 db link primary-color dim">
|
||||
Read More »
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+1
-18
@@ -1,18 +1 @@
|
||||
<section class="relative w-100 bg-black white">
|
||||
<div class="flex flex-wrap w-90-l center center mw9">
|
||||
<!-- <a href="/news/" class="link accent-color tr-ns f6 w-100 w-50-m w-10-l bg-animate hover-bg-accent-color hover-white pv3 pv4-l ph3 ph4-l dib">
|
||||
Latest News:
|
||||
</a> -->
|
||||
{{ range first 4 ( sort (where .Site.RegularPages "Section" "news") "Date" "desc" ) }}
|
||||
<!-- only show 2 boxes on mobile -->
|
||||
{{ $.Scratch.Add "i" 1 }}{{ $i := $.Scratch.Get "i" }}
|
||||
<a href="{{ .RelPermalink }}" class="link lh-copy light-gray f6 w-100 w-50-m w-25-l bg-animate hover-bg-accent-color hover-white pv3 pv4-ns ph3 ph4-ns{{ if ge $i 3 }} dn dib-l{{ else }} dib{{ end }}">
|
||||
<span class="f6 gray pb1 db">
|
||||
{{ .Date.Format "January 2, 2006" }}
|
||||
</span>
|
||||
{{ .Params.description | markdownify | truncate 100 "…"}}
|
||||
</a>
|
||||
{{ end }}
|
||||
|
||||
</div>
|
||||
</section>
|
||||
{{/* Empty for now. */}}
|
||||
|
||||
Generated
+12
@@ -0,0 +1,12 @@
|
||||
{{- with .Params.action.aliases }}
|
||||
{{- $label := "Alias" }}
|
||||
{{- if gt (len .) 1 }}
|
||||
{{- $label = "Aliases" }}
|
||||
{{- end }}
|
||||
<p class="fw7 primary-color-dark">{{ $label }}</p>
|
||||
{{- range . }}
|
||||
<pre class="f5 ph3 pv2 bg-light-gray" style="border-left:4px solid #0594CB;">
|
||||
{{- . -}}
|
||||
</pre>
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
Generated
+6
@@ -0,0 +1,6 @@
|
||||
{{- with .Params.action.returnType }}
|
||||
<p class="fw7 primary-color-dark">Returns</p>
|
||||
<pre class="f5 ph3 pv2 bg-light-gray" style="border-left:4px solid #0594CB;">
|
||||
{{- . -}}
|
||||
</pre>
|
||||
{{- end -}}
|
||||
Generated
-11
@@ -1,11 +0,0 @@
|
||||
{{ if isset .Params "signature" -}}
|
||||
{{- with .Params.signature }}
|
||||
<h2 class="minor mb1 pt4 primary-color-dark">Syntax</h2>
|
||||
{{- range . }}
|
||||
<pre class="f5 mb4 ph3 pv2 bg-light-gray" style="border-left:4px solid #0594CB;">
|
||||
{{- . -}}
|
||||
</pre>
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{ end }}
|
||||
{{/* The inline style overrides `pre` styling defaults */}}
|
||||
Generated
+12
@@ -0,0 +1,12 @@
|
||||
{{- with .Params.action.signatures }}
|
||||
<p class="fw7 primary-color-dark">Syntax</p>
|
||||
{{- range . }}
|
||||
{{- $signature := . }}
|
||||
{{- if $.Params.function.returnType }}
|
||||
{{- $signature = printf "%s ⟼ %s" . $.Params.function.returnType }}
|
||||
{{- end }}
|
||||
<pre class="f5 ph3 pv2 bg-light-gray overflow-x-auto" style="border-left:4px solid #0594CB;">
|
||||
{{- $signature -}}
|
||||
</pre>
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
@@ -1,4 +1,4 @@
|
||||
{{ with .Site.GoogleAnalytics }}
|
||||
{{ with site.Config.Services.GoogleAnalytics.ID }}
|
||||
<script async src="https://www.googletagmanager.com/gtag/js?id={{ . }}"></script>
|
||||
<script>
|
||||
window.dataLayer = window.dataLayer || [];
|
||||
|
||||
Generated
+2
@@ -6,6 +6,7 @@
|
||||
|
||||
<div class="flex-ns flex-wrap justify-between">
|
||||
|
||||
{{ if $.Site.Data.homepagetweets }}
|
||||
{{ range first 4 (sort $.Site.Data.homepagetweets.tweet "date" "desc" ) }}
|
||||
<div class="homepage-tweet relative {{ $interior_classes }} br1 mid-gray pv3 nested-links shadow-5">
|
||||
<div class="absolute top-0 left-0 ma2 o-10">
|
||||
@@ -21,5 +22,6 @@
|
||||
</blockquote>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Generated
+7
-1
@@ -1 +1,7 @@
|
||||
{{/* Deliberately empty */}}
|
||||
{{ if .Page.Store.Get "hasMermaid" }}
|
||||
<script type="module" async>
|
||||
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@9/+esm';
|
||||
|
||||
mermaid.initialize({ startOnLoad: true });
|
||||
</script>
|
||||
{{ end }}
|
||||
|
||||
+2
-2
@@ -9,8 +9,8 @@
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{ partial "nav-links" .}}
|
||||
{{ partial "nav-links.html" .}}
|
||||
<div class="dn-l">
|
||||
{{ partial "nav-button-open" .}}
|
||||
{{ partial "nav-button-open.html" .}}
|
||||
</div>
|
||||
</header>
|
||||
|
||||
+1
-1
@@ -39,4 +39,4 @@
|
||||
{{ end }}{{ end }}
|
||||
|
||||
{{- /* Facebook Page Admin ID for Domain Insights */}}
|
||||
{{- with .Site.Social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}
|
||||
{{- with site.Params.social.facebook_admin }}<meta property="fb:admins" content="{{ . }}" />{{ end }}
|
||||
|
||||
Generated
+2
-2
@@ -17,6 +17,6 @@
|
||||
{{- end }}
|
||||
<meta name="twitter:title" content="{{ .Title }}"/>
|
||||
<meta name="twitter:description" content="{{ with .Description }}{{ . }}{{ else }}{{if .IsPage}}{{ .Summary }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}{{ end -}}"/>
|
||||
{{ with .Site.Social.twitter -}}
|
||||
{{ with site.Params.social.twitter -}}
|
||||
<meta name="twitter:site" content="@{{ . }}"/>
|
||||
{{ end -}}
|
||||
{{ end -}}
|
||||
|
||||
+6
-4
@@ -16,13 +16,15 @@
|
||||
</div>
|
||||
</article>
|
||||
|
||||
<!-- TODO: May be a good idea in this case to add monthly archives -->
|
||||
|
||||
<div class="flex flex-wrap">
|
||||
{{ $interior_classes := .context.Site.Params.flex_box_interior_classes }}
|
||||
<section class="flex-ns flex-wrap justify-between w-100">
|
||||
{{ range $section_to_display }}
|
||||
{{ partial "boxes-section-summaries" (dict "context" . "classes" $interior_classes "fullcontent" true) }}
|
||||
{{ $pages := $section_to_display }}
|
||||
{{ if in (slice "functions" "methods") $.context.Type }}
|
||||
{{ $pages = $.context.Pages }}
|
||||
{{ end }}
|
||||
{{ range $pages }}
|
||||
{{ partial "boxes-section-summaries.html" (dict "context" . "classes" $interior_classes "fullcontent" true) }}
|
||||
{{ end }}
|
||||
</section>
|
||||
</div>
|
||||
|
||||
+22
-9
@@ -1,9 +1,22 @@
|
||||
{{ $related := .Site.RegularPages.Related . | first 5 }}
|
||||
{{ with $related }}
|
||||
<h2>See Also</h2>
|
||||
<ul>
|
||||
{{ range . }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
{{ end }}
|
||||
{{- $heading := "See also" }}
|
||||
{{- $related := site.RegularPages.Related . | first 5 }}
|
||||
|
||||
{{- if in (slice "functions" "methods") .Type }}
|
||||
{{- $related = slice }}
|
||||
{{- range .Params.action.related }}
|
||||
{{- with site.GetPage (lower .) }}
|
||||
{{- $related = $related | append . }}
|
||||
{{- else }}
|
||||
{{- errorf "The 'related' partial was unable to get page %s" . }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- with $related }}
|
||||
<h2>{{ $heading }}</h2>
|
||||
<ul>
|
||||
{{- range . }}
|
||||
<li><a href="{{ .RelPermalink }}">{{ .Title }}</a></li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
{{- end }}
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
<aside class="right-0 f6 pv4 pv0-ns ph4-l nested-list-reset nested-copy-line-height">
|
||||
<div class="nested-links">
|
||||
{{- partial "previous-next-links-in-section.html" . }}
|
||||
</div>
|
||||
|
||||
{{- /* Table of contents is visible if toc = true in front matter. */}}
|
||||
{{- if .Params.toc }}
|
||||
<div class="nested-links">
|
||||
<p class="f5 fw8 mid-gray mb0">On this page</p>
|
||||
{{- .TableOfContents }}
|
||||
</div>
|
||||
{{- end }}
|
||||
|
||||
{{- /* Section menu for single pages is visible if showSectionMenu = true in top level section page. */}}
|
||||
{{- if .FirstSection.Params.showSectionMenu }}
|
||||
{{- with .CurrentSection.RegularPages }}
|
||||
<p class="mb0"><a class="link f5 fw8 mid-gray" href="{{ $.CurrentSection.RelPermalink }}">In this section</a></p>
|
||||
<nav>
|
||||
<ul>
|
||||
{{- range . }}
|
||||
<li>
|
||||
<a style="padding: 2px 5px;" class="dib link hover-bg-black-40 hover-white blue nl1" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
|
||||
</li>
|
||||
{{- end }}
|
||||
</ul>
|
||||
</nav>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</aside>
|
||||
+2
-2
@@ -30,9 +30,9 @@
|
||||
{{- partial "site-search.html" . -}}
|
||||
</div>
|
||||
|
||||
<span class="absolute mt1 mt2-l pr3 right-0 top-0">
|
||||
<div class="absolute mt1 mt2-l pr3 right-0 top-0 flex items-start">
|
||||
{{- partialCached "social-follow.html" . -}}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
+6
-4
@@ -1,7 +1,9 @@
|
||||
<!-- TODO: Add follow intents where available TODO: Revisit color and hover color -->
|
||||
{{ with .Site.Social.twitter }}
|
||||
{{/*
|
||||
Disable Twitter for now as we lost access to the account.
|
||||
with site.Params.social.twitter }}
|
||||
<a href="https://twitter.com/intent/follow?screen_name={{ . }}" title="Follow on Twitter" class="link-transition twitter link dib z-999 pt3 pt0-l mr2">
|
||||
{{ partial "svg/twitter.svg" (dict "size" "32px") }}
|
||||
</a>
|
||||
{{ end }}
|
||||
<a class="github-button needs-js link primary-color-dark" href="https://github.com/gohugoio/hugo" data-size="large" data-show-count="false" aria-label="Star gohugoio/hugo on GitHub">Star</a>
|
||||
{{ end */}}
|
||||
<a rel="me" class="mstdn mr3" href="https://fosstodon.org/@gohugoio" target="_blank">gohugoio</a>
|
||||
<a class="github-button needs-js link primary-color-dark" href="https://github.com/gohugoio/hugo" data-size="large" data-show-count="false" aria-label="Star gohugoio/hugo on GitHub">Star</a>
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
<!-- TOCs need to be declared explicitly in the front matter of content/*.md -->
|
||||
<aside class="fixed-lTK mw5-l right-0 f6 bl-l b--moon-gray pv4 pv0-ns ph4-l nested-list-reset nested-links nested-copy-line-height">
|
||||
{{ if .Params.toc }}
|
||||
<p class="b">What's on this Page</p>
|
||||
{{ .TableOfContents }}
|
||||
{{ end }}
|
||||
{{- partial "previous-next-links-in-section.html" . -}}
|
||||
|
||||
{{- if .Params.godocref -}}
|
||||
<a target="_blank" class="tooltip right godoc-link" data-tooltip="See the related Godocs for {{.Title }}" href="{{.Params.godocref}}" >
|
||||
</a>
|
||||
{{- end -}}
|
||||
</aside>
|
||||
+99
-22
@@ -1,24 +1,101 @@
|
||||
{{ $langs := (slice "yaml" "toml" "json") }}
|
||||
<div class="code relative" {{ with .Get "file" }}id="{{ . | urlize}}"{{ end }}>
|
||||
<div class="code-nav flex flex-nowrap items-stretch">
|
||||
{{- with .Get "file" -}}
|
||||
<div class="san-serif f6 dib lh-solid pl2 pv2 mr2">{{ . }}.</div>
|
||||
{{- end -}}
|
||||
{{ range $langs }}
|
||||
<button data-toggle-tab="{{ . }}" class="tab-button {{ cond (eq . "yaml") "active" ""}} ba san-serif f6 dib lh-solid ph2 pv2">{{ . }}</button>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
{{ range $langs }}
|
||||
<div data-pane="{{ . }}" class="code-copy-content nt3 tab-pane {{ cond (eq . "yaml") "active" ""}}">
|
||||
{{ highlight ($.Inner | transform.Remarshal . | safeHTML) . ""}}
|
||||
</div>
|
||||
{{ if ne ($.Get "copy") "false" }}
|
||||
<button class="needs-js copy copy-toggle bg-accent-color-dark f6 absolute top-0 right-0 lh-solid hover-bg-primary-color-dark bn white ph3 pv2" title="Copy this code to your clipboard." data-clipboard-action="copy" aria-label="copy button">
|
||||
</button>
|
||||
{{/* Functionality located within filesaver.js The copy here is located in the css with .copy class so it can be replaced with JS on success */}}
|
||||
{{end}}
|
||||
{{ end }}
|
||||
</div>
|
||||
{{- /*
|
||||
Renders syntax-highlighted configuration data in JSON, TOML, and YAML formats.
|
||||
|
||||
@param {string} [config] The section of site.Data.docs.config to render.
|
||||
@param {bool} [copy=false] If true, display a copy to clipboard button.
|
||||
@param {string} [file] The file name to display above the rendered code.
|
||||
@param {bool} [fm=false] If true, render the code as front matter.
|
||||
@param {bool} [skipHeader=false] If false, omit top level key(s) when rendering a section of site.Data.docs.config.
|
||||
|
||||
@returns {template.HTML}
|
||||
*/}}
|
||||
|
||||
{{- /* Initialize. */}}
|
||||
{{- $config := "" }}
|
||||
{{- $dataKey := "" }}
|
||||
{{- $copy := false }}
|
||||
{{- $file := "" }}
|
||||
{{- $fm := false }}
|
||||
{{- $skipHeader := false }}
|
||||
|
||||
{{- /* Get parameters. */}}
|
||||
{{- $config = .Get "config" }}
|
||||
{{- $dataKey = .Get "dataKey" }}
|
||||
{{- $file = .Get "file" }}
|
||||
{{- if in (slice "false" false 0) (.Get "copy") }}
|
||||
{{- $copy = false }}
|
||||
{{- else if in (slice "true" true 1) (.Get "copy") }}
|
||||
{{- $copy = true }}
|
||||
{{- end }}
|
||||
{{- if in (slice "false" false 0) (.Get "fm") }}
|
||||
{{- $fm = false }}
|
||||
{{- else if in (slice "true" true 1) (.Get "fm") }}
|
||||
{{- $fm = true }}
|
||||
{{- end }}
|
||||
{{- if in (slice "false" false 0) (.Get "skipHeader") }}
|
||||
{{- $skipHeader = false }}
|
||||
{{- else if in (slice "true" true 1) (.Get "skipHeader") }}
|
||||
{{- $skipHeader = true }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Define constants. */}}
|
||||
{{- $delimiters := dict "toml" "+++" "yaml" "---" }}
|
||||
{{- $langs := slice "yaml" "toml" "json" }}
|
||||
{{- $placeHolder := "#-hugo-placeholder-#" }}
|
||||
|
||||
{{- /* Render. */}}
|
||||
{{- $code := "" }}
|
||||
{{- if $config }}
|
||||
{{- $file = $file | default "hugo" }}
|
||||
{{- $sections := (split $config ".") }}
|
||||
{{- $configSection := index $.Site.Data.docs.config $sections }}
|
||||
{{- $code = dict $sections $configSection }}
|
||||
{{- if $skipHeader }}
|
||||
{{- $code = $configSection }}
|
||||
{{- end }}
|
||||
{{- else if $dataKey }}
|
||||
{{- $file = $file | default $dataKey }}
|
||||
{{- $sections := (split $dataKey ".") }}
|
||||
{{- $code = index $.Site.Data.docs $sections }}
|
||||
{{- else }}
|
||||
{{- $code = $.Inner }}
|
||||
{{- end }}
|
||||
<div class="code relative" {{ with $file }}id="{{ . | urlize }}"{{ end }}>
|
||||
<div class="code-nav flex flex-nowrap items-stretch">
|
||||
{{- with $file }}
|
||||
<div class="san-serif f6 dib lh-solid pl2 pv2 mr2">
|
||||
{{ . }}{{ if not $fm }}.{{ end }}
|
||||
</div>
|
||||
{{- end }}
|
||||
{{- range $langs }}
|
||||
<button
|
||||
data-toggle-tab="{{ . }}"
|
||||
class="tab-button {{ cond (eq . "yaml") "active" "" }} ba san-serif f6 dib lh-solid ph2 pv2">
|
||||
{{ . }}
|
||||
</button>
|
||||
|
||||
{{- end }}
|
||||
</div>
|
||||
<div class="tab-content">
|
||||
{{- range $langs }}
|
||||
<div
|
||||
data-pane="{{ . }}"
|
||||
class="code-copy-content nt3 tab-pane {{ cond (eq . "yaml") "active" "" }}">
|
||||
{{- $hCode := $code | transform.Remarshal . }}
|
||||
{{- if and $fm (in (slice "toml" "yaml") .) }}
|
||||
{{- $hCode = printf "%s\n%s\n%s" $placeHolder $hCode $placeHolder }}
|
||||
{{- end }}
|
||||
{{- $hCode = $hCode | replaceRE `\n+` "\n" }}
|
||||
{{ highlight $hCode . "" | replaceRE $placeHolder (index $delimiters .) | safeHTML }}
|
||||
</div>
|
||||
{{- if $copy }}
|
||||
<button
|
||||
class="needs-js copy copy-toggle bg-accent-color-dark f6 absolute top-0 right-0 lh-solid hover-bg-primary-color-dark bn white ph3 pv2"
|
||||
title="Copy this code to your clipboard."
|
||||
data-clipboard-action="copy"
|
||||
aria-label="copy button"></button>
|
||||
{{- /* Functionality located within filesaver.js The copy here is located in the css with .copy class so it can be replaced with JS on success */}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+32
-12
@@ -1,15 +1,35 @@
|
||||
<div class="code relative bg-primary-color moon-gray" id="{{.Get "file" | urlize}}">
|
||||
{{- with .Get "file" -}}
|
||||
<div class="filename san-serif f6 dib lh-solid pl2 pv2">{{.}}</div>
|
||||
{{- end -}}
|
||||
{{- /*
|
||||
Renders syntax highlighted code.
|
||||
|
||||
{{ if ne (.Get "copy") "false" }}
|
||||
<button class="needs-js copy bg-accent-color-dark f6 absolute top-0 right-0 lh-solid hover-bg-primary-color-dark bn white ph3 pv2" title="Copy this code to your clipboard." data-clipboard-action="copy" aria-label="copy button">
|
||||
</button>
|
||||
{{/* Functionality located within filesaver.js The copy here is located in the css with .copy class so it can be replaced with JS on success */}}
|
||||
{{end}}
|
||||
<div class="code-copy-content nt3" {{with .Get "download"}}id="{{.}}"{{end}}>
|
||||
{{- .Inner -}}
|
||||
</div>
|
||||
@param {bool} [copy=false] If true, display a copy to clipboard button.
|
||||
@param {string} [file] The file name to display above the rendered code.
|
||||
@param {string} [lang] The code language of the inner content.
|
||||
|
||||
@returns {template.HTML}
|
||||
*/}}
|
||||
|
||||
{{- /* Get parameters. */}}
|
||||
{{- $copy := false }}
|
||||
{{- if in (slice "false" false 0) (.Get "copy") }}
|
||||
{{- $copy = false }}
|
||||
{{- else if in (slice "true" true 1) (.Get "copy")}}
|
||||
{{- $copy = true }}
|
||||
{{- end }}
|
||||
{{- $file := or (.Get "file") " " }}
|
||||
{{- $lang := or (.Get "lang") (path.Ext $file | strings.TrimPrefix ".") "text" }}
|
||||
|
||||
{{- /* Use the go-html-template Chroma lexer for HTML. */}}
|
||||
{{- if eq $lang "html" }}
|
||||
{{- $lang = "go-html-template" }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Render. */}}
|
||||
<div class="code relative" id="{{ $file | urlize }}">
|
||||
<div class="f6 dib lh-solid pl2 pv2">{{ $file | htmlUnescape }}</div>
|
||||
{{- if $copy }}
|
||||
<button class="needs-js copy bg-accent-color-dark f6 absolute top-0 right-0 lh-solid hover-bg-primary-color-dark bn white ph3 pv2" title="Copy this code to your clipboard." data-clipboard-action="copy" aria-label="copy button"></button>
|
||||
{{- end }}
|
||||
<div class="code-copy-content nt3">
|
||||
{{- highlight (trim .Inner "\n\r") $lang }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+33
-18
@@ -1,18 +1,33 @@
|
||||
<table class="utils-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="col-title">Title</td>
|
||||
<td class="col-author">Author</td>
|
||||
<td class="col-date">Date</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ range $ind, $art := $.Site.Data.articles.article }}
|
||||
<tr>
|
||||
<td><a href="{{$art.url}}" target="_blank">{{$art.title | markdownify }}</a></td>
|
||||
<td>{{ $art.author | markdownify }}</td>
|
||||
<td>{{ $art.date }}</td>
|
||||
</tr>
|
||||
{{ end }}
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $package := (index .Params 0) }}
|
||||
{{ $listname := (index .Params 1) }}
|
||||
{{ $list := (index (index .Site.Data.docs $package) $listname) }}
|
||||
{{ $fields := after 2 .Params }}
|
||||
|
||||
|
||||
<table class="table table-bordered">
|
||||
<tr>
|
||||
{{ range $fields }}
|
||||
{{ $s := . }}
|
||||
{{ if eq $s "_key" }}
|
||||
{{ $s = "Type" }}
|
||||
{{ end }}
|
||||
<th>{{ $s }}</th>
|
||||
{{ end }}
|
||||
</tr>
|
||||
{{ range $k1, $v1 := $list }}
|
||||
<tr>
|
||||
{{ range $k2, $v2 := . }}
|
||||
{{ $.Scratch.Set $k2 $v2 }}
|
||||
{{ end }}
|
||||
{{ range $fields }}
|
||||
{{ $s := "" }}
|
||||
{{ if eq . "_key" }}
|
||||
{{ $s = $k1 }}
|
||||
{{ else }}
|
||||
{{ $s = $.Scratch.Get . }}
|
||||
{{ end }}
|
||||
<td>{{ $s }}</td>
|
||||
{{ end }}
|
||||
</tr>
|
||||
{{ end }}
|
||||
</table>
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
{{ $_hugo_config := `{ "version": 1 }` }}
|
||||
|
||||
{{ with .Get 0 }}
|
||||
{{ $version := printf "v%v" (strings.TrimLeft "vV" .) }}
|
||||
{{ $href := printf "https://github.com/gohugoio/hugo/releases/tag/%s" $version }}
|
||||
<aside>
|
||||
<div class="admonition-content bl bw2 b--dark-red" >
|
||||
<p>Deprecated in <a href="{{ $href }}">{{ $version }}</a></p>
|
||||
{{ $.Inner }}
|
||||
</div>
|
||||
</aside>
|
||||
{{ else }}
|
||||
{{ errorf "The %q shortcode requires a single positional parameter indicating version. See %s" .Name .Position }}
|
||||
{{ end }}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
{{- $pathURL := .Get "pathURL" -}}
|
||||
{{- $path := .Get "path" -}}
|
||||
{{- $files := readDir $path -}}
|
||||
<table>
|
||||
<th>Size in bytes</th>
|
||||
<th>Name</th>
|
||||
{{- range $files }}
|
||||
<tr>
|
||||
<td>{{ .Size }}</td>
|
||||
<td><a href="{{ $pathURL }}{{ .Name | relURL }}" target="_blank"> {{ .Name }}</a></td>
|
||||
</tr>
|
||||
{{- end }}
|
||||
</table>
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
{{ $file := .Get 0}}
|
||||
{{ $filepath := $file }}
|
||||
{{ $syntax := index (split $file ".") 1 }}
|
||||
{{ $syntaxoverride := eq (len .Params) 2 }}
|
||||
<div class="code-copy" id="{{$file | urlize}}">
|
||||
<div class="code-copy-header"><div class="action-buttons"></div><span title="" class="filename">{{$filepath}}</span><i class="icon-{{$syntax}} input"></i></div>
|
||||
<button class="copy-button" title="Copy to clipboard" data-clipboard-snippet>
|
||||
<div class="copy-text"><i class="icon-clipboard"></i> COPY</div>
|
||||
</button>
|
||||
<pre><code class="language-{{if $syntaxoverride}}{{.Get 1}}{{else}}{{$syntax}}{{end}}">{{- readFile $file -}}</code></pre>
|
||||
</div>
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
{{ $file := .Get 0}}
|
||||
{{ $filepath := replace $file "static/" ""}}
|
||||
{{ $syntax := index (split $file ".") 1 }}
|
||||
{{ $syntaxoverride := eq (len .Params) 2 }}
|
||||
<div class="code-copy" id="{{$file | urlize}}">
|
||||
<div class="code-copy-header examplesite"><div class="action-buttons"></div><span class="filename"><i class="icon-website"></i>{{$filepath}}</span><i class="icon-{{$syntax}} input"></i></div>
|
||||
<button class="copy-button" title="Copy to clipboard" data-clipboard-snippet>
|
||||
<div class="copy-text"><i class="icon-clipboard"></i> COPY</div>
|
||||
</button>
|
||||
<pre><code class="language-{{if $syntaxoverride}}{{.Get 1}}{{else}}{{$syntax}}{{end}}">{{- readFile $file -}}</code></pre>
|
||||
<a role="button" target="_blank" href="{{$.Site.Params.ghdocsrepo}}{{$file}}" title="See {{$filepath}} source on GitHub" class="tooltip see-on-github" data-tooltip="See {{$filepath}} source on GitHub">Source<i class="icon-github"></i></a>
|
||||
</div>
|
||||
@@ -1,13 +0,0 @@
|
||||
<!-- Similar to exfile.html but *only* pulls the front matter from the example/content/*md -->
|
||||
{{ $file := .Get 0}}
|
||||
{{ $filepath := replace $file "static/" ""}}
|
||||
{{ $syntax := index (split $file ".") 1 }}
|
||||
{{ $syntaxoverride := eq (len .Params) 2 }}
|
||||
<div class="code-copy" id="{{$file | urlize}}">
|
||||
<div class="code-copy-header examplesite"><div class="action-buttons"></div><span title="" class="filename">{{$filepath}}</span><i class="icon-{{$syntax}} input"></i></div>
|
||||
<button class="copy-button" title="Copy to clipboard" data-clipboard-snippet>
|
||||
<div class="copy-text"><i class="icon-clipboard"></i> COPY</div>
|
||||
</button>
|
||||
<pre><code class="language-{{if $syntaxoverride}}{{.Get 1}}{{else}}{{$syntax}}{{end}}">{{- readFile $file -}}</code></pre>
|
||||
<a role="button" target="_blank" href="{{$.Site.Params.ghdocsrepo}}{{$file}}" title="See {{$filepath}} on GitHub" class="see-on-github">Source<i class="icon-github"></i></a>
|
||||
</div>
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
<h4 class="minor mb1 pt2 primary-color-dark">Syntax</h4>
|
||||
<pre class="f5 mb4 ph3 pv2 bg-light-gray overflow-x-auto" style="border-left:4px solid #0594CB;">
|
||||
{{- .Inner -}}
|
||||
</pre>
|
||||
@@ -1,9 +0,0 @@
|
||||
{{ range .Params }}
|
||||
{{ if eq (substr . 0 1) "@" }}
|
||||
<a href="//github.com/{{ substr . 1 }}">{{ . }}</a>
|
||||
{{ else if eq (substr . 0 2) "0x" }}
|
||||
<a href="//github.com/gohugoio/hugo/commit/{{ substr . 2 }}">{{ substr . 2 6 }}</a>
|
||||
{{ else }}
|
||||
<a href="//github.com/gohugoio/hugo/issues/{{ . }}">#{{ . }}</a>
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
-1
@@ -1 +0,0 @@
|
||||
<a href="{{$.Site.Params.ghrepo}}" target="_blank">GitHub repository</a>
|
||||
@@ -0,0 +1,374 @@
|
||||
{{- /*
|
||||
Renders the given image using the given filter, if any.
|
||||
|
||||
@param {string} src The path to the image which must be a remote, page, or global resource.
|
||||
@param {string} [filter] The filter to apply to the image (case-insensitive).
|
||||
@param {string} [filterArgs] A comma-delimited list of arguments to pass to the filter.
|
||||
@param {bool} [example=false] If true, renders a before/after example.
|
||||
@param {int} [exampleWidth=384] Image width, in pixels, when rendering a before/after example.
|
||||
|
||||
@returns {template.HTML}
|
||||
|
||||
@examples
|
||||
|
||||
{{< img src="zion-national-park.jpg" >}}
|
||||
|
||||
{{< img src="zion-national-park.jpg" alt="Zion National Park" >}}
|
||||
|
||||
{{< img
|
||||
src="zion-national-park.jpg"
|
||||
alt="Zion National Park"
|
||||
filter="grayscale"
|
||||
>}}
|
||||
|
||||
{{< img
|
||||
src="zion-national-park.jpg"
|
||||
alt="Zion National Park"
|
||||
filter="process"
|
||||
filterArgs="resize 400x webp"
|
||||
>}}
|
||||
|
||||
{{< img
|
||||
src="zion-national-park.jpg"
|
||||
alt="Zion National Park"
|
||||
filter="colorize"
|
||||
filterArgs="180,50,20"
|
||||
>}}
|
||||
|
||||
{{< img
|
||||
src="zion-national-park.jpg"
|
||||
alt="Zion National Park"
|
||||
filter="grayscale"
|
||||
example=true
|
||||
>}}
|
||||
|
||||
{{< img
|
||||
src="zion-national-park.jpg"
|
||||
alt="Zion National Park"
|
||||
filter="grayscale"
|
||||
example=true
|
||||
exampleWidth=400
|
||||
>}}
|
||||
|
||||
When using the text filter, provide the arguments in this order:
|
||||
|
||||
0. The text
|
||||
1. The horizontal offset, in pixels, relative to the left of the image (default 20)
|
||||
2. The vertical offset, in pixels, relative to the top of the image (default 20)
|
||||
3. The font size in pixels (default 64)
|
||||
4. The line height (default 1.2)
|
||||
5. The font color (default #ffffff)
|
||||
|
||||
{{< img
|
||||
src="images/examples/zion-national-park.jpg"
|
||||
alt="Zion National Park"
|
||||
filter="Text"
|
||||
filterArgs="Zion National Park,25,250,56"
|
||||
example=true
|
||||
>}}
|
||||
|
||||
When using the padding filter, provide all arguments in this order:
|
||||
|
||||
0. Padding top
|
||||
1. Padding right
|
||||
2. Padding bottom
|
||||
3. Padding right
|
||||
4. Canvas color
|
||||
|
||||
{{< img
|
||||
src="images/examples/zion-national-park.jpg"
|
||||
alt="Zion National Park"
|
||||
filter="Padding"
|
||||
filterArgs="20,50,20,50,#0705"
|
||||
example=true
|
||||
>}}
|
||||
|
||||
*/}}
|
||||
|
||||
{{- /* Initialize. */}}
|
||||
{{- $alt := "" }}
|
||||
{{- $src := "" }}
|
||||
{{- $filter := "" }}
|
||||
{{- $filterArgs := slice }}
|
||||
{{- $example := false }}
|
||||
{{- $exampleWidth := 384 }}
|
||||
|
||||
{{- /* Default values to use with the text filter. */}}
|
||||
{{ $textFilterOpts := dict
|
||||
"xOffset" 20
|
||||
"yOffset" 20
|
||||
"fontSize" 64
|
||||
"lineHeight" 1.2
|
||||
"fontColor" "#ffffff"
|
||||
"fontPath" "https://github.com/google/fonts/raw/main/apache/roboto/static/Roboto-Regular.ttf"
|
||||
}}
|
||||
|
||||
{{- /* Get and validate parameters. */}}
|
||||
{{- with .Get "alt" }}
|
||||
{{- $alt = .}}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Get "src" }}
|
||||
{{- $src = . }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode requires a file parameter. See %s" .Name .Position }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Get "filter" }}
|
||||
{{- $filter = . | lower }}
|
||||
{{- end }}
|
||||
|
||||
{{- $validFilters := slice
|
||||
"brightness" "colorbalance" "colorize" "contrast" "gamma" "gaussianblur"
|
||||
"grayscale" "hue" "invert" "none" "opacity" "overlay" "padding" "pixelate"
|
||||
"process" "saturation" "sepia" "sigmoid" "text" "unsharpmask"
|
||||
}}
|
||||
|
||||
{{- with $filter }}
|
||||
{{- if not (in $validFilters .) }}
|
||||
{{- errorf "The filter passed to the %q shortcode is invalid. The filter must be one of %s. See %s" $.Name (delimit $validFilters ", " ", or ") $.Position }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Get "filterArgs" }}
|
||||
{{- $filterArgs = split . "," }}
|
||||
{{- $filterArgs = apply $filterArgs "trim" "." " " }}
|
||||
{{- end }}
|
||||
|
||||
{{- if in (slice "false" false 0) (.Get "example") }}
|
||||
{{- $example = false }}
|
||||
{{- else if in (slice "true" true 1) (.Get "example")}}
|
||||
{{- $example = true }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Get "exampleWidth" }}
|
||||
{{- $exampleWidth = . | int }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Get image. */}}
|
||||
{{- $ctx := dict "page" .Page "src" $src "name" .Name "position" .Position }}
|
||||
{{- $i := partial "inline/get-resource.html" $ctx }}
|
||||
|
||||
{{- /* Resize if rendering before/after examples. */}}
|
||||
{{- if $example }}
|
||||
{{- $i = $i.Resize (printf "%dx" $exampleWidth) }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Create filter. */}}
|
||||
{{- $f := "" }}
|
||||
{{- $ctx := dict "filter" $filter "args" $filterArgs "name" .Name "position" .Position }}
|
||||
{{- if eq $filter "brightness" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 1) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $filterArgs = apply $filterArgs "float" "." }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 0) "min" -100 "max" 100) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $f = images.Brightness (index $filterArgs 0) }}
|
||||
{{- else if eq $filter "colorbalance" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 3) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $filterArgs = apply $filterArgs "float" "." }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "percentage red" "argValue" (index $filterArgs 0) "min" -100 "max" 500) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "percentage green" "argValue" (index $filterArgs 1) "min" -100 "max" 500) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "percentage blue" "argValue" (index $filterArgs 2) "min" -100 "max" 500) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $f = images.ColorBalance (index $filterArgs 0) (index $filterArgs 1) (index $filterArgs 2) }}
|
||||
{{- else if eq $filter "colorize" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 3) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $filterArgs = apply $filterArgs "float" "." }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "hue" "argValue" (index $filterArgs 0) "min" 0 "max" 360) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "saturation" "argValue" (index $filterArgs 1) "min" 0 "max" 100) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 2) "min" 0 "max" 100) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $f = images.Colorize (index $filterArgs 0) (index $filterArgs 1) (index $filterArgs 2) }}
|
||||
{{- else if eq $filter "contrast" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 1) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $filterArgs = apply $filterArgs "float" "." }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 0) "min" -100 "max" 100) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $f = images.Contrast (index $filterArgs 0) }}
|
||||
{{- else if eq $filter "gamma" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 1) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $filterArgs = apply $filterArgs "float" "." }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "gamma" "argValue" (index $filterArgs 0) "min" 0 "max" 100) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $f = images.Gamma (index $filterArgs 0) }}
|
||||
{{- else if eq $filter "gaussianblur" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 1) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $filterArgs = apply $filterArgs "float" "." }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "sigma" "argValue" (index $filterArgs 0) "min" 0 "max" 1000) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $f = images.GaussianBlur (index $filterArgs 0) }}
|
||||
{{- else if eq $filter "grayscale" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 0) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $f = images.Grayscale }}
|
||||
{{- else if eq $filter "hue" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 1) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $filterArgs = apply $filterArgs "float" "." }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "shift" "argValue" (index $filterArgs 0) "min" -180 "max" 180) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $f = images.Hue (index $filterArgs 0) }}
|
||||
{{- else if eq $filter "invert" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 0) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $f = images.Invert }}
|
||||
{{- else if eq $filter "opacity" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 1) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $filterArgs = apply $filterArgs "float" "." }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "opacity" "argValue" (index $filterArgs 0) "min" 0 "max" 1) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $f = images.Opacity (index $filterArgs 0) }}
|
||||
{{- else if eq $filter "overlay" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 3) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $ctx := dict "src" (index $filterArgs 0) "name" .Name "position" .Position }}
|
||||
{{- $overlayImg := partial "inline/get-resource.html" $ctx }}
|
||||
{{- $f = images.Overlay $overlayImg (index $filterArgs 1 | float ) (index $filterArgs 2 | float) }}
|
||||
{{- else if eq $filter "padding" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 5) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $f = images.Padding
|
||||
(index $filterArgs 0 | int)
|
||||
(index $filterArgs 1 | int)
|
||||
(index $filterArgs 2 | int)
|
||||
(index $filterArgs 3 | int)
|
||||
(index $filterArgs 4)
|
||||
}}
|
||||
{{- else if eq $filter "pixelate" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 1) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $filterArgs = apply $filterArgs "float" "." }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "size" "argValue" (index $filterArgs 0) "min" 0 "max" 1000) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $f = images.Pixelate (index $filterArgs 0) }}
|
||||
{{- else if eq $filter "process" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 1) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $f = images.Process (index $filterArgs 0) }}
|
||||
{{- else if eq $filter "saturation" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 1) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $filterArgs = apply $filterArgs "float" "." }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 0) "min" -100 "max" 500) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $f = images.Saturation (index $filterArgs 0) }}
|
||||
{{- else if eq $filter "sepia" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 1) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $filterArgs = apply $filterArgs "float" "." }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "percentage" "argValue" (index $filterArgs 0) "min" 0 "max" 100) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $f = images.Sepia (index $filterArgs 0) }}
|
||||
{{- else if eq $filter "sigmoid" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 2) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $filterArgs = apply $filterArgs "float" "." }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "midpoint" "argValue" (index $filterArgs 0) "min" 0 "max" 1) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "factor" "argValue" (index $filterArgs 1) "min" -10 "max" 10) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $f = images.Sigmoid (index $filterArgs 0) (index $filterArgs 1) }}
|
||||
{{- else if eq $filter "text" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 1) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $ctx := dict "src" $textFilterOpts.fontPath "name" .Name "position" .Position }}
|
||||
{{- $font := or (partial "inline/get-resource.html" $ctx) }}
|
||||
{{- $fontSize := or (index $filterArgs 3 | int) $textFilterOpts.fontSize }}
|
||||
{{- $lineHeight := math.Max (or (index $filterArgs 4 | float) $textFilterOpts.lineHeight) 1 }}
|
||||
{{- $opts := dict
|
||||
"x" (or (index $filterArgs 1 | int) $textFilterOpts.xOffset)
|
||||
"y" (or (index $filterArgs 2 | int) $textFilterOpts.yOffset)
|
||||
"size" $fontSize
|
||||
"linespacing" (mul (sub $lineHeight 1) $fontSize)
|
||||
"color" (or (index $filterArgs 5) $textFilterOpts.fontColor)
|
||||
"font" $font
|
||||
}}
|
||||
{{- $f = images.Text (index $filterArgs 0) $opts }}
|
||||
{{- else if eq $filter "unsharpmask" }}
|
||||
{{- $ctx = merge $ctx (dict "argsRequired" 3) }}
|
||||
{{- template "validate-arg-count" $ctx }}
|
||||
{{- $filterArgs = apply $filterArgs "float" "." }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "sigma" "argValue" (index $filterArgs 0) "min" 0 "max" 500) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "amount" "argValue" (index $filterArgs 1) "min" 0 "max" 100) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $ctx = merge $ctx (dict "argName" "threshold" "argValue" (index $filterArgs 2) "min" 0 "max" 1) }}
|
||||
{{- template "validate-arg-value" $ctx }}
|
||||
{{- $f = images.UnsharpMask (index $filterArgs 0) (index $filterArgs 1) (index $filterArgs 2) }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Apply filter. */}}
|
||||
{{- $fi := $i }}
|
||||
{{- with $f }}
|
||||
{{- $fi = $i.Filter . }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Render. */}}
|
||||
{{- if $example }}
|
||||
<p>Original</p>
|
||||
<img class='di ba b--black-20' style="width: initial;" src="{{ $i.RelPermalink }}" alt="{{ $alt }}">
|
||||
<p>Processed</p>
|
||||
<img class='di ba b--black-20' style="width: initial;" src="{{ $fi.RelPermalink }}" alt="{{ $alt }}">
|
||||
{{- else -}}
|
||||
<img class='di' style="width: initial;" src="{{ $fi.RelPermalink }}" alt="{{ $alt }}">
|
||||
{{- end }}
|
||||
|
||||
{{- define "validate-arg-count" }}
|
||||
{{- $msg := "When using the %q filter, the %q shortcode requires an args parameter with %d %s. See %s" }}
|
||||
{{- if lt (len .args) .argsRequired }}
|
||||
{{- $text := "values" }}
|
||||
{{- if eq 1 .argsRequired }}
|
||||
{{- $text = "value" }}
|
||||
{{- end }}
|
||||
{{- errorf $msg .filter .name .argsRequired $text .position }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "validate-arg-value" }}
|
||||
{{- $msg := "The %q argument passed to the %q shortcode is invalid. Expected a value in the range [%v,%v], but received %v. See %s" }}
|
||||
{{- if or (lt .argValue .min) (gt .argValue .max) }}
|
||||
{{- errorf $msg .argName .name .min .max .argValue .position }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "partials/inline/get-resource.html" }}
|
||||
{{- $r := "" }}
|
||||
{{- $u := urls.Parse .src }}
|
||||
{{- $msg := "The %q shortcode was unable to resolve %s. See %s" }}
|
||||
{{- if $u.IsAbs }}
|
||||
{{- with resources.GetRemote $u.String }}
|
||||
{{- with .Err }}
|
||||
{{- errorf "%s" }}
|
||||
{{- else }}
|
||||
{{- /* This is a remote resource. */}}
|
||||
{{- $r = . }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf $msg $.name $u.String $.position }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- with .page.Resources.Get (strings.TrimPrefix "./" $u.Path) }}
|
||||
{{- /* This is a page resource. */}}
|
||||
{{- $r = . }}
|
||||
{{- else }}
|
||||
{{- with resources.Get $u.Path }}
|
||||
{{- /* This is a global resource. */}}
|
||||
{{- $r = . }}
|
||||
{{- else }}
|
||||
{{- errorf $msg $.name $u.Path $.position }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- return $r}}
|
||||
{{- end -}}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
{{- /*
|
||||
Renders the given image using the given process specification.
|
||||
|
||||
@param {string} (positional parameter 0) The path to the image, relative to the current page. The image must be a page resource.
|
||||
@param {string}} (positional parameter 1) The image processing specification.
|
||||
|
||||
@returns template.HTML
|
||||
|
||||
@example {{< imgproc "sunset.jpg" "resize 300x" />}}
|
||||
*/}}
|
||||
|
||||
{{- with $.Get 0 }}
|
||||
{{- with $i := $.Page.Resources.Get . }}
|
||||
{{- with $spec := $.Get 1 }}
|
||||
{{- with $i.Process . }}
|
||||
<figure style="padding: 0.25rem; margin: 2rem 0; background-color: #cccc">
|
||||
<img style="max-width: 100%; width: auto; height: auto;" src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="">
|
||||
<figcaption>
|
||||
<small>
|
||||
{{- with $.Inner }}
|
||||
{{ . }}
|
||||
{{- else }}
|
||||
{{ $spec }}
|
||||
{{- end }}
|
||||
</small>
|
||||
</figcaption>
|
||||
</figure>
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode requires a positional parameter (1) containing the image processing specification. See %s" $.Name $.Position }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode was unable to find %q. See %s" $.Name . $.Position }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode requires a positional parameter (0) indicating the image path, relative to the current page. See %s" $.Name $.Position }}
|
||||
{{- end }}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
{{- /*
|
||||
Renders the page using the RenderShortcode method on the Page object.
|
||||
|
||||
You must call this shortcode using the {{% %}} notation.
|
||||
|
||||
@param {string} (postional parameter 0) The path to the page, relative to the content directory.
|
||||
@returns template.HTML
|
||||
|
||||
@example {{% include "functions/_common/glob-patterns" %}}
|
||||
*/}}
|
||||
|
||||
{{- with .Get 0 }}
|
||||
{{- with site.GetPage . }}
|
||||
{{- .RenderShortcodes }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode was unable to find %q. See %s" $.Name . $.Position }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode requires a positional parameter indicating the path of the file to include. See %s" .Name .Position }}
|
||||
{{- end }}
|
||||
Generated
+96
@@ -0,0 +1,96 @@
|
||||
{{- /*
|
||||
Renders a desciption list of the pages in the given section.
|
||||
|
||||
Render a subset of the pages in the section by specifying a predefined filter,
|
||||
and whether to include those pages.
|
||||
|
||||
Filters are defined in the data directory, in the file named page_filters. Each
|
||||
filter is an array of paths to a file, relative to the root of the content
|
||||
directory. Hugo will throw an error if the specified filter does not exist, or
|
||||
if any of the pages in the filter do not exist.
|
||||
|
||||
The definition term elements (dt) have an id attribute derived from the title
|
||||
of the page. This is probably unique, because pages of the same title in the
|
||||
same section is unlikely.
|
||||
|
||||
If you render a complete list on a page, then call the shortcode again to
|
||||
render a subset, you will generate duplicate element ids. In this case, set
|
||||
omitElementIDs to true for the subset.
|
||||
|
||||
@param {string} path The path to the section.
|
||||
@param {string} [filter=""] The name of filter list.
|
||||
@param {string} [filterType=""] The type of filter, either include or exclude.
|
||||
@param {string} [omitElementIDs=false] Whether to omit dt element ids.
|
||||
@param {string} [titlePrefix=""] The string to prepend to the link title.
|
||||
|
||||
@returns template.HTML
|
||||
|
||||
@example {{< list-pages-in-section path=/methods/resources >}}
|
||||
@example {{< list-pages-in-section path=/functions/images filter=some_filter filterType=exclude >}}
|
||||
@example {{< list-pages-in-section path=/functions/images filter=some_filter filterType=exclude titlePrefix=foo >}}
|
||||
@example {{< list-pages-in-section path=/functions/images filter=some_filter filterType=exclude titlePrefix=foo omitElementIDs=true >}}
|
||||
*/}}
|
||||
|
||||
{{- /* Initialize. */}}
|
||||
{{- $filter := or "" (.Get "filter" | lower)}}
|
||||
{{- $filterType := or (.Get "filterType") "none" | lower }}
|
||||
{{- $filteredPages := slice }}
|
||||
{{- $titlePrefix := or (.Get "titlePrefix") "" }}
|
||||
{{- $omitElementIDs := false }}
|
||||
|
||||
{{- /* Get boolean parameters. */}}
|
||||
{{- if in (slice "false" false 0) (.Get "omitElementIDs") }}
|
||||
{{- $omitElementIDs = false }}
|
||||
{{- else if in (slice "true" true 1) (.Get "omitElementIDs")}}
|
||||
{{- $omitElementIDs = true }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Build slice of filtered pages. */}}
|
||||
{{- with $filter }}
|
||||
{{- with index site.Data.page_filters . }}
|
||||
{{- range . }}
|
||||
{{- with site.GetPage . }}
|
||||
{{- $filteredPages = $filteredPages | append . }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode was unable to find %q as specified in the page_filters data file. See %s" $.Name . $.Position }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode was unable to find the %q filter in the page_filters data file. See %s" $.Name . $.Position }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Render */}}
|
||||
{{- with $sectionPath := .Get "path" }}
|
||||
{{- with site.GetPage . }}
|
||||
{{- with .RegularPages }}
|
||||
<dl>
|
||||
{{- range $page := .ByTitle }}
|
||||
{{- if or
|
||||
(and (eq $filterType "include") (in $filteredPages $page))
|
||||
(and (eq $filterType "exclude") (not (in $filteredPages $page)))
|
||||
(eq $filterType "none")
|
||||
}}
|
||||
{{- $linkTitle := .LinkTitle }}
|
||||
{{- with $titlePrefix }}
|
||||
{{- $linkTitle = printf "%s%s" . $linkTitle }}
|
||||
{{- end }}
|
||||
{{- $idAttribute := "" }}
|
||||
{{- if not $omitElementIDs }}
|
||||
{{- $id := path.Join .File.Dir .File.ContentBaseName | replaceRE `[\|/]` ":" | lower }}
|
||||
{{- $idAttribute = printf " id=%q" $id }}
|
||||
{{- end }}
|
||||
<dt {{- $idAttribute | safeHTMLAttr }}><a href="{{ $page.RelPermalink }}">{{ $linkTitle }}</a></dt>
|
||||
<dd>{{- $page.Description | $page.RenderString }}</dd>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
</dl>
|
||||
{{- else }}
|
||||
{{- warnf "The %q shortcode found no pages in the %q section. See %s" $.Name $sectionPath $.Position }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode was unable to find %q. See %s" $.Name $sectionPath $.Position }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode requires a 'path' parameter indicating the path to the section. See %s" $.Name $.Position }}
|
||||
{{- end }}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
{{ $version := .Get 0 }}
|
||||
{{ if not $version }}
|
||||
{{ errorf "Missing version in new-in shortcode " }}
|
||||
{{ end }}
|
||||
{{ $version = $version | strings.TrimPrefix "v" }}
|
||||
<button
|
||||
class="bg-white hover:bg-gray-100 text-gray-800 font-semibold py-2 mr2 px-4 border border-gray-400 rounded shadow">
|
||||
<a
|
||||
href="{{ printf "https://github.com/gohugoio/hugo/releases/tag/v%s" $version }}"
|
||||
target="_blank"
|
||||
>New in v{{ $version }}</a
|
||||
>
|
||||
</button>
|
||||
-1
@@ -1 +0,0 @@
|
||||
<pre><code class="nohighlight">{{ .Inner }}</code></pre>
|
||||
+5
-7
@@ -1,9 +1,7 @@
|
||||
{{ $_hugo_config := `{ "version": 1 }` }}
|
||||
<aside class="admonition note">
|
||||
<div class="note-icon">
|
||||
{{partial "svg/exclamation.svg" (dict "size" "20px" ) }}
|
||||
</div>
|
||||
<!-- <h2 id="{{if .Get 0}}{{.Get 0 | urlize}}{{else}}note{{end}}">{{if .Get 0}}{{.Get 0 | markdownify}}{{else}}Note{{end}}</h2> -->
|
||||
<!-- <h3>Note</h3> -->
|
||||
<div class="admonition-content">{{- .Inner -}}</div>
|
||||
|
||||
<aside>
|
||||
<div class="admonition-content bl bw2 b--blue" >
|
||||
{{ .Inner }}
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
{{$file := .Get "file"}}
|
||||
{{$icon := index (split $file ".") 1 }}
|
||||
<div class="code" id="{{$file | urlize}}">
|
||||
<div class="filename" title="{{$file}}">{{$file}}</div>
|
||||
<!-- <div class="code-icon">
|
||||
<i class="icon-{{$icon}}"></i>
|
||||
</div> -->
|
||||
<div class="code-copy-content output-content">
|
||||
{{- .Inner -}}
|
||||
</div>
|
||||
</div>
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
{{/*
|
||||
Renders the child sections of the given top-level section, listing each childs's immediate descendants.
|
||||
|
||||
@param {string} section The top-level section to render.
|
||||
@returns template.HTML
|
||||
|
||||
@example {{% quick-reference section="functions" %}}
|
||||
*/}}
|
||||
|
||||
{{ $section := "" }}
|
||||
{{ with .Get "section" }}
|
||||
{{ $section = . }}
|
||||
{{ else }}
|
||||
{{ errorf "The %q shortcodes requires a 'section' parameter. See %s" .Name .Postion }}
|
||||
{{ end }}
|
||||
|
||||
{{/* Do not change the markdown indentation, and do not remove blank lines. */}}
|
||||
{{ with site.GetPage $section }}
|
||||
{{ range .Sections }}
|
||||
|
||||
## {{ .LinkTitle }}
|
||||
{{ .RawContent }}
|
||||
|
||||
{{ range .Pages }}
|
||||
{{ $aliases := "" }}
|
||||
{{ if eq .Section "functions" }}
|
||||
{{ $aliases = delimit .Params.action.aliases " or " }}
|
||||
{{ end }}
|
||||
|
||||
[{{ .LinkTitle }}]({{ .RelPermalink }}) {{ with $aliases }}({{ . }}){{ end }}
|
||||
: {{ .Description }}
|
||||
|
||||
{{ end }}
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
{{ errorf "The %q shortcodes was unable to find the %q section. See %s" .Name $section .Postion }}
|
||||
{{ end }}
|
||||
+29
-6
@@ -1,6 +1,29 @@
|
||||
{{$file := .Get "file"}}
|
||||
{{- if eq (.Get "markdown") "true" -}}
|
||||
{{- $file | readFile | markdownify -}}
|
||||
{{- else -}}
|
||||
{{ $file | readFile | safeHTML }}
|
||||
{{- end -}}
|
||||
{{- $highlight := or (.Get "highlight") "" }}
|
||||
|
||||
{{- $markdown := false }}
|
||||
{{- if in (slice "false" false 0) (.Get "markdown") }}
|
||||
{{- $markdown = false }}
|
||||
{{- else if in (slice "true" true 1) (.Get "markdown") }}
|
||||
{{- $markdown = true }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Get "file" }}
|
||||
{{- if os.FileExists . }}
|
||||
{{- with os.ReadFile . }}
|
||||
{{- $content := trim . "\n\r" }}
|
||||
{{- if $markdown }}
|
||||
{{- $content | markdownify }}
|
||||
{{- else if $highlight }}
|
||||
{{- highlight $content $highlight }}
|
||||
{{- else }}
|
||||
{{- $content | safeHTML }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode was unable to read %q. See %s" $.Name . $.Position }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode was unable to find %q. See %s" $.Name . $.Position }}
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
{{- errorf "The %q shortcode requires a 'file' parameter. See %s" $.Name $.Position }}
|
||||
{{- end }}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user