mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-30 10:12:40 +00:00
Compare commits
239 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e32a493b78 | |||
| 19e9605629 | |||
| 80e8bd3b72 | |||
| b661132e0a | |||
| ef6f101e75 | |||
| d595419031 | |||
| 671f64b2eb | |||
| 2fb40ece5d | |||
| c6b3887696 | |||
| 21af5b359f | |||
| f38a2fbd2e | |||
| 6a579ebac3 | |||
| f13531e608 | |||
| b5d485060f | |||
| 6e9fa9e0fd | |||
| c4f3a46ce6 | |||
| fbc3e08c64 | |||
| e402d91ee1 | |||
| 3c51625c71 | |||
| dd6d0a6de1 | |||
| f95fd57aac | |||
| e754d5cb3e | |||
| 002cd52807 | |||
| a76c405d40 | |||
| c0a03a2a39 | |||
| e127d3e5c6 | |||
| 47b12b83e6 | |||
| 180dfeba03 | |||
| 10bb29d7f3 | |||
| eb0c8f9d02 | |||
| 3a216186b2 | |||
| 7874b96815 | |||
| 71832328f8 | |||
| 37ab1cf12a | |||
| 59af05cabc | |||
| 4989da653d | |||
| cd1ed563a8 | |||
| aa2c724195 | |||
| effa6a4226 | |||
| 5d5f0a2371 | |||
| d20d2651ea | |||
| 41a080b268 | |||
| 41bc6f702a | |||
| 9a215d6950 | |||
| eda1e720cd | |||
| 330fa89411 | |||
| 6db527483d | |||
| 0d4b17d4c0 | |||
| 3afaca7584 | |||
| 2d217cba51 | |||
| 17055d1fa7 | |||
| 2a81a49499 | |||
| e30d711c29 | |||
| ad2059878a | |||
| 87e898a17a | |||
| b54de1bd9b | |||
| c9354d5463 | |||
| d894269855 | |||
| 3fd0b78498 | |||
| e0e63f35e4 | |||
| cc574ef120 | |||
| a0d64a46e3 | |||
| f97544a830 | |||
| d8efe085ca | |||
| f5b5b71c60 | |||
| b82b547acb | |||
| da670c38ee | |||
| c9f2fa2663 | |||
| 5067775a6f | |||
| 50549c867c | |||
| de9c5542ca | |||
| e93138dfdb | |||
| 7d16c3c0c1 | |||
| 63126c6359 | |||
| 535ea8cc9b | |||
| 8bbec426cd | |||
| 0bfa293dcd | |||
| 0b976d2b40 | |||
| a49e51fd0b | |||
| d373774cbe | |||
| 7d5e3ab8a8 | |||
| dc44bca963 | |||
| da16527896 | |||
| ef518485ce | |||
| 83080df611 | |||
| b8d5c378ba | |||
| 75f782a5a7 | |||
| 2221b5b30a | |||
| 6a004b8d94 | |||
| 0923622421 | |||
| 7855b47f07 | |||
| 34d1150d92 | |||
| 85e2ac1a44 | |||
| 74776726df | |||
| 63f7f0ff5a | |||
| bcb62d8911 | |||
| 00fe7e0408 | |||
| df85cb9ae2 | |||
| e08ce30fe4 | |||
| a99fed4852 | |||
| db945a6ed2 | |||
| bafb389b38 | |||
| 0a019a1a59 | |||
| 9f7fb0a73b | |||
| f04cc581e1 | |||
| 00c4484c70 | |||
| cdd83bf3c8 | |||
| e00220a06a | |||
| a662ddae13 | |||
| 13adf3e028 | |||
| fe08d35f24 | |||
| 4b675ddd4a | |||
| 24eaa290cf | |||
| f6ab9553f4 | |||
| 58a98c7758 | |||
| 900904fd11 | |||
| 24eca0cbe9 | |||
| 60e0e2c1d9 | |||
| 52ea07d2eb | |||
| 77fc74a5b2 | |||
| 0e3b42b4a9 | |||
| f50585442d | |||
| 2aedccc9a9 | |||
| c10931404f | |||
| 4732c47d1d | |||
| 62780ec8dd | |||
| 351d6b062b | |||
| 631d768be9 | |||
| e5d2a8f6a3 | |||
| 00ff161b67 | |||
| 588710a7ac | |||
| ed930db2f0 | |||
| 05df964816 | |||
| 20ef6dcf95 | |||
| 9860e0e186 | |||
| d1cd1db0e7 | |||
| 09e10110a3 | |||
| 2ef60dbd2d | |||
| 6275aad9e2 | |||
| 01ebb6e304 | |||
| a066e98851 | |||
| 1fd3320dcf | |||
| 0fb2b3d143 | |||
| db05232d56 | |||
| 2734f956c3 | |||
| 58b8245813 | |||
| ec57cf2c30 | |||
| 3a9cb7b0fb | |||
| 0addb302ac | |||
| b002d47953 | |||
| e3f31352d4 | |||
| ec02c537ed | |||
| 84cbe72498 | |||
| 4611b6920b | |||
| 2171e3c9a5 | |||
| cac773aeff | |||
| 51010a69bc | |||
| 8958b8741f | |||
| 29ccb36069 | |||
| d8aba18e05 | |||
| c744dbd6ed | |||
| 5c41653364 | |||
| 281554ee97 | |||
| f3560aa0e1 | |||
| edf9038a92 | |||
| 78f49b4c0d | |||
| fa4b77e7ed | |||
| 8377c3cea1 | |||
| 4d909d4768 | |||
| 4eb6d97404 | |||
| 4f9cb4f344 | |||
| 0171fb2010 | |||
| a4028112e3 | |||
| 08f0984f91 | |||
| 86653fa38e | |||
| c46d104985 | |||
| b665f1e8f1 | |||
| 6be6752c8a | |||
| 8e9dce1092 | |||
| 00b71668b2 | |||
| beebf2afb0 | |||
| 3f0b40f674 | |||
| 0bd79d30c1 | |||
| 8e77bcc930 | |||
| 74daca6b30 | |||
| 1fd4c562af | |||
| a5cda5ca4d | |||
| 5e2b28d6e6 | |||
| f2019f0a23 | |||
| 475638fe02 | |||
| 203cc54578 | |||
| 90ad804505 | |||
| af23cdca9c | |||
| ab5ce59894 | |||
| 7d40da876c | |||
| 02c89a446d | |||
| 06c3ac6741 | |||
| 5e03de0ddb | |||
| bef31b58aa | |||
| b76146b129 | |||
| 8e5044d7f5 | |||
| 5046a6c7ca | |||
| 160a067c81 | |||
| e0ba1a805a | |||
| 7b49c56a6a | |||
| dffca57883 | |||
| 79932e7225 | |||
| 9eb9b70a29 | |||
| 0ff4a9326f | |||
| 45e1084ff2 | |||
| c98348416c | |||
| 2de393c791 | |||
| 7efb35680f | |||
| ddbcc67122 | |||
| fd75f129b2 | |||
| 14878ca0a0 | |||
| e88873b803 | |||
| 4219993b0c | |||
| 988e1417a0 | |||
| 42529882ce | |||
| 45f1b1cfc5 | |||
| 369bdf22f8 | |||
| d1b03a093f | |||
| 941c28ab0c | |||
| ffbdcc75ab | |||
| 95d9764518 | |||
| b66f9f2665 | |||
| f7e00c039f | |||
| f5ba6fd45c | |||
| c4bbc1eeeb | |||
| 0e0fb1b648 | |||
| b017f7cb01 | |||
| 7fb28085ac | |||
| 0cd1929b9c | |||
| cbdaff2135 | |||
| 3fefea06b8 | |||
| 5c48ba9343 | |||
| 21562e3aad | |||
| 9c24b86e4b |
+96
-33
@@ -1,51 +1,114 @@
|
||||
defaults: &defaults
|
||||
docker:
|
||||
- image: bepsays/ci-goreleaser:1.1800.300
|
||||
environment:
|
||||
CGO_ENABLED: "0"
|
||||
parameters:
|
||||
|
||||
# v2: 11m.
|
||||
defaults: &defaults
|
||||
resource_class: large
|
||||
docker:
|
||||
- image: bepsays/ci-hugoreleaser:1.21900.20200
|
||||
environment: &buildenv
|
||||
GOMODCACHE: /root/project/gomodcache
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
<<: *defaults
|
||||
prepare_release:
|
||||
<<: *defaults
|
||||
environment: &buildenv
|
||||
GOMODCACHE: /root/project/gomodcache
|
||||
steps:
|
||||
- checkout:
|
||||
- &remote-docker
|
||||
setup_remote_docker:
|
||||
version: 20.10.14
|
||||
- checkout:
|
||||
path: hugo
|
||||
- &git-config
|
||||
run:
|
||||
command: |
|
||||
git config --global user.email "bjorn.erik.pedersen+hugoreleaser@gmail.com"
|
||||
git config --global user.name "hugoreleaser"
|
||||
- run:
|
||||
command: |
|
||||
git clone git@github.com:gohugoio/hugoDocs.git
|
||||
cd hugo
|
||||
go mod download
|
||||
sleep 5
|
||||
go mod verify
|
||||
- persist_to_workspace:
|
||||
root: .
|
||||
paths: .
|
||||
release:
|
||||
<<: *defaults
|
||||
command: |
|
||||
cd hugo
|
||||
go mod download
|
||||
go run -tags release main.go release --step 1
|
||||
- save_cache:
|
||||
key: git-sha-{{ .Revision }}
|
||||
paths:
|
||||
- hugo
|
||||
- gomodcache
|
||||
build_container1:
|
||||
<<: [*defaults]
|
||||
environment:
|
||||
<<: [*buildenv]
|
||||
steps:
|
||||
- attach_workspace:
|
||||
at: /root/project
|
||||
- &restore-cache
|
||||
restore_cache:
|
||||
key: git-sha-{{ .Revision }}
|
||||
- run:
|
||||
command: |
|
||||
cd hugo
|
||||
git config --global user.email "bjorn.erik.pedersen+hugoreleaser@gmail.com"
|
||||
git config --global user.name "hugoreleaser"
|
||||
go run -tags release main.go release -r ${CIRCLE_BRANCH}
|
||||
|
||||
no_output_timeout: 20m
|
||||
command: |
|
||||
mkdir -p /tmp/files/dist1
|
||||
cd hugo
|
||||
hugoreleaser build -paths "builds/container1/**" -workers 3 -dist /tmp/files/dist1 -chunks $CIRCLE_NODE_TOTAL -chunk-index $CIRCLE_NODE_INDEX
|
||||
- &persist-workspace
|
||||
persist_to_workspace:
|
||||
root: /tmp/files
|
||||
paths:
|
||||
- dist1
|
||||
- dist2
|
||||
parallelism: 7
|
||||
build_container2:
|
||||
<<: [*defaults]
|
||||
environment:
|
||||
<<: [*buildenv]
|
||||
docker:
|
||||
- image: bepsays/ci-hugoreleaser-linux-arm64:1.21900.20200
|
||||
steps:
|
||||
- *restore-cache
|
||||
- &attach-workspace
|
||||
attach_workspace:
|
||||
at: /tmp/workspace
|
||||
- run:
|
||||
command: |
|
||||
mkdir -p /tmp/files/dist2
|
||||
cd hugo
|
||||
hugoreleaser build -paths "builds/container2/**" -workers 1 -dist /tmp/files/dist2
|
||||
- *persist-workspace
|
||||
archive_and_release:
|
||||
<<: [*defaults]
|
||||
environment:
|
||||
<<: [*buildenv]
|
||||
steps:
|
||||
- *restore-cache
|
||||
- *attach-workspace
|
||||
- *git-config
|
||||
- run:
|
||||
command: |
|
||||
cp -a /tmp/workspace/dist1/. ./hugo/dist
|
||||
cp -a /tmp/workspace/dist2/. ./hugo/dist
|
||||
- run:
|
||||
command: |
|
||||
cd hugo
|
||||
hugoreleaser archive
|
||||
hugoreleaser release
|
||||
go run -tags release main.go release --step 2
|
||||
workflows:
|
||||
version: 2
|
||||
release:
|
||||
jobs:
|
||||
- build:
|
||||
- prepare_release:
|
||||
filters:
|
||||
branches:
|
||||
only: /release-.*/
|
||||
- hold:
|
||||
type: approval
|
||||
- build_container1:
|
||||
requires:
|
||||
- build
|
||||
- release:
|
||||
- prepare_release
|
||||
- build_container2:
|
||||
requires:
|
||||
- prepare_release
|
||||
- archive_and_release:
|
||||
context: org-global
|
||||
requires:
|
||||
- hold
|
||||
- build_container1
|
||||
- build_container2
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -3,8 +3,13 @@ on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '30 1 * * *'
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
stale:
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: dessant/lock-threads@08e671be8ac8944d0e132aa71d0ae8ccfb347675
|
||||
|
||||
+38
-21
@@ -1,30 +1,45 @@
|
||||
on: [push, pull_request]
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
name: Test
|
||||
env:
|
||||
GOPROXY: https://proxy.golang.org
|
||||
GO111MODULE: on
|
||||
DART_SASS_VERSION: 1.56.2
|
||||
DART_SASS_SHA_LINUX: 9e4f455f7b8619959d7878af2862383be58392eb963a14ff87cc512c03701e2a
|
||||
DART_SASS_SHA_MACOS: 5992e979e2c30ec363f8e338822bb2b4443c74232b3340501a76180f5652cb09
|
||||
DART_SASS_SHA_WINDOWS: 8d3d9117c54840e3e6a4919e43acf75ea52f28a64fc87a8e29d80ec72ee36cfb
|
||||
permissions:
|
||||
contents: read
|
||||
jobs:
|
||||
test:
|
||||
env:
|
||||
GOPROXY: https://proxy.golang.org
|
||||
GO111MODULE: on
|
||||
strategy:
|
||||
matrix:
|
||||
# Note: We upgraded to Go 1.18 in Hugo v0.95.0
|
||||
# Go 1.18 had some breaking changes on the source level which means Hugo cannot be built
|
||||
# with older Go versions, but the improvements in Go 1.18 were too good to pass on (e.g. break and continue).
|
||||
# Note that you don't need Go (or Go 1.18) to run a pre-built binary.
|
||||
go-version: [1.18.x]
|
||||
go-version: [1.18.x,1.19.x]
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@37335c7bb261b353407cff977110895fa0b4f7d8
|
||||
uses: actions/setup-go@268d8c0ca0432bb2cf416faae41297df9d262d7f
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
check-latest: true
|
||||
cache: true
|
||||
cache-dependency-path: |
|
||||
**/go.sum
|
||||
**/go.mod
|
||||
- name: Install Ruby
|
||||
uses: actions/setup-ruby@5f29a1cd8dfebf420691c4c9a0e832e2fae5a526
|
||||
uses: ruby/setup-ruby@ee2113536afb7f793eed4ce60e8d3b26db912da4
|
||||
with:
|
||||
ruby-version: '2.7'
|
||||
ruby-version: '2.7'
|
||||
bundler-cache: true #
|
||||
- name: Install Python
|
||||
uses: actions/setup-python@3105fb18c05ddd93efea5f9e0bef7a03a6e9e7df
|
||||
with:
|
||||
@@ -33,8 +48,6 @@ jobs:
|
||||
run: go install github.com/magefile/mage@07afc7d24f4d6d6442305d49552f04fbda5ccb3e
|
||||
- name: Install asciidoctor
|
||||
uses: reitzig/actions-asciidoctor@7570212ae20b63653481675fb1ff62d1073632b0
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
|
||||
- name: Install docutils
|
||||
run: |
|
||||
pip install docutils
|
||||
@@ -49,29 +62,33 @@ jobs:
|
||||
brew install pandoc
|
||||
- if: matrix.os == 'windows-latest'
|
||||
run: |
|
||||
choco install pandoc
|
||||
choco install mingw --version 10.2.0 --allow-downgrade
|
||||
Choco-Install -PackageName pandoc
|
||||
- run: pandoc -v
|
||||
- if: matrix.os == 'windows-latest'
|
||||
run: |
|
||||
Choco-Install -PackageName mingw -ArgumentList "--version","10.2.0","--allow-downgrade"
|
||||
- if: matrix.os == 'ubuntu-latest'
|
||||
name: Install dart-sass-embedded Linux
|
||||
run: |
|
||||
curl -LJO https://github.com/sass/dart-sass-embedded/releases/download/1.0.0-beta.6/sass_embedded-1.0.0-beta.6-linux-x64.tar.gz;
|
||||
echo "04fc1e5e28d29a4585a701941b6dace56771d94bfbe7f9e4db28d24417ceeec3 sass_embedded-1.0.0-beta.6-linux-x64.tar.gz" | sha256sum -c;
|
||||
tar -xvf sass_embedded-1.0.0-beta.6-linux-x64.tar.gz;
|
||||
echo "Install Dart Sass version ${DART_SASS_VERSION} ..."
|
||||
curl -LJO "https://github.com/sass/dart-sass-embedded/releases/download/${DART_SASS_VERSION}/sass_embedded-${DART_SASS_VERSION}-linux-x64.tar.gz";
|
||||
echo "${DART_SASS_SHA_LINUX} sass_embedded-${DART_SASS_VERSION}-linux-x64.tar.gz" | sha256sum -c;
|
||||
tar -xvf "sass_embedded-${DART_SASS_VERSION}-linux-x64.tar.gz";
|
||||
echo "$GITHUB_WORKSPACE/sass_embedded/" >> $GITHUB_PATH
|
||||
- if: matrix.os == 'macos-latest'
|
||||
name: Install dart-sass-embedded MacOS
|
||||
run: |
|
||||
curl -LJO https://github.com/sass/dart-sass-embedded/releases/download/1.0.0-beta.6/sass_embedded-1.0.0-beta.6-macos-x64.tar.gz;
|
||||
echo "b3b984675a9b04aa22f6f2302dda4191b507ac2ca124467db2dfe7e58e72fbad sass_embedded-1.0.0-beta.6-macos-x64.tar.gz" | shasum -a 256 -c;
|
||||
tar -xvf sass_embedded-1.0.0-beta.6-macos-x64.tar.gz;
|
||||
echo "Install Dart Sass version ${DART_SASS_VERSION} ..."
|
||||
curl -LJO "https://github.com/sass/dart-sass-embedded/releases/download/${DART_SASS_VERSION}/sass_embedded-${DART_SASS_VERSION}-macos-x64.tar.gz";
|
||||
echo "${DART_SASS_SHA_MACOS} sass_embedded-${DART_SASS_VERSION}-macos-x64.tar.gz" | shasum -a 256 -c;
|
||||
tar -xvf "sass_embedded-${DART_SASS_VERSION}-macos-x64.tar.gz";
|
||||
echo "$GITHUB_WORKSPACE/sass_embedded/" >> $GITHUB_PATH
|
||||
- if: matrix.os == 'windows-latest'
|
||||
name: Install dart-sass-embedded Windows
|
||||
run: |
|
||||
curl -LJO https://github.com/sass/dart-sass-embedded/releases/download/1.0.0-beta.6/sass_embedded-1.0.0-beta.6-windows-x64.zip;
|
||||
echo "6ae442129dbb3334bc21ef851261da6c0c1b560da790ca2e1350871d00ab816d sass_embedded-1.0.0-beta.6-windows-x64.zip" | sha256sum -c;
|
||||
unzip sass_embedded-1.0.0-beta.6-windows-x64.zip;
|
||||
echo "Install Dart Sass version ${env:DART_SASS_VERSION} ..."
|
||||
curl -LJO "https://github.com/sass/dart-sass-embedded/releases/download/${env:DART_SASS_VERSION}/sass_embedded-${env:DART_SASS_VERSION}-windows-x64.zip";
|
||||
Expand-Archive -Path "sass_embedded-${env:DART_SASS_VERSION}-windows-x64.zip" -DestinationPath .;
|
||||
echo "$env:GITHUB_WORKSPACE/sass_embedded/" | Out-File -FilePath $Env:GITHUB_PATH -Encoding utf-8 -Append
|
||||
- name: Check
|
||||
run: |
|
||||
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
/hugo
|
||||
docs/public*
|
||||
/.idea
|
||||
.vscode/*
|
||||
hugo.exe
|
||||
*.test
|
||||
*.prof
|
||||
nohup.out
|
||||
cover.out
|
||||
*.swp
|
||||
*.swo
|
||||
.DS_Store
|
||||
*~
|
||||
vendor/*/
|
||||
*.bench
|
||||
*.debug
|
||||
coverage*.out
|
||||
|
||||
dock.sh
|
||||
|
||||
GoBuilds
|
||||
dist
|
||||
|
||||
hugolib/hugo_stats.json
|
||||
resources/sunset.jpg
|
||||
|
||||
vendor
|
||||
|
||||
.hugo_build.lock
|
||||
@@ -1,7 +1,5 @@
|
||||
# Contributing to Hugo
|
||||
|
||||
**Note March 16th 2022:** We are currently very constrained on human resources to do code reviews, so we currently require any new Pull Requests to be limited to bug fixes closing an existing issue. Also, we have updated to Go 1.18, but we will currently not accept any generic rewrites, "interface{} to any" replacements and similar.
|
||||
|
||||
We welcome contributions to Hugo of any kind including documentation, themes,
|
||||
organization, tutorials, blog posts, bug reports, issues, feature requests,
|
||||
feature implementations, pull requests, answering questions on the forum,
|
||||
@@ -52,8 +50,6 @@ Hugo has become a fully featured static site generator, so any new functionality
|
||||
|
||||
If it is of some complexity, the contributor is expected to maintain and support the new feature in the future (answer questions on the forum, fix any bugs etc.).
|
||||
|
||||
It is recommended to open up a discussion on the [Hugo Forum](https://discourse.gohugo.io/) to get feedback on your idea before you begin.
|
||||
|
||||
Any non-trivial code change needs to update an open [issue](https://github.com/gohugoio/hugo/issues). A non-trivial code change without an issue reference with one of the labels `bug` or `enhancement` will not be merged.
|
||||
|
||||
Note that we do not accept new features that require [CGO](https://github.com/golang/go/wiki/cgo).
|
||||
|
||||
+2
-2
@@ -2,7 +2,7 @@
|
||||
# Twitter: https://twitter.com/gohugoio
|
||||
# Website: https://gohugo.io/
|
||||
|
||||
FROM golang:1.18-alpine AS build
|
||||
FROM golang:1.19-alpine AS build
|
||||
|
||||
# Optionally set HUGO_BUILD_TAGS to "extended" or "nodeploy" when building like so:
|
||||
# docker build --build-arg HUGO_BUILD_TAGS=extended .
|
||||
@@ -26,7 +26,7 @@ RUN mage hugo && mage install
|
||||
|
||||
# ---
|
||||
|
||||
FROM alpine:3.12
|
||||
FROM alpine:3.16
|
||||
|
||||
COPY --from=build /go/bin/hugo /usr/bin/hugo
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
Copyright 2022 The Hugo Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<a href="https://gohugo.io/"><img src="https://raw.githubusercontent.com/gohugoio/gohugoioTheme/master/static/images/hugo-logo-wide.svg?sanitize=true" alt="Hugo" width="565"></a>
|
||||
|
||||
A Fast and Flexible Static Site Generator built with love by [bep](https://github.com/bep), [spf13](https://spf13.com/) and [friends](https://github.com/gohugoio/hugo/graphs/contributors) in [Go][].
|
||||
A Fast and Flexible Static Site Generator built with love by [bep](https://github.com/bep), [spf13](https://spf13.com/) and [friends](https://github.com/gohugoio/hugo/graphs/contributors) in [Go](https://go.dev/).
|
||||
|
||||
[Website](https://gohugo.io) |
|
||||
[Forum](https://discourse.gohugo.io) |
|
||||
@@ -13,9 +13,19 @@ A Fast and Flexible Static Site Generator built with love by [bep](https://githu
|
||||
[](https://github.com/gohugoio/hugo/actions?query=workflow%3ATest)
|
||||
[](https://goreportcard.com/report/github.com/gohugoio/hugo)
|
||||
|
||||
* [Overview](#overview)
|
||||
* [Banner Sponsors](#banner-sponsors)
|
||||
* [Supported Architectures](#supported-architectures)
|
||||
* [Choose How to Install](#choose-how-to-install)
|
||||
* [Install Hugo as Your Site Generator (Binary Install)](#install-hugo-as-your-site-generator-binary-install)
|
||||
* [Build and Install the Binary from Source (Using the Go toolchain)](#build-and-install-the-binary-from-source-using-the-go-toolchain)
|
||||
* [The Hugo Documentation](#the-hugo-documentation)
|
||||
* [Contributing to Hugo](#contributing-code-to-hugo)
|
||||
* [Dependencies](#dependencies)
|
||||
|
||||
## Overview
|
||||
|
||||
Hugo is a static HTML and CSS website generator written in [Go][].
|
||||
Hugo is a static HTML and CSS website generator written in [Go](https://go.dev/).
|
||||
It is optimized for speed, ease of use, and configurability.
|
||||
Hugo takes a directory with content and templates and renders them into a full HTML website.
|
||||
|
||||
@@ -27,7 +37,17 @@ A good rule of thumb is that each piece of content renders in around 1 milliseco
|
||||
|
||||
Hugo is designed to work well for any kind of website including blogs, tumbles, and docs.
|
||||
|
||||
#### Supported Architectures
|
||||
## Banner Sponsors
|
||||
<p> </p>
|
||||
<p float="left">
|
||||
<a href="https://www.linode.com/?utm_campaign=hugosponsor&utm_medium=banner&utm_source=hugogithub" target="_blank"><img src="https://raw.githubusercontent.com/gohugoio/gohugoioTheme/master/static/images/sponsors/linode-logo_standard_light_medium.png" width="200" alt="Linode"></a>
|
||||
<a href="https://buttercms.com/hugo-cms/?utm_campaign=sponsorship&utm_medium=banner&utm_source=hugogithub" target="_blank"><img src="https://raw.githubusercontent.com/gohugoio/gohugoioTheme/master/static/images/sponsors/butter-dark.svg?sanitize=true" width="280" alt="ButterCMS"></a>
|
||||
|
||||
<a href="https://bep.is/en/hugo-sponsor-2023-01/?utm_campaign=hugosponsor&utm_medium=banner&utm_source=hugogithub" target="_blank"><img src="https://raw.githubusercontent.com/gohugoio/gohugoioTheme/master/static/images/sponsors/your-company-dark.svg?sanitize=true" width="140" alt="your company?"></a>
|
||||
</p>
|
||||
<p> </p>
|
||||
|
||||
## Supported Architectures
|
||||
|
||||
Currently, we provide pre-built Hugo binaries for Windows, Linux, FreeBSD, NetBSD, DragonFly BSD, OpenBSD, macOS (Darwin), and [Android](https://gist.github.com/bep/a0d8a26cf6b4f8bc992729b8e50b480b) for x64, i386 and ARM architectures.
|
||||
|
||||
@@ -38,7 +58,6 @@ Hugo may also be compiled from source wherever the Go compiler tool chain can ru
|
||||
## Choose How to Install
|
||||
|
||||
If you want to use Hugo as your site generator, simply install the Hugo binaries.
|
||||
The Hugo binaries have no external dependencies.
|
||||
|
||||
To contribute to the Hugo source code or documentation, you should [fork the Hugo GitHub project](https://github.com/gohugoio/hugo#fork-destination-box) and clone it to your local machine.
|
||||
|
||||
@@ -49,31 +68,24 @@ Building the binaries is an easy task for an experienced `go` getter.
|
||||
|
||||
Use the [installation instructions in the Hugo documentation](https://gohugo.io/getting-started/installing/).
|
||||
|
||||
### Build and Install the Binaries from Source (Advanced Install)
|
||||
### Build and Install the Binary from Source (Using the Go toolchain)
|
||||
|
||||
#### Prerequisite Tools
|
||||
|
||||
* [Git](https://git-scm.com/)
|
||||
* [Go (we test it with the last 2 major versions; but note that Hugo 0.95.0 only builds with >= Go 1.18.)](https://golang.org/dl/)
|
||||
|
||||
#### Fetch from GitHub
|
||||
|
||||
To fetch and build the source from GitHub:
|
||||
To fetch, build and install from the Github source:
|
||||
|
||||
```bash
|
||||
mkdir $HOME/src
|
||||
cd $HOME/src
|
||||
git clone https://github.com/gohugoio/hugo.git
|
||||
cd hugo
|
||||
go install
|
||||
go install github.com/gohugoio/hugo@latest
|
||||
```
|
||||
|
||||
**If you are a Windows user, substitute the `$HOME` environment variable above with `%USERPROFILE%`.**
|
||||
|
||||
If you want to compile with Sass/SCSS support use `--tags extended` and make sure `CGO_ENABLED=1` is set in your go environment. If you don't want to have CGO enabled, you may use the following command to temporarily enable CGO only for hugo compilation:
|
||||
|
||||
```bash
|
||||
CGO_ENABLED=1 go install --tags extended
|
||||
CGO_ENABLED=1 go install --tags extended github.com/gohugoio/hugo@latest
|
||||
```
|
||||
|
||||
## The Hugo Documentation
|
||||
@@ -83,9 +95,7 @@ The Hugo documentation now lives in its own repository, see https://github.com/g
|
||||
```bash
|
||||
git clone git@github.com:gohugoio/hugo.git
|
||||
```
|
||||
## Contributing to Hugo
|
||||
|
||||
**Note March 16th 2022:** We are currently very constrained on human resources to do code reviews, so we currently require any new Pull Requests to be limited to bug fixes closing an existing issue. Also, we have updated to Go 1.18, but we will currently not accept any generic rewrites, "interface{} to any" replacements and similar.
|
||||
## Contributing code to Hugo
|
||||
|
||||
For a complete guide to contributing to Hugo, see the [Contribution Guide](CONTRIBUTING.md).
|
||||
|
||||
@@ -96,34 +106,18 @@ helping to manage issues, etc.
|
||||
|
||||
The Hugo community and maintainers are [very active](https://github.com/gohugoio/hugo/pulse/monthly) and helpful, and the project benefits greatly from this activity.
|
||||
|
||||
### Asking Support Questions
|
||||
## Asking Support Questions
|
||||
|
||||
We have an active [discussion forum](https://discourse.gohugo.io) where users and developers can ask questions.
|
||||
Please don't use the GitHub issue tracker to ask questions.
|
||||
|
||||
### Reporting Issues
|
||||
## Reporting Issues
|
||||
|
||||
If you believe you have found a defect in Hugo or its documentation, use
|
||||
the GitHub issue tracker to report the problem to the Hugo maintainers.
|
||||
If you're not sure if it's a bug or not, start by asking in the [discussion forum](https://discourse.gohugo.io).
|
||||
When reporting the issue, please provide the version of Hugo in use (`hugo version`).
|
||||
|
||||
### Submitting Patches
|
||||
|
||||
The Hugo project welcomes all contributors and contributions regardless of skill or experience level.
|
||||
If you are interested in helping with the project, we will help you with your contribution.
|
||||
Hugo is a very active project with many contributions happening daily.
|
||||
|
||||
We want to create the best possible product for our users and the best contribution experience for our developers,
|
||||
we have a set of guidelines which ensure that all contributions are acceptable.
|
||||
The guidelines are not intended as a filter or barrier to participation.
|
||||
If you are unfamiliar with the contribution process, the Hugo team will help you and teach you how to bring your contribution in accordance with the guidelines.
|
||||
|
||||
For a complete guide to contributing code to Hugo, see the [Contribution Guide](CONTRIBUTING.md).
|
||||
|
||||
[Go]: https://golang.org/
|
||||
[Hugo Documentation]: https://gohugo.io/overview/introduction/
|
||||
|
||||
## Dependencies
|
||||
|
||||
Hugo stands on the shoulder of many great open source libraries.
|
||||
@@ -245,4 +239,3 @@ google.golang.org/grpc="v1.46.0"
|
||||
google.golang.org/protobuf="v1.28.0"
|
||||
gopkg.in/yaml.v2="v2.4.0"
|
||||
```
|
||||
|
||||
|
||||
Vendored
+5
-4
@@ -18,6 +18,7 @@ import (
|
||||
"io"
|
||||
"os"
|
||||
|
||||
"github.com/gohugoio/hugo/common/herrors"
|
||||
"github.com/gohugoio/hugo/hugofs"
|
||||
|
||||
"github.com/spf13/afero"
|
||||
@@ -36,7 +37,7 @@ func (c Caches) Prune() (int, error) {
|
||||
counter += count
|
||||
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
if herrors.IsNotExist(err) {
|
||||
continue
|
||||
}
|
||||
return counter, fmt.Errorf("failed to prune cache %q: %w", k, err)
|
||||
@@ -76,7 +77,7 @@ func (c *Cache) Prune(force bool) (int, error) {
|
||||
err = c.Fs.Remove(name)
|
||||
}
|
||||
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
if err != nil && !herrors.IsNotExist(err) {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -97,7 +98,7 @@ func (c *Cache) Prune(force bool) (int, error) {
|
||||
counter++
|
||||
}
|
||||
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
if err != nil && !herrors.IsNotExist(err) {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -112,7 +113,7 @@ func (c *Cache) Prune(force bool) (int, error) {
|
||||
func (c *Cache) pruneRootDir(force bool) (int, error) {
|
||||
info, err := c.Fs.Stat(c.pruneAllRootDir)
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
if herrors.IsNotExist(err) {
|
||||
return 0, nil
|
||||
}
|
||||
return 0, err
|
||||
|
||||
+10
-6
@@ -452,12 +452,16 @@ func collectMethodsRecursive(pkg string, f []*ast.Field) []string {
|
||||
}
|
||||
|
||||
if ident, ok := m.Type.(*ast.Ident); ok && ident.Obj != nil {
|
||||
// Embedded interface
|
||||
methodNames = append(
|
||||
methodNames,
|
||||
collectMethodsRecursive(
|
||||
pkg,
|
||||
ident.Obj.Decl.(*ast.TypeSpec).Type.(*ast.InterfaceType).Methods.List)...)
|
||||
switch tt := ident.Obj.Decl.(*ast.TypeSpec).Type.(type) {
|
||||
case *ast.InterfaceType:
|
||||
// Embedded interface
|
||||
methodNames = append(
|
||||
methodNames,
|
||||
collectMethodsRecursive(
|
||||
pkg,
|
||||
tt.Methods.List)...)
|
||||
}
|
||||
|
||||
} else {
|
||||
// Embedded, but in a different file/package. Return the
|
||||
// package.Name and deal with that later.
|
||||
|
||||
@@ -79,8 +79,8 @@ type commandeer struct {
|
||||
changeDetector *fileChangeDetector
|
||||
|
||||
// We need to reuse these on server rebuilds.
|
||||
// These 2 will be different if --renderStaticToDisk is set.
|
||||
publishDirFs afero.Fs
|
||||
publishDirStaticFs afero.Fs
|
||||
publishDirServerFs afero.Fs
|
||||
|
||||
h *hugoBuilderCommon
|
||||
@@ -170,6 +170,7 @@ func (c *commandeer) Set(key string, value any) {
|
||||
|
||||
func (c *commandeer) initFs(fs *hugofs.Fs) error {
|
||||
c.publishDirFs = fs.PublishDir
|
||||
c.publishDirStaticFs = fs.PublishDirStatic
|
||||
c.publishDirServerFs = fs.PublishDirServer
|
||||
c.DepsCfg.Fs = fs
|
||||
|
||||
@@ -382,7 +383,7 @@ func (c *commandeer) loadConfig() error {
|
||||
|
||||
// Set some commonly used flags
|
||||
c.doLiveReload = c.running && !c.Cfg.GetBool("disableLiveReload")
|
||||
c.fastRenderMode = c.doLiveReload && !c.Cfg.GetBool("disableFastRender")
|
||||
c.fastRenderMode = c.running && !c.Cfg.GetBool("disableFastRender")
|
||||
c.showErrorInBrowser = c.doLiveReload && !c.Cfg.GetBool("disableBrowserError")
|
||||
|
||||
// This is potentially double work, but we need to do this one more time now
|
||||
@@ -407,6 +408,9 @@ func (c *commandeer) loadConfig() error {
|
||||
|
||||
createMemFs := config.GetBool("renderToMemory")
|
||||
c.renderStaticToDisk = config.GetBool("renderStaticToDisk")
|
||||
// TODO(bep) we/I really need to look at the config set up, but to prevent changing too much
|
||||
// we store away the original.
|
||||
config.Set("publishDirOrig", config.GetString("publishDir"))
|
||||
|
||||
if createMemFs {
|
||||
// Rendering to memoryFS, publish to Root regardless of publishDir.
|
||||
@@ -426,6 +430,7 @@ func (c *commandeer) loadConfig() error {
|
||||
if c.publishDirFs != nil {
|
||||
// Need to reuse the destination on server rebuilds.
|
||||
fs.PublishDir = c.publishDirFs
|
||||
fs.PublishDirStatic = c.publishDirStaticFs
|
||||
fs.PublishDirServer = c.publishDirServerFs
|
||||
} else {
|
||||
if c.renderStaticToDisk {
|
||||
|
||||
@@ -177,7 +177,7 @@ Complete documentation is available at https://gohugo.io/.`,
|
||||
},
|
||||
})
|
||||
|
||||
cc.cmd.PersistentFlags().StringVar(&cc.cfgFile, "config", "", "config file (default is path/config.yaml|json|toml)")
|
||||
cc.cmd.PersistentFlags().StringVar(&cc.cfgFile, "config", "", "config file (default is hugo.yaml|json|toml)")
|
||||
cc.cmd.PersistentFlags().StringVar(&cc.cfgDir, "configDir", "config", "config dir")
|
||||
cc.cmd.PersistentFlags().BoolVar(&cc.quiet, "quiet", false, "build in quiet mode")
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ func TestExecute(t *testing.T) {
|
||||
c.Assert(resp.Err, qt.IsNil)
|
||||
result := resp.Result
|
||||
c.Assert(len(result.Sites) == 1, qt.Equals, true)
|
||||
c.Assert(len(result.Sites[0].RegularPages()) == 1, qt.Equals, true)
|
||||
c.Assert(len(result.Sites[0].RegularPages()) == 2, qt.Equals, true)
|
||||
c.Assert(result.Sites[0].Info.Params()["myparam"], qt.Equals, "paramproduction")
|
||||
})
|
||||
|
||||
@@ -117,11 +117,13 @@ func TestExecute(t *testing.T) {
|
||||
|
||||
func checkNewSiteInited(c *qt.C, basepath string) {
|
||||
paths := []string{
|
||||
filepath.Join(basepath, "layouts"),
|
||||
filepath.Join(basepath, "content"),
|
||||
filepath.Join(basepath, "archetypes"),
|
||||
filepath.Join(basepath, "static"),
|
||||
filepath.Join(basepath, "assets"),
|
||||
filepath.Join(basepath, "content"),
|
||||
filepath.Join(basepath, "data"),
|
||||
filepath.Join(basepath, "layouts"),
|
||||
filepath.Join(basepath, "static"),
|
||||
filepath.Join(basepath, "themes"),
|
||||
filepath.Join(basepath, "config.toml"),
|
||||
}
|
||||
|
||||
@@ -362,11 +364,25 @@ weight: 1
|
||||
|
||||
Content
|
||||
|
||||
`)
|
||||
|
||||
writeFile(t, filepath.Join(dir, contentDir, "hügö.md"), `
|
||||
---
|
||||
weight: 2
|
||||
---
|
||||
|
||||
This is hügö.
|
||||
|
||||
`)
|
||||
|
||||
writeFile(t, filepath.Join(dir, "layouts", "_default", "single.html"), `
|
||||
|
||||
Single: {{ .Title }}
|
||||
Single: {{ .Title }}|{{ .Content }}
|
||||
|
||||
`)
|
||||
|
||||
writeFile(t, filepath.Join(dir, "layouts", "404.html"), `
|
||||
404: {{ .Title }}|Not Found.
|
||||
|
||||
`)
|
||||
|
||||
|
||||
@@ -126,6 +126,7 @@ type modMount struct {
|
||||
Lang string `json:"lang,omitempty"`
|
||||
}
|
||||
|
||||
// MarshalJSON is for internal use only.
|
||||
func (m *modMounts) MarshalJSON() ([]byte, error) {
|
||||
var mounts []modMount
|
||||
|
||||
|
||||
@@ -50,6 +50,14 @@ If you add the -v flag, you will get a full dependency list.
|
||||
for _, dep := range deps {
|
||||
jww.FEEDBACK.Printf("%s\n", dep)
|
||||
}
|
||||
} else {
|
||||
// These are also included in the GetDependencyList above;
|
||||
// always print these as these are most likely the most useful to know about.
|
||||
deps := hugo.GetDependencyListNonGo()
|
||||
for _, dep := range deps {
|
||||
jww.FEEDBACK.Printf("%s\n", dep)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
+15
-11
@@ -511,12 +511,15 @@ func (c *commandeer) build() error {
|
||||
c.hugo().PrintProcessingStats(os.Stdout)
|
||||
fmt.Println()
|
||||
|
||||
if createCounter, ok := c.publishDirFs.(hugofs.DuplicatesReporter); ok {
|
||||
dupes := createCounter.ReportDuplicates()
|
||||
if dupes != "" {
|
||||
c.logger.Warnln("Duplicate target paths:", dupes)
|
||||
hugofs.WalkFilesystems(c.publishDirFs, func(fs afero.Fs) bool {
|
||||
if dfs, ok := fs.(hugofs.DuplicatesReporter); ok {
|
||||
dupes := dfs.ReportDuplicates()
|
||||
if dupes != "" {
|
||||
c.logger.Warnln("Duplicate target paths:", dupes)
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
})
|
||||
|
||||
unusedTemplates := c.hugo().Tmpl().(tpl.UnusedTemplatesProvider).UnusedTemplates()
|
||||
for _, unusedTemplate := range unusedTemplates {
|
||||
@@ -576,7 +579,7 @@ func (c *commandeer) serverBuild() error {
|
||||
|
||||
func (c *commandeer) copyStatic() (map[string]uint64, error) {
|
||||
m, err := c.doWithPublishDirs(c.copyStaticTo)
|
||||
if err == nil || os.IsNotExist(err) {
|
||||
if err == nil || herrors.IsNotExist(err) {
|
||||
return m, nil
|
||||
}
|
||||
return m, err
|
||||
@@ -650,10 +653,7 @@ func (c *commandeer) copyStaticTo(sourceFs *filesystems.SourceFilesystem) (uint6
|
||||
syncer.NoChmod = c.Cfg.GetBool("noChmod")
|
||||
syncer.ChmodFilter = chmodFilter
|
||||
syncer.SrcFs = fs
|
||||
syncer.DestFs = c.Fs.PublishDir
|
||||
if c.renderStaticToDisk {
|
||||
syncer.DestFs = c.Fs.PublishDirStatic
|
||||
}
|
||||
syncer.DestFs = c.Fs.PublishDirStatic
|
||||
// Now that we are using a unionFs for the static directories
|
||||
// We can effectively clean the publishDir on initial sync
|
||||
syncer.Delete = c.Cfg.GetBool("cleanDestinationDir")
|
||||
@@ -899,7 +899,7 @@ func (c *commandeer) newWatcher(pollIntervalStr string, dirList ...string) (*wat
|
||||
}
|
||||
unlock()
|
||||
case err := <-watcher.Errors():
|
||||
if err != nil && !os.IsNotExist(err) {
|
||||
if err != nil && !herrors.IsNotExist(err) {
|
||||
c.logger.Errorln("Error while watching:", err)
|
||||
}
|
||||
}
|
||||
@@ -924,6 +924,7 @@ func (c *commandeer) printChangeDetected(typ string) {
|
||||
const (
|
||||
configChangeConfig = "config file"
|
||||
configChangeGoMod = "go.mod file"
|
||||
configChangeGoWork = "go work file"
|
||||
)
|
||||
|
||||
func (c *commandeer) handleEvents(watcher *watcher.Batcher,
|
||||
@@ -943,6 +944,9 @@ func (c *commandeer) handleEvents(watcher *watcher.Batcher,
|
||||
if strings.Contains(ev.Name, "go.mod") {
|
||||
configChangeType = configChangeGoMod
|
||||
}
|
||||
if strings.Contains(ev.Name, ".work") {
|
||||
configChangeType = configChangeGoWork
|
||||
}
|
||||
}
|
||||
if !isConfig {
|
||||
// It may be one of the /config folders
|
||||
|
||||
+3
-1
@@ -32,6 +32,7 @@ var _ cmder = (*newCmd)(nil)
|
||||
type newCmd struct {
|
||||
contentEditor string
|
||||
contentType string
|
||||
force bool
|
||||
|
||||
*baseBuilderCmd
|
||||
}
|
||||
@@ -54,6 +55,7 @@ Ensure you run this within the root directory of your site.`,
|
||||
|
||||
cmd.Flags().StringVarP(&cc.contentType, "kind", "k", "", "content type to create")
|
||||
cmd.Flags().StringVar(&cc.contentEditor, "editor", "", "edit new content with this editor, if provided")
|
||||
cmd.Flags().BoolVarP(&cc.force, "force", "f", false, "overwrite file if it already exists")
|
||||
|
||||
cmd.AddCommand(b.newNewSiteCmd().getCommand())
|
||||
cmd.AddCommand(b.newNewThemeCmd().getCommand())
|
||||
@@ -80,7 +82,7 @@ func (n *newCmd) newContent(cmd *cobra.Command, args []string) error {
|
||||
return newUserError("path needs to be provided")
|
||||
}
|
||||
|
||||
return create.NewContent(c.hugo(), n.contentType, args[0])
|
||||
return create.NewContent(c.hugo(), n.contentType, args[0], n.force)
|
||||
}
|
||||
|
||||
func mkdir(x ...string) {
|
||||
|
||||
@@ -62,11 +62,12 @@ Use ` + "`hugo new [contentPath]`" + ` to create new content.`,
|
||||
func (n *newSiteCmd) doNewSite(fs *hugofs.Fs, basepath string, force bool) error {
|
||||
archeTypePath := filepath.Join(basepath, "archetypes")
|
||||
dirs := []string{
|
||||
filepath.Join(basepath, "layouts"),
|
||||
filepath.Join(basepath, "content"),
|
||||
archeTypePath,
|
||||
filepath.Join(basepath, "static"),
|
||||
filepath.Join(basepath, "assets"),
|
||||
filepath.Join(basepath, "content"),
|
||||
filepath.Join(basepath, "data"),
|
||||
filepath.Join(basepath, "layouts"),
|
||||
filepath.Join(basepath, "static"),
|
||||
filepath.Join(basepath, "themes"),
|
||||
}
|
||||
|
||||
@@ -82,6 +83,7 @@ func (n *newSiteCmd) doNewSite(fs *hugofs.Fs, basepath string, force bool) error
|
||||
return errors.New(basepath + " already exists and is not empty. See --force.")
|
||||
|
||||
case !isEmpty && force:
|
||||
// TODO(bep) eventually rename this to hugo.
|
||||
all := append(dirs, filepath.Join(basepath, "config."+n.configFormat))
|
||||
for _, path := range all {
|
||||
if exists, _ := helpers.Exists(path, fs.Source); exists {
|
||||
|
||||
+11
-12
@@ -17,8 +17,6 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/gohugoio/hugo/config"
|
||||
"github.com/gohugoio/hugo/releaser"
|
||||
"github.com/spf13/cobra"
|
||||
@@ -29,10 +27,9 @@ var _ cmder = (*releaseCommandeer)(nil)
|
||||
type releaseCommandeer struct {
|
||||
cmd *cobra.Command
|
||||
|
||||
version string
|
||||
|
||||
skipPublish bool
|
||||
try bool
|
||||
step int
|
||||
skipPush bool
|
||||
try bool
|
||||
}
|
||||
|
||||
func createReleaser() cmder {
|
||||
@@ -50,9 +47,9 @@ func createReleaser() cmder {
|
||||
return r.release()
|
||||
}
|
||||
|
||||
r.cmd.PersistentFlags().StringVarP(&r.version, "rel", "r", "", "new release version, i.e. 0.25.1")
|
||||
r.cmd.PersistentFlags().BoolVarP(&r.skipPublish, "skip-publish", "", false, "skip all publishing pipes of the release")
|
||||
r.cmd.PersistentFlags().BoolVarP(&r.try, "try", "", false, "simulate a release, i.e. no changes")
|
||||
r.cmd.PersistentFlags().BoolVarP(&r.skipPush, "skip-push", "", false, "skip pushing to remote")
|
||||
r.cmd.PersistentFlags().BoolVarP(&r.try, "try", "", false, "no changes")
|
||||
r.cmd.PersistentFlags().IntVarP(&r.step, "step", "", 0, "step to run (1: set new version 2: prepare next dev version)")
|
||||
|
||||
return r
|
||||
}
|
||||
@@ -65,8 +62,10 @@ func (c *releaseCommandeer) flagsToConfig(cfg config.Provider) {
|
||||
}
|
||||
|
||||
func (r *releaseCommandeer) release() error {
|
||||
if r.version == "" {
|
||||
return errors.New("must set the --rel flag to the relevant version number")
|
||||
rel, err := releaser.New(r.skipPush, r.try, r.step)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return releaser.New(r.version, r.skipPublish, r.try).Run()
|
||||
|
||||
return rel.Run()
|
||||
}
|
||||
|
||||
+25
-5
@@ -400,24 +400,31 @@ func (f *fileServer) createEndpoint(i int) (*http.ServeMux, net.Listener, string
|
||||
}
|
||||
|
||||
// Ignore any query params for the operations below.
|
||||
requestURI := strings.TrimSuffix(r.RequestURI, "?"+r.URL.RawQuery)
|
||||
requestURI, _ := url.PathUnescape(strings.TrimSuffix(r.RequestURI, "?"+r.URL.RawQuery))
|
||||
|
||||
for _, header := range f.c.serverConfig.MatchHeaders(requestURI) {
|
||||
w.Header().Set(header.Key, header.Value)
|
||||
}
|
||||
|
||||
if redirect := f.c.serverConfig.MatchRedirect(requestURI); !redirect.IsZero() {
|
||||
// fullName := filepath.Join(dir, filepath.FromSlash(path.Clean("/"+name)))
|
||||
doRedirect := true
|
||||
// This matches Netlify's behaviour and is needed for SPA behaviour.
|
||||
// See https://docs.netlify.com/routing/redirects/rewrites-proxies/
|
||||
if !redirect.Force {
|
||||
path := filepath.Clean(strings.TrimPrefix(requestURI, u.Path))
|
||||
fi, err := f.c.hugo().BaseFs.PublishFs.Stat(path)
|
||||
if root != "" {
|
||||
path = filepath.Join(root, path)
|
||||
}
|
||||
fs := f.c.publishDirServerFs
|
||||
|
||||
fi, err := fs.Stat(path)
|
||||
|
||||
if err == nil {
|
||||
if fi.IsDir() {
|
||||
// There will be overlapping directories, so we
|
||||
// need to check for a file.
|
||||
_, err = f.c.hugo().BaseFs.PublishFs.Stat(filepath.Join(path, "index.html"))
|
||||
_, err = fs.Stat(filepath.Join(path, "index.html"))
|
||||
doRedirect = err != nil
|
||||
} else {
|
||||
doRedirect = false
|
||||
@@ -426,15 +433,28 @@ func (f *fileServer) createEndpoint(i int) (*http.ServeMux, net.Listener, string
|
||||
}
|
||||
|
||||
if doRedirect {
|
||||
if redirect.Status == 200 {
|
||||
switch redirect.Status {
|
||||
case 404:
|
||||
w.WriteHeader(404)
|
||||
file, err := fs.Open(strings.TrimPrefix(redirect.To, u.Path))
|
||||
if err == nil {
|
||||
defer file.Close()
|
||||
io.Copy(w, file)
|
||||
} else {
|
||||
fmt.Fprintln(w, "<h1>Page Not Found</h1>")
|
||||
}
|
||||
return
|
||||
case 200:
|
||||
if r2 := f.rewriteRequest(r, strings.TrimPrefix(redirect.To, u.Path)); r2 != nil {
|
||||
requestURI = redirect.To
|
||||
r = r2
|
||||
}
|
||||
} else {
|
||||
fallthrough
|
||||
default:
|
||||
w.Header().Set("Content-Type", "")
|
||||
http.Redirect(w, r, redirect.To, redirect.Status)
|
||||
return
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+164
-15
@@ -25,6 +25,7 @@ import (
|
||||
|
||||
"github.com/gohugoio/hugo/config"
|
||||
"github.com/gohugoio/hugo/helpers"
|
||||
"github.com/gohugoio/hugo/htesting"
|
||||
"golang.org/x/net/context"
|
||||
"golang.org/x/sync/errgroup"
|
||||
|
||||
@@ -41,12 +42,98 @@ func TestServerPanicOnConfigError(t *testing.T) {
|
||||
linenos='table'
|
||||
`
|
||||
|
||||
r := runServerTest(c, 0, config)
|
||||
r := runServerTest(c,
|
||||
serverTestOptions{
|
||||
config: config,
|
||||
},
|
||||
)
|
||||
|
||||
c.Assert(r.err, qt.IsNotNil)
|
||||
c.Assert(r.err.Error(), qt.Contains, "cannot parse 'Highlight.LineNos' as bool:")
|
||||
}
|
||||
|
||||
func TestServer404(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
|
||||
r := runServerTest(c,
|
||||
serverTestOptions{
|
||||
pathsToGet: []string{"this/does/not/exist"},
|
||||
getNumHomes: 1,
|
||||
},
|
||||
)
|
||||
|
||||
c.Assert(r.err, qt.IsNil)
|
||||
pr := r.pathsResults["this/does/not/exist"]
|
||||
c.Assert(pr.statusCode, qt.Equals, http.StatusNotFound)
|
||||
c.Assert(pr.body, qt.Contains, "404: 404 Page not found|Not Found.")
|
||||
}
|
||||
|
||||
func TestServerPathEncodingIssues(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
|
||||
// Issue 10287
|
||||
c.Run("Unicode paths", func(c *qt.C) {
|
||||
r := runServerTest(c,
|
||||
serverTestOptions{
|
||||
pathsToGet: []string{"hügö/"},
|
||||
getNumHomes: 1,
|
||||
},
|
||||
)
|
||||
|
||||
c.Assert(r.err, qt.IsNil)
|
||||
c.Assert(r.pathsResults["hügö/"].body, qt.Contains, "This is hügö")
|
||||
})
|
||||
|
||||
// Issue 10314
|
||||
c.Run("Windows multilingual 404", func(c *qt.C) {
|
||||
config := `
|
||||
baseURL = 'https://example.org/'
|
||||
title = 'Hugo Forum Topic #40568'
|
||||
|
||||
defaultContentLanguageInSubdir = true
|
||||
|
||||
[languages.en]
|
||||
contentDir = 'content/en'
|
||||
languageCode = 'en-US'
|
||||
languageName = 'English'
|
||||
weight = 1
|
||||
|
||||
[languages.es]
|
||||
contentDir = 'content/es'
|
||||
languageCode = 'es-ES'
|
||||
languageName = 'Espanol'
|
||||
weight = 2
|
||||
|
||||
[server]
|
||||
[[server.redirects]]
|
||||
from = '/en/**'
|
||||
to = '/en/404.html'
|
||||
status = 404
|
||||
|
||||
[[server.redirects]]
|
||||
from = '/es/**'
|
||||
to = '/es/404.html'
|
||||
status = 404
|
||||
`
|
||||
r := runServerTest(c,
|
||||
serverTestOptions{
|
||||
config: config,
|
||||
pathsToGet: []string{"en/this/does/not/exist", "es/this/does/not/exist"},
|
||||
getNumHomes: 1,
|
||||
},
|
||||
)
|
||||
|
||||
c.Assert(r.err, qt.IsNil)
|
||||
pr1 := r.pathsResults["en/this/does/not/exist"]
|
||||
pr2 := r.pathsResults["es/this/does/not/exist"]
|
||||
c.Assert(pr1.statusCode, qt.Equals, http.StatusNotFound)
|
||||
c.Assert(pr2.statusCode, qt.Equals, http.StatusNotFound)
|
||||
c.Assert(pr1.body, qt.Contains, "404: 404 Page not found|Not Found.")
|
||||
c.Assert(pr2.body, qt.Contains, "404: 404 Page not found|Not Found.")
|
||||
|
||||
})
|
||||
|
||||
}
|
||||
func TestServerFlags(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
|
||||
@@ -81,7 +168,13 @@ baseURL="https://example.org"
|
||||
args = strings.Split(test.flag, "=")
|
||||
}
|
||||
|
||||
r := runServerTest(c, 1, config, args...)
|
||||
opts := serverTestOptions{
|
||||
config: config,
|
||||
args: args,
|
||||
getNumHomes: 1,
|
||||
}
|
||||
|
||||
r := runServerTest(c, opts)
|
||||
|
||||
test.assert(c, r)
|
||||
|
||||
@@ -92,6 +185,10 @@ baseURL="https://example.org"
|
||||
}
|
||||
|
||||
func TestServerBugs(t *testing.T) {
|
||||
// TODO(bep) this is flaky on Windows on GH Actions.
|
||||
if htesting.IsGitHubAction() && runtime.GOOS == "windows" {
|
||||
t.Skip("skipping on windows")
|
||||
}
|
||||
c := qt.New(t)
|
||||
|
||||
for _, test := range []struct {
|
||||
@@ -101,6 +198,10 @@ func TestServerBugs(t *testing.T) {
|
||||
numservers int
|
||||
assert func(c *qt.C, r serverTestResult)
|
||||
}{
|
||||
{"PostProcess, memory", "", "", 1, func(c *qt.C, r serverTestResult) {
|
||||
c.Assert(r.err, qt.IsNil)
|
||||
c.Assert(r.homesContent[0], qt.Contains, "PostProcess: /foo.min.css")
|
||||
}},
|
||||
// Issue 9788
|
||||
{"PostProcess, memory", "", "", 1, func(c *qt.C, r serverTestResult) {
|
||||
c.Assert(r.err, qt.IsNil)
|
||||
@@ -140,7 +241,18 @@ baseURL="https://example.org"
|
||||
if test.flag != "" {
|
||||
args = strings.Split(test.flag, "=")
|
||||
}
|
||||
r := runServerTest(c, test.numservers, test.config, args...)
|
||||
|
||||
opts := serverTestOptions{
|
||||
config: test.config,
|
||||
getNumHomes: test.numservers,
|
||||
pathsToGet: []string{"this/does/not/exist"},
|
||||
args: args,
|
||||
}
|
||||
|
||||
r := runServerTest(c, opts)
|
||||
pr := r.pathsResults["this/does/not/exist"]
|
||||
c.Assert(pr.statusCode, qt.Equals, http.StatusNotFound)
|
||||
c.Assert(pr.body, qt.Contains, "404: 404 Page not found|Not Found.")
|
||||
test.assert(c, r)
|
||||
|
||||
})
|
||||
@@ -152,11 +264,29 @@ baseURL="https://example.org"
|
||||
type serverTestResult struct {
|
||||
err error
|
||||
homesContent []string
|
||||
content404 string
|
||||
publicDirnames map[string]bool
|
||||
pathsResults map[string]pathResult
|
||||
}
|
||||
|
||||
func runServerTest(c *qt.C, getNumHomes int, config string, args ...string) (result serverTestResult) {
|
||||
dir := createSimpleTestSite(c, testSiteConfig{configTOML: config})
|
||||
type pathResult struct {
|
||||
statusCode int
|
||||
body string
|
||||
}
|
||||
|
||||
type serverTestOptions struct {
|
||||
getNumHomes int
|
||||
config string
|
||||
pathsToGet []string
|
||||
args []string
|
||||
}
|
||||
|
||||
func runServerTest(c *qt.C, opts serverTestOptions) serverTestResult {
|
||||
dir := createSimpleTestSite(c, testSiteConfig{configTOML: opts.config})
|
||||
result := serverTestResult{
|
||||
publicDirnames: make(map[string]bool),
|
||||
pathsResults: make(map[string]pathResult),
|
||||
}
|
||||
|
||||
sp, err := helpers.FindAvailablePort()
|
||||
c.Assert(err, qt.IsNil)
|
||||
@@ -172,7 +302,7 @@ func runServerTest(c *qt.C, getNumHomes int, config string, args ...string) (res
|
||||
scmd := b.newServerCmdSignaled(stop)
|
||||
|
||||
cmd := scmd.getCommand()
|
||||
args = append([]string{"-s=" + dir, fmt.Sprintf("-p=%d", port)}, args...)
|
||||
args := append([]string{"-s=" + dir, fmt.Sprintf("-p=%d", port)}, opts.args...)
|
||||
cmd.SetArgs(args)
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
@@ -184,16 +314,20 @@ func runServerTest(c *qt.C, getNumHomes int, config string, args ...string) (res
|
||||
return err
|
||||
})
|
||||
|
||||
if getNumHomes > 0 {
|
||||
if opts.getNumHomes > 0 {
|
||||
// Esp. on slow CI machines, we need to wait a little before the web
|
||||
// server is ready.
|
||||
time.Sleep(567 * time.Millisecond)
|
||||
result.homesContent = make([]string, getNumHomes)
|
||||
for i := 0; i < getNumHomes; i++ {
|
||||
wait := 567 * time.Millisecond
|
||||
if os.Getenv("CI") != "" {
|
||||
wait = 2 * time.Second
|
||||
}
|
||||
time.Sleep(wait)
|
||||
result.homesContent = make([]string, opts.getNumHomes)
|
||||
for i := 0; i < opts.getNumHomes; i++ {
|
||||
func() {
|
||||
resp, err := http.Get(fmt.Sprintf("http://localhost:%d/", port+i))
|
||||
c.Check(err, qt.IsNil)
|
||||
c.Check(resp.StatusCode, qt.Equals, http.StatusOK)
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(resp.StatusCode, qt.Equals, http.StatusOK)
|
||||
if err == nil {
|
||||
defer resp.Body.Close()
|
||||
result.homesContent[i] = helpers.ReaderToString(resp.Body)
|
||||
@@ -202,6 +336,22 @@ func runServerTest(c *qt.C, getNumHomes int, config string, args ...string) (res
|
||||
}
|
||||
}
|
||||
|
||||
for _, path := range opts.pathsToGet {
|
||||
func() {
|
||||
resp, err := http.Get(fmt.Sprintf("http://localhost:%d/%s", port, path))
|
||||
c.Assert(err, qt.IsNil)
|
||||
pr := pathResult{
|
||||
statusCode: resp.StatusCode,
|
||||
}
|
||||
|
||||
if err == nil {
|
||||
defer resp.Body.Close()
|
||||
pr.body = helpers.ReaderToString(resp.Body)
|
||||
}
|
||||
result.pathsResults[path] = pr
|
||||
}()
|
||||
}
|
||||
|
||||
time.Sleep(1 * time.Second)
|
||||
|
||||
select {
|
||||
@@ -210,15 +360,14 @@ func runServerTest(c *qt.C, getNumHomes int, config string, args ...string) (res
|
||||
}
|
||||
|
||||
pubFiles, err := os.ReadDir(filepath.Join(dir, "public"))
|
||||
c.Check(err, qt.IsNil)
|
||||
result.publicDirnames = make(map[string]bool)
|
||||
c.Assert(err, qt.IsNil)
|
||||
for _, f := range pubFiles {
|
||||
result.publicDirnames[f.Name()] = true
|
||||
}
|
||||
|
||||
result.err = wg.Wait()
|
||||
|
||||
return
|
||||
return result
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@
|
||||
package commands
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/gohugoio/hugo/common/herrors"
|
||||
"github.com/gohugoio/hugo/hugolib/filesystems"
|
||||
|
||||
"github.com/fsnotify/fsnotify"
|
||||
@@ -95,7 +95,7 @@ func (s *staticSyncer) syncsStaticEvents(staticEvents []fsnotify.Event) error {
|
||||
// the source of that static file. In this case Hugo will incorrectly remove that file
|
||||
// from the published directory.
|
||||
if ev.Op&fsnotify.Rename == fsnotify.Rename || ev.Op&fsnotify.Remove == fsnotify.Remove {
|
||||
if _, err := sourceFs.Fs.Stat(relPath); os.IsNotExist(err) {
|
||||
if _, err := sourceFs.Fs.Stat(relPath); herrors.IsNotExist(err) {
|
||||
// If file doesn't exist in any static dir, remove it
|
||||
logger.Println("File no longer exists in static dir, removing", relPath)
|
||||
_ = c.Fs.PublishDirStatic.RemoveAll(relPath)
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
// Package common provides common helper functionality for Hugo.
|
||||
package common
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2018 The Hugo Authors. All rights reserved.
|
||||
// Copyright 2022 The Hugo Authors. All rights reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
@@ -19,6 +19,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
"runtime"
|
||||
"runtime/debug"
|
||||
"strconv"
|
||||
@@ -38,7 +39,8 @@ type ErrorSender interface {
|
||||
|
||||
// Recover is a helper function that can be used to capture panics.
|
||||
// Put this at the top of a method/function that crashes in a template:
|
||||
// defer herrors.Recover()
|
||||
//
|
||||
// defer herrors.Recover()
|
||||
func Recover(args ...any) {
|
||||
if r := recover(); r != nil {
|
||||
fmt.Println("ERR:", r)
|
||||
@@ -69,3 +71,18 @@ func Must(err error) {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
|
||||
// IsNotExist returns true if the error is a file not found error.
|
||||
// Unlike os.IsNotExist, this also considers wrapped errors.
|
||||
func IsNotExist(err error) bool {
|
||||
if os.IsNotExist(err) {
|
||||
return true
|
||||
}
|
||||
|
||||
// os.IsNotExist does not consider wrapped errors.
|
||||
if os.IsNotExist(errors.Unwrap(err)) {
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
// Copyright 2022 The Hugo Authors. All rights reserved.
|
||||
//
|
||||
// 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.
|
||||
|
||||
package herrors
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
qt "github.com/frankban/quicktest"
|
||||
"github.com/spf13/afero"
|
||||
)
|
||||
|
||||
func TestIsNotExist(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
|
||||
c.Assert(IsNotExist(afero.ErrFileNotFound), qt.Equals, true)
|
||||
c.Assert(IsNotExist(afero.ErrFileExists), qt.Equals, false)
|
||||
c.Assert(IsNotExist(afero.ErrDestinationExists), qt.Equals, false)
|
||||
c.Assert(IsNotExist(nil), qt.Equals, false)
|
||||
|
||||
c.Assert(IsNotExist(fmt.Errorf("foo")), qt.Equals, false)
|
||||
|
||||
// os.IsNotExist returns false for wrapped errors.
|
||||
c.Assert(IsNotExist(fmt.Errorf("foo: %w", afero.ErrFileNotFound)), qt.Equals, true)
|
||||
}
|
||||
@@ -16,8 +16,6 @@ package hugio
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/spf13/afero"
|
||||
@@ -53,7 +51,7 @@ func CopyFile(fs afero.Fs, from, to string) error {
|
||||
|
||||
// CopyDir copies a directory.
|
||||
func CopyDir(fs afero.Fs, from, to string, shouldCopy func(filename string) bool) error {
|
||||
fi, err := os.Stat(from)
|
||||
fi, err := fs.Stat(from)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -67,7 +65,7 @@ func CopyDir(fs afero.Fs, from, to string, shouldCopy func(filename string) bool
|
||||
return err
|
||||
}
|
||||
|
||||
entries, _ := ioutil.ReadDir(from)
|
||||
entries, _ := afero.ReadDir(fs, from)
|
||||
for _, entry := range entries {
|
||||
fromFilename := filepath.Join(from, entry.Name())
|
||||
toFilename := filepath.Join(to, entry.Name())
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
// Copyright 2022 The Hugo Authors. All rights reserved.
|
||||
//
|
||||
// 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.
|
||||
|
||||
package hugio
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
)
|
||||
|
||||
// HasBytesWriter is a writer that will set Match to true if the given pattern
|
||||
// is found in the stream.
|
||||
type HasBytesWriter struct {
|
||||
Match bool
|
||||
Pattern []byte
|
||||
|
||||
i int
|
||||
done bool
|
||||
buff []byte
|
||||
}
|
||||
|
||||
func (h *HasBytesWriter) Write(p []byte) (n int, err error) {
|
||||
if h.done {
|
||||
return len(p), nil
|
||||
}
|
||||
|
||||
if len(h.buff) == 0 {
|
||||
h.buff = make([]byte, len(h.Pattern)*2)
|
||||
}
|
||||
|
||||
for i := range p {
|
||||
h.buff[h.i] = p[i]
|
||||
h.i++
|
||||
if h.i == len(h.buff) {
|
||||
// Shift left.
|
||||
copy(h.buff, h.buff[len(h.buff)/2:])
|
||||
h.i = len(h.buff) / 2
|
||||
}
|
||||
|
||||
if bytes.Contains(h.buff, h.Pattern) {
|
||||
h.Match = true
|
||||
h.done = true
|
||||
return len(p), nil
|
||||
}
|
||||
}
|
||||
|
||||
return len(p), nil
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
// Copyright 2022 The Hugo Authors. All rights reserved.
|
||||
//
|
||||
// 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.
|
||||
|
||||
package hugio
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"math/rand"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
qt "github.com/frankban/quicktest"
|
||||
)
|
||||
|
||||
func TestHasBytesWriter(t *testing.T) {
|
||||
r := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
|
||||
c := qt.New((t))
|
||||
|
||||
neww := func() (*HasBytesWriter, io.Writer) {
|
||||
var b bytes.Buffer
|
||||
|
||||
h := &HasBytesWriter{
|
||||
Pattern: []byte("__foo"),
|
||||
}
|
||||
return h, io.MultiWriter(&b, h)
|
||||
}
|
||||
|
||||
rndStr := func() string {
|
||||
return strings.Repeat("ab cfo", r.Intn(33))
|
||||
}
|
||||
|
||||
for i := 0; i < 22; i++ {
|
||||
h, w := neww()
|
||||
fmt.Fprintf(w, rndStr()+"abc __foobar"+rndStr())
|
||||
c.Assert(h.Match, qt.Equals, true)
|
||||
|
||||
h, w = neww()
|
||||
fmt.Fprintf(w, rndStr()+"abc __f")
|
||||
fmt.Fprintf(w, "oo bar"+rndStr())
|
||||
c.Assert(h.Match, qt.Equals, true)
|
||||
|
||||
h, w = neww()
|
||||
fmt.Fprintf(w, rndStr()+"abc __moo bar")
|
||||
c.Assert(h.Match, qt.Equals, false)
|
||||
}
|
||||
|
||||
h, w := neww()
|
||||
fmt.Fprintf(w, "__foo")
|
||||
c.Assert(h.Match, qt.Equals, true)
|
||||
}
|
||||
@@ -34,7 +34,7 @@ type multiWriteCloser struct {
|
||||
func (m multiWriteCloser) Close() error {
|
||||
var err error
|
||||
for _, c := range m.closers {
|
||||
if closeErr := c.Close(); err != nil {
|
||||
if closeErr := c.Close(); closeErr != nil {
|
||||
err = closeErr
|
||||
}
|
||||
}
|
||||
|
||||
+44
-14
@@ -24,6 +24,8 @@ import (
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/bep/godartsass"
|
||||
"github.com/gohugoio/hugo/common/hexec"
|
||||
"github.com/gohugoio/hugo/hugofs/files"
|
||||
|
||||
"github.com/spf13/afero"
|
||||
@@ -68,7 +70,7 @@ func (i Info) Version() VersionString {
|
||||
|
||||
// Generator a Hugo meta generator HTML tag.
|
||||
func (i Info) Generator() template.HTML {
|
||||
return template.HTML(fmt.Sprintf(`<meta name="generator" content="Hugo %s" />`, CurrentVersion.String()))
|
||||
return template.HTML(fmt.Sprintf(`<meta name="generator" content="Hugo %s">`, CurrentVersion.String()))
|
||||
}
|
||||
|
||||
func (i Info) IsProduction() bool {
|
||||
@@ -124,6 +126,8 @@ func GetExecEnviron(workDir string, cfg config.Provider, fs afero.Fs) []string {
|
||||
config.SetEnvVars(&env, "HUGO_ENVIRONMENT", cfg.GetString("environment"))
|
||||
config.SetEnvVars(&env, "HUGO_ENV", cfg.GetString("environment"))
|
||||
|
||||
config.SetEnvVars(&env, "HUGO_PUBLISHDIR", filepath.Join(workDir, cfg.GetString("publishDirOrig")))
|
||||
|
||||
if fs != nil {
|
||||
fis, err := afero.ReadDir(fs, files.FolderJSConfig)
|
||||
if err == nil {
|
||||
@@ -184,24 +188,15 @@ func getBuildInfo() *buildInfo {
|
||||
return bInfo
|
||||
}
|
||||
|
||||
func formatDep(path, version string) string {
|
||||
return fmt.Sprintf("%s=%q", path, version)
|
||||
}
|
||||
|
||||
// GetDependencyList returns a sorted dependency list on the format package="version".
|
||||
// It includes both Go dependencies and (a manually maintained) list of C(++) dependencies.
|
||||
func GetDependencyList() []string {
|
||||
var deps []string
|
||||
|
||||
formatDep := func(path, version string) string {
|
||||
return fmt.Sprintf("%s=%q", path, version)
|
||||
}
|
||||
|
||||
if IsExtended {
|
||||
deps = append(
|
||||
deps,
|
||||
// TODO(bep) consider adding a DepsNonGo() method to these upstream projects.
|
||||
formatDep("github.com/sass/libsass", "3.6.5"),
|
||||
formatDep("github.com/webmproject/libwebp", "v1.2.0"),
|
||||
)
|
||||
}
|
||||
|
||||
bi := getBuildInfo()
|
||||
if bi == nil {
|
||||
return deps
|
||||
@@ -211,11 +206,36 @@ func GetDependencyList() []string {
|
||||
deps = append(deps, formatDep(dep.Path, dep.Version))
|
||||
}
|
||||
|
||||
deps = append(deps, GetDependencyListNonGo()...)
|
||||
|
||||
sort.Strings(deps)
|
||||
|
||||
return deps
|
||||
}
|
||||
|
||||
// GetDependencyListNonGo returns a list of non-Go dependencies.
|
||||
func GetDependencyListNonGo() []string {
|
||||
var deps []string
|
||||
|
||||
if IsExtended {
|
||||
deps = append(
|
||||
deps,
|
||||
formatDep("github.com/sass/libsass", "3.6.5"),
|
||||
formatDep("github.com/webmproject/libwebp", "v1.2.4"),
|
||||
)
|
||||
}
|
||||
|
||||
if dartSass := dartSassVersion(); dartSass.ProtocolVersion != "" {
|
||||
const dartSassPath = "github.com/sass/dart-sass-embedded"
|
||||
deps = append(deps,
|
||||
formatDep(dartSassPath+"/protocol", dartSass.ProtocolVersion),
|
||||
formatDep(dartSassPath+"/compiler", dartSass.CompilerVersion),
|
||||
formatDep(dartSassPath+"/implementation", dartSass.ImplementationVersion),
|
||||
)
|
||||
}
|
||||
return deps
|
||||
}
|
||||
|
||||
// IsRunningAsTest reports whether we are running as a test.
|
||||
func IsRunningAsTest() bool {
|
||||
for _, arg := range os.Args {
|
||||
@@ -249,3 +269,13 @@ type Dependency struct {
|
||||
// Replaced by this dependency.
|
||||
Replace *Dependency
|
||||
}
|
||||
|
||||
func dartSassVersion() godartsass.DartSassVersion {
|
||||
// This is also duplicated in the dartsass package.
|
||||
const dartSassEmbeddedBinaryName = "dart-sass-embedded"
|
||||
if !hexec.InPath(dartSassEmbeddedBinaryName) {
|
||||
return godartsass.DartSassVersion{}
|
||||
}
|
||||
v, _ := godartsass.Version(dartSassEmbeddedBinaryName)
|
||||
return v
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ package hugo
|
||||
// This should be the only one.
|
||||
var CurrentVersion = Version{
|
||||
Major: 0,
|
||||
Minor: 102,
|
||||
Minor: 110,
|
||||
PatchLevel: 0,
|
||||
Suffix: "-DEV",
|
||||
Suffix: "",
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ type Scratch struct {
|
||||
|
||||
// Scratcher provides a scratching service.
|
||||
type Scratcher interface {
|
||||
// Scratch returns a "scratch pad" that can be used to store state.
|
||||
Scratch() *Scratch
|
||||
}
|
||||
|
||||
|
||||
@@ -263,3 +263,14 @@ func (n NamedSlice) String() string {
|
||||
}
|
||||
return fmt.Sprintf("%s%s{%s}", n.Name, FilePathSeparator, strings.Join(n.Slice, ","))
|
||||
}
|
||||
|
||||
// DirFile holds the result from path.Split.
|
||||
type DirFile struct {
|
||||
Dir string
|
||||
File string
|
||||
}
|
||||
|
||||
// Used in test.
|
||||
func (df DirFile) String() string {
|
||||
return fmt.Sprintf("%s|%s", df.Dir, df.File)
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ import (
|
||||
// Positioner represents a thing that knows its position in a text file or stream,
|
||||
// typically an error.
|
||||
type Positioner interface {
|
||||
// Position returns the current position.
|
||||
// Useful in error logging, e.g. {{ errorf "error in code block: %s" .Position }}.
|
||||
Position() Position
|
||||
}
|
||||
|
||||
|
||||
+30
-10
@@ -180,10 +180,15 @@ type Headers struct {
|
||||
}
|
||||
|
||||
type Redirect struct {
|
||||
From string
|
||||
To string
|
||||
From string
|
||||
To string
|
||||
|
||||
// HTTP status code to use for the redirect.
|
||||
// A status code of 200 will trigger a URL rewrite.
|
||||
Status int
|
||||
Force bool
|
||||
|
||||
// Forcode redirect, even if original request path exists.
|
||||
Force bool
|
||||
}
|
||||
|
||||
func (r Redirect) IsZero() bool {
|
||||
@@ -200,16 +205,31 @@ func DecodeServer(cfg Provider) (*Server, error) {
|
||||
_ = mapstructure.WeakDecode(m, s)
|
||||
|
||||
for i, redir := range s.Redirects {
|
||||
// Get it in line with the Hugo server.
|
||||
redir.To = strings.TrimSuffix(redir.To, "index.html")
|
||||
if !strings.HasPrefix(redir.To, "https") && !strings.HasSuffix(redir.To, "/") {
|
||||
// There are some tricky infinite loop situations when dealing
|
||||
// when the target does not have a trailing slash.
|
||||
// This can certainly be handled better, but not time for that now.
|
||||
return nil, fmt.Errorf("unsupported redirect to value %q in server config; currently this must be either a remote destination or a local folder, e.g. \"/blog/\" or \"/blog/index.html\"", redir.To)
|
||||
// Get it in line with the Hugo server for OK responses.
|
||||
// We currently treat the 404 as a special case, they are always "ugly", so keep them as is.
|
||||
if redir.Status != 404 {
|
||||
redir.To = strings.TrimSuffix(redir.To, "index.html")
|
||||
if !strings.HasPrefix(redir.To, "https") && !strings.HasSuffix(redir.To, "/") {
|
||||
// There are some tricky infinite loop situations when dealing
|
||||
// when the target does not have a trailing slash.
|
||||
// This can certainly be handled better, but not time for that now.
|
||||
return nil, fmt.Errorf("unsupported redirect to value %q in server config; currently this must be either a remote destination or a local folder, e.g. \"/blog/\" or \"/blog/index.html\"", redir.To)
|
||||
}
|
||||
}
|
||||
s.Redirects[i] = redir
|
||||
}
|
||||
|
||||
if len(s.Redirects) == 0 {
|
||||
// Set up a default redirect for 404s.
|
||||
s.Redirects = []Redirect{
|
||||
{
|
||||
From: "**",
|
||||
To: "/404.html",
|
||||
Status: 404,
|
||||
},
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return s, nil
|
||||
}
|
||||
|
||||
+12
-2
@@ -29,11 +29,22 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
// See issue #8979 for context.
|
||||
// Hugo has always used config.toml etc. as the default config file name.
|
||||
// But hugo.toml is a more descriptive name, but we need to check for both.
|
||||
DefaultConfigNames = []string{"hugo", "config"}
|
||||
|
||||
DefaultConfigNamesSet = make(map[string]bool)
|
||||
|
||||
ValidConfigFileExtensions = []string{"toml", "yaml", "yml", "json"}
|
||||
validConfigFileExtensionsMap map[string]bool = make(map[string]bool)
|
||||
)
|
||||
|
||||
func init() {
|
||||
for _, name := range DefaultConfigNames {
|
||||
DefaultConfigNamesSet[name] = true
|
||||
}
|
||||
|
||||
for _, ext := range ValidConfigFileExtensions {
|
||||
validConfigFileExtensionsMap[ext] = true
|
||||
}
|
||||
@@ -142,8 +153,7 @@ func LoadConfigFromDir(sourceFs afero.Fs, configDir, environment string) (Provid
|
||||
}
|
||||
|
||||
var keyPath []string
|
||||
|
||||
if name != "config" {
|
||||
if !DefaultConfigNamesSet[name] {
|
||||
// Can be params.jp, menus.en etc.
|
||||
name, lang := paths.FileAndExtNoDelimiter(name)
|
||||
|
||||
|
||||
@@ -42,10 +42,10 @@ var DefaultConfig = Config{
|
||||
),
|
||||
// These have been tested to work with Hugo's external programs
|
||||
// on Windows, Linux and MacOS.
|
||||
OsEnv: NewWhitelist("(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$"),
|
||||
OsEnv: NewWhitelist(`(?i)^((HTTPS?|NO)_PROXY|PATH(EXT)?|APPDATA|TE?MP|TERM|GO\w+)$`),
|
||||
},
|
||||
Funcs: Funcs{
|
||||
Getenv: NewWhitelist("^HUGO_"),
|
||||
Getenv: NewWhitelist("^HUGO_", "^CI$"),
|
||||
},
|
||||
HTTP: HTTP{
|
||||
URLs: NewWhitelist(".*"),
|
||||
|
||||
@@ -140,7 +140,7 @@ func TestToTOML(t *testing.T) {
|
||||
got := DefaultConfig.ToTOML()
|
||||
|
||||
c.Assert(got, qt.Equals,
|
||||
"[security]\n enableInlineShortcodes = false\n [security.exec]\n allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$']\n osEnv = ['(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$']\n\n [security.funcs]\n getenv = ['^HUGO_']\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+)$']\n\n [security.funcs]\n getenv = ['^HUGO_', '^CI$']\n\n [security.http]\n methods = ['(?i)GET|POST']\n urls = ['.*']",
|
||||
)
|
||||
}
|
||||
|
||||
@@ -163,4 +163,8 @@ func TestDecodeConfigDefault(t *testing.T) {
|
||||
c.Assert(pc.HTTP.Methods.Accept("GET"), qt.IsTrue)
|
||||
c.Assert(pc.HTTP.Methods.Accept("get"), qt.IsTrue)
|
||||
c.Assert(pc.HTTP.Methods.Accept("DELETE"), qt.IsFalse)
|
||||
|
||||
c.Assert(pc.Exec.OsEnv.Accept("PATH"), qt.IsTrue)
|
||||
c.Assert(pc.Exec.OsEnv.Accept("GOROOT"), qt.IsTrue)
|
||||
c.Assert(pc.Exec.OsEnv.Accept("MYSECRET"), qt.IsFalse)
|
||||
}
|
||||
@@ -33,6 +33,7 @@ type Whitelist struct {
|
||||
patternsStrings []string
|
||||
}
|
||||
|
||||
// MarshalJSON is for internal use only.
|
||||
func (w Whitelist) MarshalJSON() ([]byte, error) {
|
||||
if w.acceptNone {
|
||||
return json.Marshal(acceptNoneKeyword)
|
||||
|
||||
+5
-3
@@ -52,7 +52,7 @@ draft: true
|
||||
|
||||
// NewContent creates a new content file in h (or a full bundle if the archetype is a directory)
|
||||
// in targetPath.
|
||||
func NewContent(h *hugolib.HugoSites, kind, targetPath string) error {
|
||||
func NewContent(h *hugolib.HugoSites, kind, targetPath string, force bool) error {
|
||||
if h.BaseFs.Content.Dirs == nil {
|
||||
return errors.New("no existing content directory configured for this project")
|
||||
}
|
||||
@@ -76,6 +76,7 @@ func NewContent(h *hugolib.HugoSites, kind, targetPath string) error {
|
||||
|
||||
kind: kind,
|
||||
targetPath: targetPath,
|
||||
force: force,
|
||||
}
|
||||
|
||||
ext := paths.Ext(targetPath)
|
||||
@@ -132,6 +133,7 @@ type contentBuilder struct {
|
||||
kind string
|
||||
isDir bool
|
||||
dirMap archetypeMap
|
||||
force bool
|
||||
}
|
||||
|
||||
func (b *contentBuilder) buildDir() error {
|
||||
@@ -145,7 +147,7 @@ func (b *contentBuilder) buildDir() error {
|
||||
|
||||
for _, fi := range b.dirMap.contentFiles {
|
||||
targetFilename := filepath.Join(b.targetPath, strings.TrimPrefix(fi.Meta().Path, b.archetypeFilename))
|
||||
abs, err := b.cf.CreateContentPlaceHolder(targetFilename)
|
||||
abs, err := b.cf.CreateContentPlaceHolder(targetFilename, b.force)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -218,7 +220,7 @@ func (b *contentBuilder) buildDir() error {
|
||||
}
|
||||
|
||||
func (b *contentBuilder) buildFile() (string, error) {
|
||||
contentPlaceholderAbsFilename, err := b.cf.CreateContentPlaceHolder(b.targetPath)
|
||||
contentPlaceholderAbsFilename, err := b.cf.CreateContentPlaceHolder(b.targetPath, b.force)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
+36
-9
@@ -82,7 +82,7 @@ func TestNewContentFromFile(t *testing.T) {
|
||||
cfg, fs := newTestCfg(c, mm)
|
||||
h, err := hugolib.NewHugoSites(deps.DepsCfg{Cfg: cfg, Fs: fs})
|
||||
c.Assert(err, qt.IsNil)
|
||||
err = create.NewContent(h, cas.kind, cas.path)
|
||||
err = create.NewContent(h, cas.kind, cas.path, false)
|
||||
|
||||
if b, ok := cas.expected.(bool); ok && !b {
|
||||
if !b {
|
||||
@@ -145,7 +145,7 @@ i18n: {{ T "hugo" }}
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(len(h.Sites), qt.Equals, 2)
|
||||
|
||||
c.Assert(create.NewContent(h, "my-bundle", "post/my-post"), qt.IsNil)
|
||||
c.Assert(create.NewContent(h, "my-bundle", "post/my-post", false), qt.IsNil)
|
||||
|
||||
cContains(c, readFileFromFs(t, fs.Source, filepath.Join("content", "post/my-post/resources/hugo1.json")), `hugo1: {{ printf "no template handling in here" }}`)
|
||||
cContains(c, readFileFromFs(t, fs.Source, filepath.Join("content", "post/my-post/resources/hugo2.xml")), `hugo2: {{ printf "no template handling in here" }}`)
|
||||
@@ -157,7 +157,7 @@ i18n: {{ T "hugo" }}
|
||||
|
||||
cContains(c, readFileFromFs(t, fs.Source, filepath.Join("content", "post/my-post/pages/bio.md")), `File: bio.md`, `Site Lang: en`, `Name: Bio`)
|
||||
|
||||
c.Assert(create.NewContent(h, "my-theme-bundle", "post/my-theme-post"), qt.IsNil)
|
||||
c.Assert(create.NewContent(h, "my-theme-bundle", "post/my-theme-post", false), qt.IsNil)
|
||||
cContains(c, readFileFromFs(t, fs.Source, filepath.Join("content", "post/my-theme-post/index.md")), `File: index.md`, `Site Lang: en`, `Name: My Theme Post`, `i18n: Hugo Rocks!`)
|
||||
cContains(c, readFileFromFs(t, fs.Source, filepath.Join("content", "post/my-theme-post/resources/hugo1.json")), `hugo1: {{ printf "no template handling in here" }}`)
|
||||
}
|
||||
@@ -187,19 +187,19 @@ site RegularPages: {{ len site.RegularPages }}
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(len(h.Sites), qt.Equals, 2)
|
||||
|
||||
c.Assert(create.NewContent(h, "my-bundle", "post/my-post"), qt.IsNil)
|
||||
c.Assert(create.NewContent(h, "my-bundle", "post/my-post", false), qt.IsNil)
|
||||
cContains(c, readFileFromFs(t, fs.Source, filepath.Join("content", "post/my-post/index.md")), `site RegularPages: 10`)
|
||||
|
||||
// Default bundle archetype
|
||||
c.Assert(create.NewContent(h, "", "post/my-post2"), qt.IsNil)
|
||||
c.Assert(create.NewContent(h, "", "post/my-post2", false), qt.IsNil)
|
||||
cContains(c, readFileFromFs(t, fs.Source, filepath.Join("content", "post/my-post2/index.md")), `default archetype index.md`)
|
||||
|
||||
// Regular file with bundle kind.
|
||||
c.Assert(create.NewContent(h, "my-bundle", "post/foo.md"), qt.IsNil)
|
||||
c.Assert(create.NewContent(h, "my-bundle", "post/foo.md", false), qt.IsNil)
|
||||
cContains(c, readFileFromFs(t, fs.Source, filepath.Join("content", "post/foo.md")), `draft: true`)
|
||||
|
||||
// Regular files should fall back to the default archetype (we have no regular file archetype).
|
||||
c.Assert(create.NewContent(h, "my-bundle", "mypage.md"), qt.IsNil)
|
||||
c.Assert(create.NewContent(h, "my-bundle", "mypage.md", false), qt.IsNil)
|
||||
cContains(c, readFileFromFs(t, fs.Source, filepath.Join("content", "mypage.md")), `draft: true`)
|
||||
|
||||
}
|
||||
@@ -237,7 +237,7 @@ i18n: {{ T "hugo" }}
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(len(h.Sites), qt.Equals, 2)
|
||||
|
||||
c.Assert(create.NewContent(h, "my-bundle", "post/my-post"), qt.IsNil)
|
||||
c.Assert(create.NewContent(h, "my-bundle", "post/my-post", false), qt.IsNil)
|
||||
|
||||
cContains(c, readFileFromFs(t, fs.Source, filepath.Join("content", "post/my-post/resources/hugo1.json")), `hugo1: {{ printf "no template handling in here" }}`)
|
||||
cContains(c, readFileFromFs(t, fs.Source, filepath.Join("content", "post/my-post/resources/hugo2.xml")), `hugo2: {{ printf "no template handling in here" }}`)
|
||||
@@ -247,11 +247,38 @@ i18n: {{ T "hugo" }}
|
||||
|
||||
cContains(c, readFileFromFs(t, fs.Source, filepath.Join("content", "post/my-post/pages/bio.md")), `File: bio.md`, `Name: Bio`)
|
||||
|
||||
c.Assert(create.NewContent(h, "my-theme-bundle", "post/my-theme-post"), qt.IsNil)
|
||||
c.Assert(create.NewContent(h, "my-theme-bundle", "post/my-theme-post", false), qt.IsNil)
|
||||
cContains(c, readFileFromFs(t, fs.Source, filepath.Join("content", "post/my-theme-post/index.md")), `File: index.md`, `Name: My Theme Post`, `i18n: Hugo Rocks!`)
|
||||
cContains(c, readFileFromFs(t, fs.Source, filepath.Join("content", "post/my-theme-post/resources/hugo1.json")), `hugo1: {{ printf "no template handling in here" }}`)
|
||||
}
|
||||
|
||||
func TestNewContentForce(t *testing.T) {
|
||||
mm := afero.NewMemMapFs()
|
||||
c := qt.New(t)
|
||||
|
||||
archetypeDir := filepath.Join("archetypes", "my-bundle")
|
||||
c.Assert(mm.MkdirAll(archetypeDir, 0o755), qt.IsNil)
|
||||
c.Assert(afero.WriteFile(mm, filepath.Join(archetypeDir, "index.md"), []byte(""), 0o755), qt.IsNil)
|
||||
c.Assert(afero.WriteFile(mm, filepath.Join(archetypeDir, "index.nn.md"), []byte(""), 0o755), qt.IsNil)
|
||||
|
||||
c.Assert(initFs(mm), qt.IsNil)
|
||||
cfg, fs := newTestCfg(c, mm)
|
||||
|
||||
h, err := hugolib.NewHugoSites(deps.DepsCfg{Cfg: cfg, Fs: fs})
|
||||
c.Assert(err, qt.IsNil)
|
||||
c.Assert(len(h.Sites), qt.Equals, 2)
|
||||
|
||||
// from file
|
||||
c.Assert(create.NewContent(h, "post", "post/my-post.md", false), qt.IsNil)
|
||||
c.Assert(create.NewContent(h, "post", "post/my-post.md", false), qt.IsNotNil)
|
||||
c.Assert(create.NewContent(h, "post", "post/my-post.md", true), qt.IsNil)
|
||||
|
||||
// from dir
|
||||
c.Assert(create.NewContent(h, "my-bundle", "post/my-post", false), qt.IsNil)
|
||||
c.Assert(create.NewContent(h, "my-bundle", "post/my-post", false), qt.IsNotNil)
|
||||
c.Assert(create.NewContent(h, "my-bundle", "post/my-post", true), qt.IsNil)
|
||||
}
|
||||
|
||||
func initFs(fs afero.Fs) error {
|
||||
perm := os.FileMode(0o755)
|
||||
var err error
|
||||
|
||||
Vendored
+35
-1
@@ -2,6 +2,8 @@ package deps
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
@@ -16,6 +18,7 @@ import (
|
||||
"github.com/gohugoio/hugo/langs"
|
||||
"github.com/gohugoio/hugo/media"
|
||||
"github.com/gohugoio/hugo/resources/page"
|
||||
"github.com/gohugoio/hugo/resources/postpub"
|
||||
|
||||
"github.com/gohugoio/hugo/metrics"
|
||||
"github.com/gohugoio/hugo/output"
|
||||
@@ -78,6 +81,10 @@ type Deps struct {
|
||||
// All the output formats available for the current site.
|
||||
OutputFormatsConfig output.Formats
|
||||
|
||||
// FilenameHasPostProcessPrefix is a set of filenames in /public that
|
||||
// contains a post-processing prefix.
|
||||
FilenameHasPostProcessPrefix []string
|
||||
|
||||
templateProvider ResourceProvider
|
||||
WithTemplate func(templ tpl.TemplateManager) error `json:"-"`
|
||||
|
||||
@@ -202,6 +209,7 @@ func New(cfg DepsCfg) (*Deps, error) {
|
||||
var (
|
||||
logger = cfg.Logger
|
||||
fs = cfg.Fs
|
||||
d *Deps
|
||||
)
|
||||
|
||||
if cfg.TemplateProvider == nil {
|
||||
@@ -239,6 +247,32 @@ func New(cfg DepsCfg) (*Deps, error) {
|
||||
}
|
||||
execHelper := hexec.New(securityConfig)
|
||||
|
||||
var filenameHasPostProcessPrefixMu sync.Mutex
|
||||
hashBytesReceiverFunc := func(name string, match bool) {
|
||||
if !match {
|
||||
return
|
||||
}
|
||||
filenameHasPostProcessPrefixMu.Lock()
|
||||
d.FilenameHasPostProcessPrefix = append(d.FilenameHasPostProcessPrefix, name)
|
||||
filenameHasPostProcessPrefixMu.Unlock()
|
||||
}
|
||||
|
||||
// Skip binary files.
|
||||
hashBytesSHouldCheck := func(name string) bool {
|
||||
ext := strings.TrimPrefix(filepath.Ext(name), ".")
|
||||
mime, _, found := cfg.MediaTypes.GetBySuffix(ext)
|
||||
if !found {
|
||||
return false
|
||||
}
|
||||
switch mime.MainType {
|
||||
case "text", "application":
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
}
|
||||
fs.PublishDir = hugofs.NewHasBytesReceiver(fs.PublishDir, hashBytesSHouldCheck, hashBytesReceiverFunc, []byte(postpub.PostProcessPrefix))
|
||||
|
||||
ps, err := helpers.NewPathSpec(fs, cfg.Language, logger)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("create PathSpec: %w", err)
|
||||
@@ -274,7 +308,7 @@ func New(cfg DepsCfg) (*Deps, error) {
|
||||
|
||||
logDistinct := helpers.NewDistinctLogger(logger)
|
||||
|
||||
d := &Deps{
|
||||
d = &Deps{
|
||||
Fs: fs,
|
||||
Log: ignorableLogger,
|
||||
LogDistinct: logDistinct,
|
||||
|
||||
+28
-2
@@ -34,6 +34,7 @@
|
||||
"brlink",
|
||||
"Brotli",
|
||||
"Browsersync",
|
||||
"canonicalization",
|
||||
"canonify",
|
||||
"Catmull",
|
||||
"Catwoman",
|
||||
@@ -61,6 +62,8 @@
|
||||
"datatable",
|
||||
"DATOCMS",
|
||||
"debugconfig",
|
||||
"defang",
|
||||
"Deindent",
|
||||
"DELIM",
|
||||
"dhersam",
|
||||
"digitalcraftsman",
|
||||
@@ -72,17 +75,21 @@
|
||||
"DRING",
|
||||
"Eiqc",
|
||||
"Eliott",
|
||||
"embeddable",
|
||||
"Emojify",
|
||||
"Enwrite",
|
||||
"eopkg",
|
||||
"eparis",
|
||||
"errorf",
|
||||
"erroridf",
|
||||
"esbuild",
|
||||
"Evernote",
|
||||
"Exif",
|
||||
"exitwp",
|
||||
"expirydate",
|
||||
"Feminella",
|
||||
"firstpost",
|
||||
"Flickr",
|
||||
"Formspree",
|
||||
"fpath",
|
||||
"Francia",
|
||||
@@ -91,10 +98,12 @@
|
||||
"funcs",
|
||||
"funcsig",
|
||||
"Garen",
|
||||
"Garuda",
|
||||
"gcloud",
|
||||
"Getenv",
|
||||
"getjson",
|
||||
"getpage",
|
||||
"Gitee",
|
||||
"Gmfc",
|
||||
"Goel",
|
||||
"Gohugo",
|
||||
@@ -106,6 +115,7 @@
|
||||
"govendor",
|
||||
"Gowans",
|
||||
"Grayscale",
|
||||
"Gregor",
|
||||
"Gruber",
|
||||
"gtag",
|
||||
"gvfs",
|
||||
@@ -141,10 +151,12 @@
|
||||
"Joomla",
|
||||
"JRBR",
|
||||
"jsonify",
|
||||
"Karmada",
|
||||
"katex",
|
||||
"keycdn",
|
||||
"KEYVALS",
|
||||
"kubernetes",
|
||||
"Kubuntu",
|
||||
"Lanczos",
|
||||
"langformatnumber",
|
||||
"lastmod",
|
||||
@@ -152,6 +164,7 @@
|
||||
"linktitle",
|
||||
"Lipi",
|
||||
"lrwxr",
|
||||
"Lubuntu",
|
||||
"maingo",
|
||||
"markdownified",
|
||||
"markdownify",
|
||||
@@ -188,6 +201,7 @@
|
||||
"newparam",
|
||||
"Nichlas",
|
||||
"Nikhil",
|
||||
"Nikola",
|
||||
"Njjy",
|
||||
"nlist",
|
||||
"nobr",
|
||||
@@ -221,6 +235,7 @@
|
||||
"Poupin",
|
||||
"prerender",
|
||||
"println",
|
||||
"Pritchard",
|
||||
"publishdate",
|
||||
"Pygments",
|
||||
"qref",
|
||||
@@ -249,6 +264,7 @@
|
||||
"safejs",
|
||||
"Samsa",
|
||||
"schemaorg",
|
||||
"setx",
|
||||
"Shekhar",
|
||||
"Shortcode",
|
||||
"Shortcodes",
|
||||
@@ -257,7 +273,9 @@
|
||||
"Sindre",
|
||||
"sitemapindex",
|
||||
"sitemapxml",
|
||||
"slugorfilename",
|
||||
"Smartcrop",
|
||||
"Sobre",
|
||||
"Sprintf",
|
||||
"Startseite",
|
||||
"strconv",
|
||||
@@ -278,6 +296,7 @@
|
||||
"Tknx",
|
||||
"TLDR",
|
||||
"TMPDIR",
|
||||
"toclevels",
|
||||
"TOCSS",
|
||||
"todos",
|
||||
"tojson",
|
||||
@@ -288,6 +307,8 @@
|
||||
"toyaml",
|
||||
"twitteruser",
|
||||
"Unmarshal",
|
||||
"unpublishdate",
|
||||
"Unsharp",
|
||||
"urlize",
|
||||
"urlset",
|
||||
"utimestamp",
|
||||
@@ -301,15 +322,19 @@
|
||||
"wibble",
|
||||
"wordcount",
|
||||
"workson",
|
||||
"Wowchemy",
|
||||
"wpxr",
|
||||
"Xbaabbab",
|
||||
"Xubuntu",
|
||||
"xvzf",
|
||||
"yoyoyo",
|
||||
"yunbox",
|
||||
"Zgotmpl",
|
||||
"Zorin",
|
||||
"zzbbaabb",
|
||||
"مدونتي"
|
||||
],
|
||||
"language": "en,en-GB,en-US,de,fr",
|
||||
"language": "en,en-US,de,fr",
|
||||
"allowCompoundWords": true,
|
||||
"files": [
|
||||
"**/*.md"
|
||||
@@ -331,5 +356,6 @@
|
||||
"**/news/*",
|
||||
"**/showcase/*"
|
||||
],
|
||||
"useGitignore": true
|
||||
"useGitignore": true,
|
||||
"enabled": true
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -17,6 +17,6 @@ markComment: >
|
||||
If you still think this is important, please tell us why.
|
||||
|
||||
This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.
|
||||
|
||||
|
||||
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||
closeComment: false
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 1 * *"
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: "javascript"
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
+3
-2
@@ -1,4 +1,4 @@
|
||||
name: 'Check spelling'
|
||||
name: "Check spelling"
|
||||
on: # rebuild any PRs and main branch changes
|
||||
push:
|
||||
branches-ignore:
|
||||
@@ -15,6 +15,7 @@ jobs:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: streetsidesoftware/cspell-action@v2
|
||||
with:
|
||||
check_dot_files: false
|
||||
incremental_files_only: true
|
||||
inline: warning
|
||||
strict: false
|
||||
incremental_files_only: true
|
||||
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
name: Super Linter
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
|
||||
jobs:
|
||||
build:
|
||||
permissions:
|
||||
contents: read # to fetch code (actions/checkout)
|
||||
statuses: write # to mark status of each linter run (github/super-linter/slim)
|
||||
|
||||
name: Lint Code Base
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.actor != 'dependabot[bot]' }}
|
||||
|
||||
steps:
|
||||
- name: Checkout Code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Lint Code Base
|
||||
uses: github/super-linter/slim@v4
|
||||
env:
|
||||
DEFAULT_BRANCH: master
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
IGNORE_GITIGNORED_FILES: true
|
||||
LINTER_RULES_PATH: /
|
||||
LOG_LEVEL: NOTICE
|
||||
MARKDOWN_CONFIG_FILE: .markdownlint.yaml
|
||||
SUPPRESS_POSSUM: true
|
||||
VALIDATE_CSS: false
|
||||
VALIDATE_EDITORCONFIG: false
|
||||
VALIDATE_GITLEAKS: false
|
||||
VALIDATE_HTML: false
|
||||
VALIDATE_JAVASCRIPT_STANDARD: false
|
||||
VALIDATE_JSCPD: false
|
||||
VALIDATE_NATURAL_LANGUAGE: false
|
||||
VALIDATE_SHELL_SHFMT: false
|
||||
VALIDATE_XML: false
|
||||
@@ -1,6 +1,7 @@
|
||||
/.idea
|
||||
/.vscode
|
||||
/public
|
||||
/dist
|
||||
node_modules
|
||||
nohup.out
|
||||
.DS_Store
|
||||
|
||||
+22
-2
@@ -1,4 +1,24 @@
|
||||
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
|
||||
|
||||
MD013: false # Line length
|
||||
MD033: false # Inline HTML
|
||||
MD002: false
|
||||
MD003: false
|
||||
MD004: false
|
||||
MD007: false
|
||||
MD012:
|
||||
maximum: 2
|
||||
MD013: false
|
||||
MD014: false
|
||||
MD022: false
|
||||
MD024: false
|
||||
MD031: false
|
||||
MD032: false
|
||||
MD033: false
|
||||
MD034: false
|
||||
MD036: false
|
||||
MD037: false
|
||||
MD038: false
|
||||
MD041: false
|
||||
MD046: false
|
||||
MD049: false
|
||||
MD050: false
|
||||
MD053: false
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
**/commands/**
|
||||
**/functions/**
|
||||
**/news/**
|
||||
**/showcase/**
|
||||
**/zh/**
|
||||
**/license.md
|
||||
@@ -0,0 +1,3 @@
|
||||
**/news/**
|
||||
**/showcase/**
|
||||
**/zh/**
|
||||
Vendored
+2
-1
@@ -1,6 +1,7 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"DavidAnson.vscode-markdownlint",
|
||||
"EditorConfig.EditorConfig",
|
||||
"esbenp.prettier-vscode",
|
||||
"streetsidesoftware.code-spell-checker"
|
||||
]
|
||||
}
|
||||
|
||||
+12
-3
@@ -7,11 +7,11 @@ Documentation site for [Hugo](https://github.com/gohugoio/hugo), the very fast a
|
||||
|
||||
## Contributing
|
||||
|
||||
We welcome contributions to Hugo of any kind including documentation, suggestions, bug reports, pull requests etc. Also check out our [contribution guide](https://gohugo.io/contribute/documentation/). We would love to hear from you.
|
||||
We welcome contributions to Hugo of any kind including documentation, suggestions, bug reports, pull requests etc. Also check out our [contribution guide](https://gohugo.io/contribute/documentation/). We would love to hear from you.
|
||||
|
||||
Note that this repository contains solely the documentation for Hugo. For contributions that aren't documentation-related please refer to the [hugo](https://github.com/gohugoio/hugo) repository.
|
||||
Note that this repository contains solely the documentation for Hugo. For contributions that aren't documentation-related please refer to the [hugo](https://github.com/gohugoio/hugo) repository.
|
||||
|
||||
*Pull requests shall **only** contain changes to the actual documentation. However, changes on the code base of Hugo **and** the documentation shall be a single, atomic pull request in the [hugo](https://github.com/gohugoio/hugo) repository.*
|
||||
*Pull requests shall **only** contain changes to the actual documentation. However, changes on the codebase of Hugo **and** the documentation shall be a single, atomic pull request in the [hugo](https://github.com/gohugoio/hugo) repository.*
|
||||
|
||||
Spelling fixes are most welcomed, and if you want to contribute longer sections to the documentation, it would be great if you had the following criteria in mind when writing:
|
||||
|
||||
@@ -19,6 +19,15 @@ 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:
|
||||
|
||||
```
|
||||
HUGO_MODULE_WORKSPACE=hugo.work hugo server --ignoreVendorPaths "**"
|
||||
```
|
||||
|
||||
## Branches
|
||||
|
||||
* The `master` branch is where the site is automatically built from, and is the place to put changes relevant to the current Hugo version.
|
||||
|
||||
@@ -54,7 +54,7 @@ pre {
|
||||
}
|
||||
|
||||
@media (--breakpoint-large) {
|
||||
.full-width, pre.expand:hover
|
||||
.full-width
|
||||
{
|
||||
/*width: 100vw;
|
||||
position: relative;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
/* From http://cssfontstack.com */
|
||||
/* From https://www.cssfontstack.com */
|
||||
code, .code, pre code, .highlight pre {
|
||||
font-family: 'inconsolata',Menlo,Monaco,'Courier New',monospace;
|
||||
}
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
/* modified from:*/
|
||||
@import 'highlight.js/styles/atom-one-light.css';
|
||||
|
||||
/* hljs-template-variable covers the handlebars templating*/
|
||||
.hljs-template-variable {
|
||||
color: var(--primary-color);
|
||||
}
|
||||
|
||||
.hljs-attr {
|
||||
color: var(--accent-color-light);
|
||||
}
|
||||
+9
-11
@@ -1,12 +1,10 @@
|
||||
require("typeface-muli")
|
||||
require('typeface-muli');
|
||||
import styles from './css/main.css';
|
||||
import './js/clipboardjs.js'
|
||||
import './js/codeblocks.js'
|
||||
import './js/docsearch.js'
|
||||
import './js/hljs.js'
|
||||
import './js/lazysizes.js'
|
||||
import './js/menutoggle.js'
|
||||
import './js/scrolldir.js'
|
||||
import './js/smoothscroll.js'
|
||||
import './js/tabs.js'
|
||||
import './js/nojs.js'
|
||||
import './js/clipboardjs.js';
|
||||
import './js/docsearch.js';
|
||||
import './js/lazysizes.js';
|
||||
import './js/menutoggle.js';
|
||||
import './js/scrolldir.js';
|
||||
import './js/smoothscroll.js';
|
||||
import './js/tabs.js';
|
||||
import './js/nojs.js';
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
let article = document.getElementById('prose')
|
||||
|
||||
if (article) {
|
||||
let codeBlocks = article.getElementsByTagName('code')
|
||||
for (let [key, codeBlock] of Object.entries(codeBlocks)){
|
||||
var widthDif = codeBlock.scrollWidth - codeBlock.clientWidth
|
||||
if (widthDif > 0)
|
||||
codeBlock.parentNode.classList.add('expand')
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
var docsearch = require('docsearch.js/dist/cdn/docsearch.js');
|
||||
docsearch({
|
||||
apiKey: '167e7998590aebda7f9fedcf86bc4a55',
|
||||
indexName: 'hugodocs',
|
||||
inputSelector: '#search-input',
|
||||
debug: true // Set debug to true if you want to inspect the dropdown
|
||||
appId: 'D1BPLZHGYQ',
|
||||
apiKey: '6df94e1e5d55d258c56f60d974d10314',
|
||||
indexName: 'hugodocs',
|
||||
inputSelector: '#search-input',
|
||||
debug: true, // Set debug to true if you want to inspect the dropdown
|
||||
});
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
var hljs = require('highlight.js/lib/highlight.js');
|
||||
|
||||
hljs.registerLanguage('bash', require('highlight.js/lib/languages/bash'));
|
||||
hljs.registerLanguage('css', require('highlight.js/lib/languages/css'));
|
||||
hljs.registerLanguage('markdown', require('highlight.js/lib/languages/markdown'));
|
||||
hljs.registerLanguage('diff', require('highlight.js/lib/languages/diff'));
|
||||
// hljs.registerLanguage('go', require('highlight.js/lib/languages/go'));
|
||||
hljs.registerLanguage('javascript', require('highlight.js/lib/languages/javascript'));
|
||||
hljs.registerLanguage('json', require('highlight.js/lib/languages/json'));
|
||||
hljs.registerLanguage('yaml', require('highlight.js/lib/languages/yaml'));
|
||||
hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml'));
|
||||
hljs.registerLanguage('html', require('highlight.js/lib/languages/handlebars'));
|
||||
|
||||
hljs.registerLanguage("go", function(e) {
|
||||
var t = { keyword: "code output note warning break default func interface select case map struct chan else goto package switch const fallthrough if range end type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune id autoplay Get", literal: "file download copy true false iota nil Pages with", built_in: "append cap close complex highlight copy imag len make new panic print println real recover delete Site Data tweet youtube ref relref vimeo instagram gist figure innershortcode" };
|
||||
return { aliases: ["golang","hugo"], k: t, i: "</", c: [e.CLCM, e.CBCM, { cN: "string", v: [e.QSM, { b: "'", e: "[^\\\\]'" }, { b: "`", e: "`" }] }, { cN: "number", v: [{ b: e.CNR + "[dflsi]", r: 1 }, e.CNM] }, { b: /:=/ }, { cN: "function", bK: "func", e: /\s*\{/, eE: !0, c: [e.TM, { cN: "params", b: /\(/, e: /\)/, k: t, i: /["']/ }] }] }
|
||||
});
|
||||
|
||||
hljs.initHighlightingOnLoad();
|
||||
@@ -4083,7 +4083,7 @@ img { max-width: 100%; }
|
||||
max-width: 30em;
|
||||
}
|
||||
.measure-wide-l {
|
||||
max-width: 40em;
|
||||
max-width: 34em;
|
||||
}
|
||||
.measure-narrow-l {
|
||||
max-width: 20em;
|
||||
@@ -4768,11 +4768,6 @@ h6:hover .header-link {
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
pre, .pre {
|
||||
overflow-x: auto;
|
||||
overflow-y: hidden;
|
||||
overflow: scroll;
|
||||
}
|
||||
code {
|
||||
padding: 0.2em;
|
||||
margin: 0;
|
||||
@@ -4780,7 +4775,7 @@ code {
|
||||
background-color: rgba(27, 31, 35, .05);
|
||||
border-radius: 3px;
|
||||
}
|
||||
pre code {
|
||||
pre code {
|
||||
display: block;
|
||||
padding: 1.5em 1.5em;
|
||||
font-size: .875rem;
|
||||
@@ -4814,7 +4809,7 @@ pre {
|
||||
content: "Copied"
|
||||
}
|
||||
@media screen and (min-width: 60em) {
|
||||
.full-width, pre.expand:hover
|
||||
.full-width
|
||||
{
|
||||
/*width: 100vw;
|
||||
position: relative;
|
||||
@@ -4992,7 +4987,7 @@ dd {
|
||||
font-size: calc(0.70833rem + 0.83333vw);
|
||||
}
|
||||
}
|
||||
/* From http://cssfontstack.com */
|
||||
/* From https://www.cssfontstack.com */
|
||||
code, .code, pre code, .highlight pre {
|
||||
font-family: 'inconsolata',Menlo,Monaco,'Courier New',monospace;
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
+18
-14
@@ -1,19 +1,23 @@
|
||||
[[banners]]
|
||||
name = "Linode"
|
||||
link = "https://www.linode.com/"
|
||||
logo = "/images/sponsors/linode-logo_standard_light_medium.png"
|
||||
copy = ""
|
||||
name = "Linode"
|
||||
link = "https://www.linode.com/"
|
||||
logo = "/images/sponsors/linode-logo_standard_light_medium.png"
|
||||
utm_campaign = "hugosponsor"
|
||||
|
||||
[[banners]]
|
||||
name = "eSolia"
|
||||
link = "https://esolia.com/post/why-did-esolia-choose-hugo/"
|
||||
logo = "/images/sponsors/esolia-logo.svg"
|
||||
copy = ""
|
||||
|
||||
name = "ButterCMS"
|
||||
link = "https://buttercms.com/hugo-cms/"
|
||||
logo = "/images/sponsors/butter-light.svg"
|
||||
utm_campaign = "sponsorship"
|
||||
bgcolor = "#131A3E"
|
||||
|
||||
[[banners]]
|
||||
name = "Brave"
|
||||
link = "https://brave.com/"
|
||||
logo = "/images/sponsors/brave-logo.svg"
|
||||
bgcolor = "#5A2FA1"
|
||||
copy = ""
|
||||
name = "Your Company?"
|
||||
link = "https://bep.is/en/hugo-sponsor-2023-01/"
|
||||
logo = "/images/sponsors/your-company.svg"
|
||||
utm_campaign = "hugosponsor"
|
||||
bgcolor = "#004887"
|
||||
|
||||
#hugohome
|
||||
#hugofooter
|
||||
#hugogithub
|
||||
|
||||
+106
-70
@@ -1,83 +1,119 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" lang="{{ with $.Site.LanguageCode }}{{ . }}{{ else }}en-us{{ end }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
{{/* https://www.zachleat.com/web/preload/ */}}
|
||||
<link rel="preload" href="{{ "fonts/muli-latin-200.woff2" | absURL }}" as="font" type="font/woff2" crossorigin>
|
||||
<link rel="preload" href="{{ "fonts/muli-latin-400.woff2" | absURL }}" as="font" type="font/woff2" crossorigin>
|
||||
<link rel="preload" href="{{ "fonts/muli-latin-800.woff2" | absURL }}" as="font" type="font/woff2" crossorigin>
|
||||
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
{{/* NOTE: the Site's title, and if there is a page title, that is set too */}}
|
||||
<title>{{ block "title" . }}{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}{{ end }}</title>
|
||||
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1">
|
||||
{{ hugo.Generator }}
|
||||
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
|
||||
<meta name="robots" content="index, follow">
|
||||
<html
|
||||
class="no-js"
|
||||
lang="{{ with $.Site.LanguageCode }}
|
||||
{{ . }}
|
||||
{{ else }}
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
en-us
|
||||
{{ end }}
|
||||
">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
{{/* https://www.zachleat.com/web/preload/ */}}
|
||||
<link
|
||||
rel="preload"
|
||||
href="{{ "fonts/muli-latin-200.woff2" | absURL }}"
|
||||
as="font"
|
||||
type="font/woff2"
|
||||
crossorigin />
|
||||
<link
|
||||
rel="preload"
|
||||
href="{{ "fonts/muli-latin-400.woff2" | absURL }}"
|
||||
as="font"
|
||||
type="font/woff2"
|
||||
crossorigin />
|
||||
<link
|
||||
rel="preload"
|
||||
href="{{ "fonts/muli-latin-800.woff2" | absURL }}"
|
||||
as="font"
|
||||
type="font/woff2"
|
||||
crossorigin />
|
||||
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink | safeURL }}">
|
||||
{{ end -}}
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
{{/* NOTE: the Site's title, and if there is a page title, that is set too */}}
|
||||
<title>
|
||||
{{ block "title" . }}
|
||||
{{ with .Title }}{{ . }} | {{ end }}{{ .Site.Title }}
|
||||
{{ end }}
|
||||
|
||||
{{ $isDev := eq hugo.Environment "development" }}
|
||||
{{ $stylesheet := resources.Get "output/css/app.css" }}
|
||||
{{ if not $isDev }}
|
||||
{{ $stylesheet = $stylesheet | minify | fingerprint }}
|
||||
{{ end }}
|
||||
{{ with $stylesheet }}
|
||||
{{ if $isDev }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}" crossorigin="anonymous">
|
||||
{{ else }}
|
||||
<link rel="stylesheet" href="{{ .RelPermalink }}" integrity="{{ .Data.Integrity }}" crossorigin="anonymous">
|
||||
{{ end }}
|
||||
{{ $.Scratch.Set "stylesheet" . }}
|
||||
{{end}}
|
||||
</title>
|
||||
|
||||
<meta name="description"
|
||||
content="{{ with .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}">
|
||||
<meta name="viewport" content="width=device-width,minimum-scale=1" />
|
||||
{{ hugo.Generator }}
|
||||
|
||||
{{ block "scripts" . }}
|
||||
{{- partial "site-scripts.html" . -}}
|
||||
{{ end }}
|
||||
{{ partial "site-manifest.html" . }}
|
||||
{{- partial "head-additions.html" . -}}
|
||||
{{- partial "opengraph/opengraph.html" . -}}
|
||||
{{- template "_internal/schema.html" . -}}
|
||||
{{- partial "opengraph/twitter_cards.html" . -}}
|
||||
{{ if hugo.IsProduction }}
|
||||
<meta name="robots" content="index, follow" />
|
||||
{{ else }}
|
||||
<meta name="robots" content="noindex, nofollow" />
|
||||
{{ end }}
|
||||
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | or (eq .Site.Params.env "production") }}
|
||||
{{ partial "gtag" . }}
|
||||
{{ end }}
|
||||
{{ range .AlternativeOutputFormats -}}
|
||||
<link
|
||||
rel="{{ .Rel }}"
|
||||
type="{{ .MediaType.Type }}"
|
||||
href="{{ .Permalink | safeURL }}" />
|
||||
{{ end -}}
|
||||
|
||||
</head>
|
||||
|
||||
<body class="ma0 sans-serif bg-primary-color-light{{ with getenv "HUGO_ENV" }} {{ . }}{{ end }}">
|
||||
{{ partial "hooks/after-body-start" . }}
|
||||
{{ block "nav" . }}{{ partial "site-nav.html" . }}{{ end }}
|
||||
{{ block "header" . }}{{ end }}
|
||||
<main role="main" class="content-with-sidebar min-vh-100 pb7 pb0-ns">
|
||||
{{ block "main" . }}{{ end }}
|
||||
</main>
|
||||
|
||||
{{ block "footer" . }}{{ partialCached "site-footer.html" . }}{{ end }}
|
||||
|
||||
{{ partial "hooks/before-body-end" . }}
|
||||
|
||||
|
||||
{{ if .Page.Store.Get "hasMermaid" }}
|
||||
<script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
|
||||
<script>
|
||||
mermaid.initialize({ startOnLoad: true });
|
||||
</script>
|
||||
{{ end }}
|
||||
{{ $isDev := eq hugo.Environment "development" }}
|
||||
{{ $stylesheet := resources.Get "output/css/app.css" }}
|
||||
{{ if not $isDev }}
|
||||
{{ $stylesheet = $stylesheet | minify | fingerprint }}
|
||||
{{ end }}
|
||||
{{ with $stylesheet }}
|
||||
{{ if $isDev }}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ .RelPermalink }}"
|
||||
crossorigin="anonymous" />
|
||||
{{ else }}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ .RelPermalink }}"
|
||||
integrity="{{ .Data.Integrity }}"
|
||||
crossorigin="anonymous" />
|
||||
{{ end }}
|
||||
{{ $.Scratch.Set "stylesheet" . }}
|
||||
{{ end }}
|
||||
|
||||
|
||||
</body>
|
||||
<meta
|
||||
name="description"
|
||||
content="{{ with .Description }}
|
||||
{{ . }}
|
||||
{{ else }}
|
||||
{{ with .Site.Params.description }}{{ . }}{{ end }}
|
||||
{{ end }}
|
||||
" />
|
||||
|
||||
{{ block "scripts" . }}
|
||||
{{- partial "site-scripts.html" . -}}
|
||||
{{ end }}
|
||||
{{ partial "site-manifest.html" . }}
|
||||
{{- partial "head-additions.html" . -}}
|
||||
{{- partial "opengraph/opengraph.html" . -}}
|
||||
{{- template "_internal/schema.html" . -}}
|
||||
{{- partial "opengraph/twitter_cards.html" . -}}
|
||||
|
||||
{{ if hugo.IsProduction }}
|
||||
{{ partial "gtag" . }}
|
||||
{{ end }}
|
||||
|
||||
</head>
|
||||
|
||||
<body
|
||||
class="ma0 sans-serif bg-primary-color-light{{ with getenv "HUGO_ENV" }}
|
||||
{{ . }}
|
||||
{{ end }}">
|
||||
{{ partial "hooks/after-body-start" . }}
|
||||
{{ block "nav" . }}{{ partial "site-nav.html" . }}{{ end }}
|
||||
{{ block "header" . }}{{ end }}
|
||||
<main role="main" class="content-with-sidebar min-vh-100 pb7 pb0-ns">
|
||||
{{ block "main" . }}{{ end }}
|
||||
</main>
|
||||
|
||||
{{ block "footer" . }}{{ partialCached "site-footer.html" . }}{{ end }}
|
||||
|
||||
{{ partial "hooks/before-body-end" . }}
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Generated
+34
-31
@@ -1,38 +1,41 @@
|
||||
{{$classes_box := "ba b--dark-gray bg-light-gray br3 flex flex-column flex-wrap items-center justify-center ph3 pv4 mb4 w-100 w-30-l "}}
|
||||
{{$gtag := .gtag | default "unknown" }}
|
||||
{{ $classes_box := "ba b--dark-gray bg-light-gray br3 flex flex-column flex-wrap items-center justify-center ph3 pv4 mb4 w-100 w-30-l " }}
|
||||
{{ $gtag := .gtag | default "unknown" }}
|
||||
{{ $classes_box := "ba b--dark-gray bg-light-gray br3 flex flex-column flex-wrap items-center justify-center ph3 pv4 mb4 w-100 w-30-l " }}
|
||||
{{ $gtag := .gtag | default "unknown" }}
|
||||
{{ $utmSource := cond (eq $gtag "footer") "hugofooter" "hugohome" }}
|
||||
{{ with .cx.Site.Data.sponsors }}
|
||||
<section class="{{ $.classes_section | default "bg-primary-color-dark b--dark-gray bb bt ph5 pv4 w-100"}}">
|
||||
<div class="center mw9">
|
||||
<section
|
||||
class="{{ $.classes_section | default "bg-primary-color-dark b--dark-gray bb bt ph5 pv4 w-100" }}">
|
||||
<div class="center mw9">
|
||||
<h3 class="b f3 mv0 light-gray">Hugo Sponsors</h3>
|
||||
<div class="flex-ns flex-wrap center justify-between pt3">
|
||||
{{ range .banners }}
|
||||
{{ $banner := . }}
|
||||
{{if .logo}}
|
||||
<div class="{{$classes_box}} o-100"{{ with .bgcolor }} style="background-color: {{ . }};"{{ end}}>
|
||||
{{with .link -}}
|
||||
{{ $url := printf "%s?%s" . (querify "utm_source" "homepage" "utm_medium" "banner" "utm_campaign" "hugosponsor") | safeURL }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | or (eq $.cx.Site.Params.env "production") }}
|
||||
{{ $gtagID := printf "Sponsor %s %s" $banner.name $gtag | title }}
|
||||
<a href="{{ $url }}" onclick="trackOutboundLink({{ printf "'%s', '%s'" $gtagID $url | safeJS }});" class="grow">
|
||||
{{ else }}
|
||||
<a href="{{ $url }}" class="grow">
|
||||
{{ end }}
|
||||
{{- end}}
|
||||
<img src="{{ .logo }}" alt="Logo for {{ .name }}" class="img h3 center" />
|
||||
{{with .link}}</a>{{end}}
|
||||
{{with .copy}}
|
||||
<p class="center lh-copy gray mv1 tc {{$.classes_copy | default "f5 w-70-ns"}}">
|
||||
{{- . -}}
|
||||
</p>
|
||||
{{end}}
|
||||
</div>
|
||||
{{else}}
|
||||
<div class="{{$classes_box}} o-10">
|
||||
<p class="b black tc">Your Logo Here</p>
|
||||
</div>
|
||||
{{end}}
|
||||
{{end}}
|
||||
<div
|
||||
class="{{ $classes_box }} o-100"
|
||||
{{ with .bgcolor }}style="background-color: {{ . }};"{{ end }}>
|
||||
{{ $url := printf "%s?%s" .link (querify "utm_source" $utmSource "utm_medium" "banner" "utm_campaign" (.utm_campaign | default "hugosponsor")) | safeURL }}
|
||||
{{ if eq (getenv "HUGO_ENV") "production" | or (eq $.cx.Site.Params.env "production") }}
|
||||
{{ $gtagID := printf "Sponsor %s %s" .name $gtag | title }}
|
||||
<a
|
||||
href="{{ $url }}"
|
||||
onclick="trackOutboundLink({{ printf "'%s', '%s'" $gtagID $url | safeJS }});"
|
||||
class="grow">
|
||||
<img
|
||||
src="{{ .logo }}"
|
||||
alt="Logo for {{ .name }}"
|
||||
class="img h3 center" />
|
||||
</a>
|
||||
{{ else }}
|
||||
<a href="{{ $url }}" class="grow">
|
||||
<img
|
||||
src="{{ .logo }}"
|
||||
alt="Logo for {{ .name }}"
|
||||
class="img h3 center"
|
||||
/></a>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
{{end}}
|
||||
{{ end }}
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@
|
||||
|
||||
<img src="/images/gopher-side_color.svg" alt="" class="absolute-l bottom-0 dn db-l h4 right-0 z-999"/>
|
||||
|
||||
<div class="bg-primary-color-dark bottom-0 left-0 right-0 dn-l fixed pb3 ph3 pt3 w-100">
|
||||
<div class="bg-primary-color-dark bottom-0 left-0 right-0 dn-l fixed pb3 ph3 pt3 w-100 z-2">
|
||||
{{- partial "nav-mobile.html" . -}}
|
||||
</div>
|
||||
|
||||
|
||||
+6
-15
@@ -3,14 +3,7 @@
|
||||
"version": "1.1.0",
|
||||
"description": "Default Theme for Hugo Sites",
|
||||
"main": "index.js",
|
||||
"homepage": "https://gohugo.io/",
|
||||
"bugs": {
|
||||
"url": "https://github.com/gohugoio/gohugoioTheme/issues"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/gohugoio/gohugoioTheme.git"
|
||||
},
|
||||
"repository": "",
|
||||
"author": "budparr",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
@@ -21,14 +14,13 @@
|
||||
"devDependencies": {
|
||||
"clean-webpack-plugin": "^1.0.0",
|
||||
"clipboard": "^2.0.4",
|
||||
"css-loader": "^4.3.0",
|
||||
"css-loader": "^1.0.1",
|
||||
"docsearch.js": "^2.6.1",
|
||||
"file-loader": "^2.0.0",
|
||||
"glob-all": "^3.1.0",
|
||||
"highlight.js": "^9.13.1",
|
||||
"lazysizes": "^5.2.1",
|
||||
"lazysizes": "^5.3.2",
|
||||
"mini-css-extract-plugin": "^0.4.4",
|
||||
"postcss": "^7.0.36",
|
||||
"postcss": "^7.0.5",
|
||||
"postcss-cssnext": "^3.1.0",
|
||||
"postcss-import": "^12.0.1",
|
||||
"postcss-loader": "^3.0.0",
|
||||
@@ -36,8 +28,7 @@
|
||||
"scrolldir": "^1.4.0",
|
||||
"tachyons": "^4.7.0",
|
||||
"typeface-muli": "0.0.54",
|
||||
"webpack": "^4.44.1",
|
||||
"webpack": "^4.25.1",
|
||||
"webpack-command": "^0.4.2"
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
}
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
<svg width="158" height="160" viewBox="0 0 158 160" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M4.32 103V27.64H17.664V54.616C18.752 54.04 20 53.56 21.408 53.176C22.816 52.728 24.192 52.376 25.536 52.12C26.88 51.864 28.192 51.672 29.472 51.544C30.816 51.352 32.032 51.256 33.12 51.256C35.872 51.256 38.24 51.704 40.224 52.6C42.272 53.432 43.904 54.584 45.12 56.056C46.336 57.464 47.296 59.32 48 61.624C48.704 63.928 49.152 66.328 49.344 68.824C49.6 71.32 49.728 74.296 49.728 77.752C49.728 86.008 48.448 92.376 45.888 96.856C43.328 101.336 39.072 103.576 33.12 103.576C30.368 103.576 27.584 103 24.768 101.848C21.952 100.696 19.616 99.352 17.76 97.816L15.36 103H4.32ZM17.76 88.984C21.024 91.032 24.992 92.056 29.664 92.056C31.136 92.056 32.352 91.64 33.312 90.808C34.272 89.912 35.008 88.376 35.52 86.2C36.032 83.96 36.288 80.984 36.288 77.272C36.288 73.048 36 69.784 35.424 67.48C34.912 65.176 34.208 63.672 33.312 62.968C32.416 62.2 31.2 61.816 29.664 61.816C27.296 61.816 25.152 61.976 23.232 62.296C21.312 62.552 19.488 63.032 17.76 63.736V88.984ZM56.8958 77.272C56.8958 72.856 57.1518 69.176 57.6638 66.232C58.2398 63.224 59.0398 60.76 60.0638 58.84C61.0878 56.856 62.5278 55.352 64.3838 54.328C66.2398 53.304 68.2878 52.6 70.5278 52.216C72.8318 51.832 75.7118 51.64 79.1678 51.64C81.4718 51.64 83.4238 51.704 85.0238 51.832C86.6238 51.896 88.2238 52.088 89.8238 52.408C91.4878 52.664 92.8318 53.08 93.8558 53.656C94.8798 54.168 95.8718 54.904 96.8318 55.864C97.7918 56.76 98.5278 57.88 99.0398 59.224C99.6158 60.504 100.032 62.072 100.288 63.928C100.608 65.72 100.768 67.8 100.768 70.168C100.768 74.648 99.5838 77.912 97.2158 79.96C94.8478 82.008 91.2958 83.032 86.5598 83.032H70.3358C70.3358 85.976 70.7518 88.184 71.5838 89.656C72.4798 91.064 73.5678 91.928 74.8478 92.248C76.1918 92.568 78.2718 92.728 81.0878 92.728C88.9598 92.728 95.1998 92.376 99.8078 91.672V100.792C95.0078 102.584 86.3038 103.48 73.6958 103.48C70.4318 103.48 67.7118 103 65.5358 102.04C63.4238 101.08 61.7278 99.512 60.4478 97.336C59.1678 95.16 58.2398 92.472 57.6638 89.272C57.1518 86.072 56.8958 82.072 56.8958 77.272ZM70.3358 73.336H83.1038C85.9198 73.336 87.3278 72.056 87.3278 69.496C87.3278 66.296 86.8798 64.248 85.9838 63.352C85.1518 62.392 83.1358 61.912 79.9358 61.912C77.8878 61.912 76.3518 62.008 75.3278 62.2C74.3678 62.328 73.4078 62.776 72.4478 63.544C71.5518 64.248 70.9438 65.368 70.6238 66.904C70.3678 68.44 70.2718 70.584 70.3358 73.336ZM108.101 128.92V52.024H119.141L121.445 57.112C123.301 55.64 125.637 54.328 128.453 53.176C131.333 52.024 134.149 51.448 136.901 51.448C139.397 51.448 141.573 51.864 143.429 52.696C145.349 53.528 146.917 54.68 148.133 56.152C149.413 57.624 150.469 59.448 151.301 61.624C152.133 63.8 152.709 66.168 153.029 68.728C153.349 71.288 153.509 74.136 153.509 77.272C153.509 79.896 153.413 82.264 153.221 84.376C153.093 86.488 152.805 88.6 152.357 90.712C151.909 92.76 151.269 94.552 150.437 96.088C149.669 97.624 148.677 99 147.461 100.216C146.309 101.368 144.837 102.264 143.045 102.904C141.253 103.48 139.205 103.768 136.901 103.768C134.597 103.768 132.005 103.48 129.125 102.904C126.245 102.264 123.685 101.464 121.445 100.504V128.92H108.101ZM121.445 91.288C124.773 92.568 128.773 93.208 133.445 93.208C134.981 93.208 136.197 92.856 137.093 92.152C137.989 91.384 138.693 89.848 139.205 87.544C139.781 85.24 140.069 82.008 140.069 77.848C140.069 72.344 139.525 68.504 138.437 66.328C137.349 64.088 135.685 62.968 133.445 62.968C128.709 62.968 124.709 63.992 121.445 66.04V91.288Z" fill="white"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 3.5 KiB |
-1
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 5.6 KiB |
+1
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 402 58"><g fill="#231F20"><path d="M24.6 23c.4 0 .7-.1 1-.2l10-5.4c1-.5 1.3-1.8.8-2.8-.5-1-1.8-1.3-2.8-.8l-9.9 5.4c-1 .3-1.5 1.3-1.3 2.3.3 1 1.3 1.7 2.3 1.5h-.1zM39.8 30.9c.3 0 .7-.1 1-.3L56.7 22c.6-.3 1-1 1-1.7 0-.8-.3-1.5-.9-1.8-.7-.4-1.4-.4-2.1-.1L38.8 27c-.9.4-1.5 1.4-1.2 2.4.2 1 1.2 1.6 2.2 1.5z"/><path d="M81 19.6c-.4-1.2-1.3-2.2-2.4-2.7L61.4 7.7c-2.8-1.4-6.1-1.4-9 0l-1.4.7L39.1 2C36.3.6 33 .6 30.1 2L2.5 16.9c-1.4.6-2.3 1.9-2.5 3.4v15.2c0 .8.4 1.5 1.1 1.8l35 19c2.8 1.4 6.2 1.4 9 0L80 37.1c.7-.3 1.1-1 1.1-1.8v-15c0-.2-.1-.5-.1-.7zm-76.5.9L32 5.6c1.6-.7 3.5-.7 5.2 0L51 13l3.3-1.8c1.7-.7 3.6-.7 5.2 0l17.1 9.2.2.1-.2.1-33.4 18c-1.7.8-3.6.8-5.2 0l-33.5-18-.2-.1h.2zm38.6 32.2c-1.6.7-3.5.7-5.1 0L4.1 34.3v-9.2L36 42.3c2.8 1.4 6.2 1.4 9 0l32-17.2v9L43.1 52.7zM115.7 10.2h18.2c8.7 0 13.1 3.1 13.1 9.1 0 1.9-.5 3.7-1.6 5.2s-2.6 2.6-4.3 3.2c2.2.4 4.2 1.5 5.7 3.1s2.2 3.6 2.2 5.7c0 3.8-1.4 6.7-4.1 8.7-2.7 2-6.6 3-11.8 3h-17.5v-5.4l1.8-.2c.4 0 .8-.2 1.1-.5.2-.4.3-.9.3-1.3V16.1l-3.1-.3v-5.6zm13.1 6.4v9h2.7c3.5 0 5.3-1.6 5.3-4.8 0-2.8-1.7-4.2-5.1-4.2h-2.9zm0 15.1v9.9h3.7c3.8 0 5.8-1.8 5.8-5.2 0-3.1-1.9-4.7-5.7-4.7h-3.8zM180.7 19v22c0 .5 0 .9.3 1.3.2.3.6.4 1 .5l1.5.1v5.2h-11.7v-3.6h-.2c-1.7 3-4.5 4.4-8.5 4.4-3.1 0-5.3-.8-6.8-2.3-1.4-1.6-2.1-4-2.1-7.3V26.2c0-.4-.1-.8-.4-1.1-.2-.3-.6-.5-1-.5l-1.6-.2V19H164v18.4c-.1 1.1.1 2.2.6 3.1.6.8 1.6 1.1 2.5 1 1.1.1 2.2-.4 2.9-1.2.7-1 1.1-2.2 1-3.4V26.3c0-.5-.1-.9-.3-1.3-.3-.3-.7-.4-1.1-.4l-1.3-.2V19h12.4zM198.9 12.3V19h8.1c2.5-1.1 4.3-3.4 5.5-6.7h5.3V19h6.9l-.5 6.3h-6.4v12.3c-.1 1.1.2 2.2.7 3.2.4.5 1.3.8 2.7.8 1.2 0 2.5-.3 3.6-.8l1.4 6.3c-2.5 1.3-5.2 1.9-7.9 1.8-1.3 0-2.5-.1-3.8-.3-.9-.2-1.8-.4-2.7-.8-.7-.3-1.3-.8-1.8-1.4-.4-.5-.8-1-1.1-1.6-.3-.6-.5-1.3-.6-2-.1-.6-.2-1.3-.3-2V25.3h-9v12.3c-.1 1 .1 2.1.6 3.1.5.7 1.4 1.1 2.3 1 1.1 0 2.2-.3 3.2-.8l1.7 6.2c-2.3 1.2-4.9 1.9-7.5 1.8-3.7 0-6.4-.9-7.9-2.6-1.5-1.7-2.3-4.2-2.3-7.6V25.3h-3.9l.8-5.5c3.6-.8 6.2-3.3 7.6-7.4l5.3-.1zM242.7 18.2c2.7-.1 5.3.6 7.5 2.2 2 1.6 3 4.1 2.8 6.6 0 6.9-5.3 10.2-16 10 .1 1.3.7 2.6 1.7 3.5 1.2 1 2.7 1.4 4.2 1.4 2.6-.1 5.2-.9 7.4-2.3l2.6 6.3c-.5.4-1 .7-1.6.9-1.3.6-2.6 1-4 1.4-1.9.5-3.8.7-5.7.7-4.9 0-8.5-1.3-10.8-4-2.3-2.6-3.5-6.2-3.5-10.7-.1-4.1 1.3-8.2 4-11.4 2.7-3 6.5-4.6 11.4-4.6zm2 9.3c0-.7-.2-1.4-.7-1.9-.5-.5-1.2-.7-1.9-.6-1.4 0-2.8.6-3.6 1.8-1 1.3-1.6 2.9-1.6 4.6 5.2.2 7.7-1.2 7.7-3.9h.1zM272.5 25.5c-1.1 0-2.1.5-2.7 1.3-.7.9-1.1 2.1-1 3.3v12.5l5.1.3v5.3h-18.1V43l1.9-.2c.4.1.8-.1 1.1-.4.2-.4.3-.9.3-1.4V26.2c0-.4-.1-.8-.3-1.2-.3-.3-.6-.4-1-.4l-2-.2V19H268v4.4h.1c.7-1.4 1.7-2.7 3-3.6 1.6-1.1 3.5-1.7 5.4-1.6 1.9-.1 3.7.2 5.4.9v11.3l-7.6.4v-3.9c0-.7-.2-1.1-.5-1.2-.4-.1-.9-.2-1.3-.2zM308.7 17.5c-1.2-.3-2.3-.4-3.4-.4-6.1 0-9.2 3.9-9.2 11.8 0 3.8.8 6.8 2.3 9 1.5 2.2 3.9 3.3 7.1 3.4 1.1 0 2.1-.1 3.2-.4.6-.2 1-.8 1-1.5v-3.7l7.3.4v10.5c-3.8 1.7-7.9 2.5-12.1 2.3-6.1 0-10.8-1.6-14.1-4.9-3.3-3.3-5-8.1-5-14.5 0-3.2.5-6.4 1.6-9.4.9-2.5 2.4-4.6 4.4-6.3 1.8-1.4 3.8-2.5 6-3.3 2.2-.7 4.6-1 6.9-1 4.2-.1 8.3.7 12.2 2.4v10l-7.4.4V19c0-.9-.3-1.4-.8-1.5zM323.6 10.2h14.6l7.5 24.8h.2l7.7-24.7h14.6v5.4l-1.8.2c-.5 0-.9.2-1.2.5-.3.4-.4.9-.3 1.3l1.9 24.8 2.9.1v5.6h-15.3v-5.5l1.8-.2c.4.1.8-.1 1-.4.2-.4.3-.9.2-1.3l-.9-16.1h-.1l-7.2 23.5h-7.1l-7-23.1h-.2l-1 17.3 2.8.2v5.6h-15.3v-5.5l1.8-.2c.5 0 .9-.2 1.2-.5.2-.4.4-.9.4-1.4l2-24.6-3.2-.2v-5.6zM385.5 41.6c3.5 0 5.3-1.4 5.3-4.2 0-1.1-.5-2.2-1.4-2.8-1.4-.8-2.9-1.4-4.5-1.8-1.3-.3-2.7-.8-4-1.3-1.2-.5-2.3-1.2-3.4-1.9-1.2-.9-2.2-2-2.8-3.3-.6-1.5-1-3.2-1-4.8-.1-3.4 1.4-6.7 4-8.8 2.7-2.1 6.2-3.1 10.6-3.1 4-.2 8 .6 11.7 2.2v9.3l-7.4.5v-2.9c0-.8-.3-1.3-.8-1.4-1.1-.3-2.2-.4-3.3-.4-1.1 0-2.2.3-3.1.8-.8.6-1.3 1.6-1.2 2.6-.1 1.1.5 2.2 1.4 2.8 1.5.9 3.1 1.6 4.8 2 1.4.4 2.5.8 3.3 1.1.9.4 1.9.8 2.8 1.3 1 .5 1.9 1.2 2.6 2 .7.9 1.2 1.8 1.6 2.9.5 1.3.7 2.6.7 4 .2 3.6-1.3 7-4.1 9.3-2.7 2.2-6.4 3.3-11.2 3.3-4.3.1-8.6-.7-12.6-2.3v-9.8l7.5-.5v3.2c0 .9.3 1.4.9 1.6 1.1.2 2.3.4 3.6.4z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 3.8 KiB |
+1
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 402 58"><g fill="#fff"><path d="M24.6 23c.4 0 .7-.1 1-.2l10-5.4c1-.5 1.3-1.8.8-2.8-.5-1-1.8-1.3-2.8-.8l-9.9 5.4c-1 .3-1.5 1.3-1.3 2.3.3 1 1.3 1.7 2.3 1.5h-.1zM39.8 30.9c.3 0 .7-.1 1-.3L56.7 22c.6-.3 1-1 1-1.7 0-.8-.3-1.5-.9-1.8-.7-.4-1.4-.4-2.1-.1L38.8 27c-.9.4-1.5 1.4-1.2 2.4.2 1 1.2 1.6 2.2 1.5z"/><path d="M81 19.6c-.4-1.2-1.3-2.2-2.4-2.7L61.4 7.7c-2.8-1.4-6.1-1.4-9 0l-1.4.7L39.1 2C36.3.6 33 .6 30.1 2L2.5 16.9c-1.4.6-2.3 1.9-2.5 3.4v15.2c0 .8.4 1.5 1.1 1.8l35 19c2.8 1.4 6.2 1.4 9 0L80 37.1c.7-.3 1.1-1 1.1-1.8v-15c0-.2-.1-.5-.1-.7zm-76.5.9L32 5.6c1.6-.7 3.5-.7 5.2 0L51 13l3.3-1.8c1.7-.7 3.6-.7 5.2 0l17.1 9.2.2.1-.2.1-33.4 18c-1.7.8-3.6.8-5.2 0l-33.5-18-.2-.1h.2zm38.6 32.2c-1.6.7-3.5.7-5.1 0L4.1 34.3v-9.2L36 42.3c2.8 1.4 6.2 1.4 9 0l32-17.2v9L43.1 52.7zM115.7 10.2h18.2c8.7 0 13.1 3.1 13.1 9.1 0 1.9-.5 3.7-1.6 5.2s-2.6 2.6-4.3 3.2c2.2.4 4.2 1.5 5.7 3.1s2.2 3.6 2.2 5.7c0 3.8-1.4 6.7-4.1 8.7-2.7 2-6.6 3-11.8 3h-17.5v-5.4l1.8-.2c.4 0 .8-.2 1.1-.5.2-.4.3-.9.3-1.3V16.1l-3.1-.3v-5.6zm13.1 6.4v9h2.7c3.5 0 5.3-1.6 5.3-4.8 0-2.8-1.7-4.2-5.1-4.2h-2.9zm0 15.1v9.9h3.7c3.8 0 5.8-1.8 5.8-5.2 0-3.1-1.9-4.7-5.7-4.7h-3.8zM180.7 19v22c0 .5 0 .9.3 1.3.2.3.6.4 1 .5l1.5.1v5.2h-11.7v-3.6h-.2c-1.7 3-4.5 4.4-8.5 4.4-3.1 0-5.3-.8-6.8-2.3-1.4-1.6-2.1-4-2.1-7.3V26.2c0-.4-.1-.8-.4-1.1-.2-.3-.6-.5-1-.5l-1.6-.2V19H164v18.4c-.1 1.1.1 2.2.6 3.1.6.8 1.6 1.1 2.5 1 1.1.1 2.2-.4 2.9-1.2.7-1 1.1-2.2 1-3.4V26.3c0-.5-.1-.9-.3-1.3-.3-.3-.7-.4-1.1-.4l-1.3-.2V19h12.4zM198.9 12.3V19h8.1c2.5-1.1 4.3-3.4 5.5-6.7h5.3V19h6.9l-.5 6.3h-6.4v12.3c-.1 1.1.2 2.2.7 3.2.4.5 1.3.8 2.7.8 1.2 0 2.5-.3 3.6-.8l1.4 6.3c-2.5 1.3-5.2 1.9-7.9 1.8-1.3 0-2.5-.1-3.8-.3-.9-.2-1.8-.4-2.7-.8-.7-.3-1.3-.8-1.8-1.4-.4-.5-.8-1-1.1-1.6-.3-.6-.5-1.3-.6-2-.1-.6-.2-1.3-.3-2V25.3h-9v12.3c-.1 1 .1 2.1.6 3.1.5.7 1.4 1.1 2.3 1 1.1 0 2.2-.3 3.2-.8l1.7 6.2c-2.3 1.2-4.9 1.9-7.5 1.8-3.7 0-6.4-.9-7.9-2.6-1.5-1.7-2.3-4.2-2.3-7.6V25.3h-3.9l.8-5.5c3.6-.8 6.2-3.3 7.6-7.4l5.3-.1zM242.7 18.2c2.7-.1 5.3.6 7.5 2.2 2 1.6 3 4.1 2.8 6.6 0 6.9-5.3 10.2-16 10 .1 1.3.7 2.6 1.7 3.5 1.2 1 2.7 1.4 4.2 1.4 2.6-.1 5.2-.9 7.4-2.3l2.6 6.3c-.5.4-1 .7-1.6.9-1.3.6-2.6 1-4 1.4-1.9.5-3.8.7-5.7.7-4.9 0-8.5-1.3-10.8-4-2.3-2.6-3.5-6.2-3.5-10.7-.1-4.1 1.3-8.2 4-11.4 2.7-3 6.5-4.6 11.4-4.6zm2 9.3c0-.7-.2-1.4-.7-1.9-.5-.5-1.2-.7-1.9-.6-1.4 0-2.8.6-3.6 1.8-1 1.3-1.6 2.9-1.6 4.6 5.2.2 7.7-1.2 7.7-3.9h.1zM272.5 25.5c-1.1 0-2.1.5-2.7 1.3-.7.9-1.1 2.1-1 3.3v12.5l5.1.3v5.3h-18.1V43l1.9-.2c.4.1.8-.1 1.1-.4.2-.4.3-.9.3-1.4V26.2c0-.4-.1-.8-.3-1.2-.3-.3-.6-.4-1-.4l-2-.2V19H268v4.4h.1c.7-1.4 1.7-2.7 3-3.6 1.6-1.1 3.5-1.7 5.4-1.6 1.9-.1 3.7.2 5.4.9v11.3l-7.6.4v-3.9c0-.7-.2-1.1-.5-1.2-.4-.1-.9-.2-1.3-.2zM308.7 17.5c-1.2-.3-2.3-.4-3.4-.4-6.1 0-9.2 3.9-9.2 11.8 0 3.8.8 6.8 2.3 9 1.5 2.2 3.9 3.3 7.1 3.4 1.1 0 2.1-.1 3.2-.4.6-.2 1-.8 1-1.5v-3.7l7.3.4v10.5c-3.8 1.7-7.9 2.5-12.1 2.3-6.1 0-10.8-1.6-14.1-4.9-3.3-3.3-5-8.1-5-14.5 0-3.2.5-6.4 1.6-9.4.9-2.5 2.4-4.6 4.4-6.3 1.8-1.4 3.8-2.5 6-3.3 2.2-.7 4.6-1 6.9-1 4.2-.1 8.3.7 12.2 2.4v10l-7.4.4V19c0-.9-.3-1.4-.8-1.5zM323.6 10.2h14.6l7.5 24.8h.2l7.7-24.7h14.6v5.4l-1.8.2c-.5 0-.9.2-1.2.5-.3.4-.4.9-.3 1.3l1.9 24.8 2.9.1v5.6h-15.3v-5.5l1.8-.2c.4.1.8-.1 1-.4.2-.4.3-.9.2-1.3l-.9-16.1h-.1l-7.2 23.5h-7.1l-7-23.1h-.2l-1 17.3 2.8.2v5.6h-15.3v-5.5l1.8-.2c.5 0 .9-.2 1.2-.5.2-.4.4-.9.4-1.4l2-24.6-3.2-.2v-5.6zM385.5 41.6c3.5 0 5.3-1.4 5.3-4.2 0-1.1-.5-2.2-1.4-2.8-1.4-.8-2.9-1.4-4.5-1.8-1.3-.3-2.7-.8-4-1.3-1.2-.5-2.3-1.2-3.4-1.9-1.2-.9-2.2-2-2.8-3.3-.6-1.5-1-3.2-1-4.8-.1-3.4 1.4-6.7 4-8.8 2.7-2.1 6.2-3.1 10.6-3.1 4-.2 8 .6 11.7 2.2v9.3l-7.4.5v-2.9c0-.8-.3-1.3-.8-1.4-1.1-.3-2.2-.4-3.3-.4-1.1 0-2.2.3-3.1.8-.8.6-1.3 1.6-1.2 2.6-.1 1.1.5 2.2 1.4 2.8 1.5.9 3.1 1.6 4.8 2 1.4.4 2.5.8 3.3 1.1.9.4 1.9.8 2.8 1.3 1 .5 1.9 1.2 2.6 2 .7.9 1.2 1.8 1.6 2.9.5 1.3.7 2.6.7 4 .2 3.6-1.3 7-4.1 9.3-2.7 2.2-6.4 3.3-11.2 3.3-4.3.1-8.6-.7-12.6-2.3v-9.8l7.5-.5v3.2c0 .9.3 1.4.9 1.6 1.1.2 2.3.4 3.6.4z"/></g></svg>
|
||||
|
After Width: | Height: | Size: 3.8 KiB |
Generated
-1
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 6.7 KiB |
+4
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 8.0 KiB |
@@ -1 +1 @@
|
||||
# github.com/gohugoio/gohugoioTheme v0.0.0-20220228085601-7cfbda06d135
|
||||
# github.com/gohugoio/gohugoioTheme v0.0.0-20230109120406-12694c4a9456
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
---
|
||||
linktitle: ""
|
||||
description: ""
|
||||
publishdate: ""
|
||||
lastmod: ""
|
||||
categories: [functions]
|
||||
tags: []
|
||||
ns: ""
|
||||
signature: []
|
||||
workson: []
|
||||
hugoversion: ""
|
||||
aliases: []
|
||||
relatedfuncs: []
|
||||
toc: false
|
||||
deprecated: false
|
||||
---
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
baseURL = "https://gohugo.io/"
|
||||
paginate = 100
|
||||
defaultContentLanguage = "en"
|
||||
enableEmoji = true
|
||||
timeZone = "Europe/Oslo"
|
||||
# Set the unicode character used for the "return" link in page footnotes.
|
||||
footnotereturnlinkcontents = "↩"
|
||||
languageCode = "en-us"
|
||||
title = "Hugo"
|
||||
|
||||
ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
|
||||
|
||||
|
||||
googleAnalytics = "UA-7131036-4"
|
||||
|
||||
pluralizeListTitles = false
|
||||
|
||||
# We do redirects via Netlify's _redirects file, generated by Hugo (see "outputs" below).
|
||||
disableAliases = true
|
||||
|
||||
[minify]
|
||||
[minify.tdewolff]
|
||||
[minify.tdewolff.css]
|
||||
[minify.tdewolff.html]
|
||||
keepWhitespace = true
|
||||
|
||||
[module]
|
||||
[module.hugoVersion]
|
||||
min = "0.56.0"
|
||||
[[module.imports]]
|
||||
path = "github.com/gohugoio/gohugoioTheme"
|
||||
|
||||
[outputs]
|
||||
home = [ "HTML", "RSS", "REDIR", "HEADERS" ]
|
||||
section = [ "HTML", "RSS"]
|
||||
|
||||
[mediaTypes]
|
||||
[mediaTypes."text/netlify"]
|
||||
delimiter = ""
|
||||
|
||||
[outputFormats]
|
||||
[outputFormats.REDIR]
|
||||
mediatype = "text/netlify"
|
||||
baseName = "_redirects"
|
||||
isPlainText = true
|
||||
notAlternative = true
|
||||
[outputFormats.HEADERS]
|
||||
mediatype = "text/netlify"
|
||||
baseName = "_headers"
|
||||
isPlainText = true
|
||||
notAlternative = true
|
||||
|
||||
[related]
|
||||
|
||||
threshold = 80
|
||||
includeNewer = true
|
||||
toLower = false
|
||||
|
||||
[[related.indices]]
|
||||
name = "keywords"
|
||||
weight = 100
|
||||
[[related.indices]]
|
||||
name = "date"
|
||||
weight = 10
|
||||
pattern = "2006"
|
||||
|
||||
[social]
|
||||
twitter = "GoHugoIO"
|
||||
|
||||
|
||||
[imaging]
|
||||
# See https://github.com/disintegration/imaging
|
||||
# CatmullRom is a sharp bicubic filter which should fit the docs site well with its many screenshots.
|
||||
# Note that you can also set this per image processing.
|
||||
resampleFilter = "CatmullRom"
|
||||
|
||||
# Default JPEG quality setting. Default is 75.
|
||||
quality = 75
|
||||
|
||||
anchor = "smart"
|
||||
@@ -1,19 +1,28 @@
|
||||
baseURL = "https://gohugo.io/"
|
||||
paginate = 100
|
||||
defaultContentLanguage = "en"
|
||||
enableEmoji = true
|
||||
# Set the unicode character used for the "return" link in page footnotes.
|
||||
footnotereturnlinkcontents = "↩"
|
||||
googleAnalytics = "G-MBZGKNMDWC"
|
||||
ignoreErrors = ["error-remote-getjson", "error-missing-instagram-accesstoken"]
|
||||
languageCode = "en-us"
|
||||
title = "Hugo"
|
||||
|
||||
googleAnalytics = "UA-7131036-4"
|
||||
|
||||
paginate = 100
|
||||
pluralizeListTitles = false
|
||||
timeZone = "Europe/Oslo"
|
||||
title = "Hugo"
|
||||
|
||||
# We do redirects via Netlify's _redirects file, generated by Hugo (see "outputs" below).
|
||||
disableAliases = true
|
||||
|
||||
[minify]
|
||||
[minify.tdewolff]
|
||||
[minify.tdewolff.html]
|
||||
keepWhitespace = true
|
||||
|
||||
[module]
|
||||
[module.hugoVersion]
|
||||
min = "0.56.0"
|
||||
[[module.imports]]
|
||||
path = "github.com/gohugoio/gohugoioTheme"
|
||||
|
||||
[outputs]
|
||||
home = [ "HTML", "RSS", "REDIR", "HEADERS" ]
|
||||
section = [ "HTML", "RSS"]
|
||||
@@ -48,13 +57,10 @@ maxAge = "1440h"
|
||||
dir = ":resourceDir/_gen"
|
||||
maxAge = -1
|
||||
|
||||
|
||||
[related]
|
||||
|
||||
threshold = 80
|
||||
includeNewer = true
|
||||
toLower = false
|
||||
|
||||
[[related.indices]]
|
||||
name = "keywords"
|
||||
weight = 100
|
||||
@@ -66,25 +72,13 @@ pattern = "2006"
|
||||
[social]
|
||||
twitter = "GoHugoIO"
|
||||
|
||||
|
||||
# MARKDOWN
|
||||
## Configuration for BlackFriday markdown parser: https://github.com/russross/blackfriday
|
||||
[blackfriday]
|
||||
plainIDAnchors = true
|
||||
# See https://github.com/gohugoio/hugo/issues/2424
|
||||
hrefTargetBlank = false
|
||||
angledQuotes = false
|
||||
latexDashes = true
|
||||
|
||||
[imaging]
|
||||
# See https://github.com/disintegration/imaging
|
||||
# CatmullRom is a sharp bicubic filter which should fit the docs site well with its many screenshots.
|
||||
# Note that you can also set this per image processing.
|
||||
resampleFilter = "CatmullRom"
|
||||
|
||||
# Default JPEG quality setting. Default is 75.
|
||||
quality = 75
|
||||
|
||||
anchor = "smart"
|
||||
|
||||
[taxonomies]
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
|
||||
[en]
|
||||
contentDir = "content/en"
|
||||
languageName = "English"
|
||||
weight = 1
|
||||
|
||||
[zh]
|
||||
contentDir = "content/zh"
|
||||
languageName = "中文"
|
||||
weight = 2
|
||||
[en]
|
||||
contentDir = "content/en"
|
||||
languageName = "English"
|
||||
weight = 1
|
||||
|
||||
@@ -1,114 +1,102 @@
|
||||
[[docs]]
|
||||
name = "About Hugo"
|
||||
weight = 1
|
||||
weight = 10
|
||||
identifier = "about"
|
||||
url = "/about/"
|
||||
|
||||
[[docs]]
|
||||
name = "Installation"
|
||||
weight = 20
|
||||
identifier = "installation"
|
||||
url = "/installation/"
|
||||
|
||||
[[docs]]
|
||||
name = "Getting Started"
|
||||
weight = 5
|
||||
weight = 30
|
||||
identifier = "getting-started"
|
||||
url = "/getting-started/"
|
||||
|
||||
[[docs]]
|
||||
name = "Hugo Modules"
|
||||
weight = 15
|
||||
weight = 40
|
||||
identifier = "modules"
|
||||
post = "break"
|
||||
url = "/hugo-modules/"
|
||||
|
||||
# Core Menus
|
||||
# Core menus
|
||||
|
||||
[[docs]]
|
||||
name = "Content Management"
|
||||
weight = 20
|
||||
weight = 50
|
||||
identifier = "content-management"
|
||||
post = "expanded"
|
||||
url = "/content-management/"
|
||||
|
||||
[[docs]]
|
||||
name = "Templates"
|
||||
weight = 25
|
||||
weight = 60
|
||||
identifier = "templates"
|
||||
|
||||
url = "/templates/"
|
||||
|
||||
[[docs]]
|
||||
name = "Functions"
|
||||
weight = 30
|
||||
weight = 70
|
||||
identifier = "functions"
|
||||
url = "/functions/"
|
||||
|
||||
[[docs]]
|
||||
name = "Variables"
|
||||
weight = 35
|
||||
weight = 80
|
||||
identifier = "variables"
|
||||
url = "/variables/"
|
||||
|
||||
[[docs]]
|
||||
name = "Hugo Pipes"
|
||||
weight = 36
|
||||
weight = 90
|
||||
identifier = "pipes"
|
||||
url = "/hugo-pipes/"
|
||||
|
||||
[[docs]]
|
||||
name = "CLI"
|
||||
weight = 40
|
||||
weight = 100
|
||||
post = "break"
|
||||
identifier = "commands"
|
||||
url = "/commands/"
|
||||
|
||||
|
||||
|
||||
# LOW LEVEL ITEMS
|
||||
|
||||
# Low level items
|
||||
|
||||
[[docs]]
|
||||
name = "Troubleshooting"
|
||||
weight = 60
|
||||
weight = 110
|
||||
identifier = "troubleshooting"
|
||||
url = "/troubleshooting/"
|
||||
|
||||
[[docs]]
|
||||
name = "Tools"
|
||||
weight = 70
|
||||
weight = 120
|
||||
identifier = "tools"
|
||||
url = "/tools/"
|
||||
|
||||
[[docs]]
|
||||
name = "Hosting & Deployment"
|
||||
weight = 80
|
||||
weight = 130
|
||||
identifier = "hosting-and-deployment"
|
||||
url = "/hosting-and-deployment/"
|
||||
|
||||
[[docs]]
|
||||
name = "Contribute"
|
||||
weight = 100
|
||||
weight = 140
|
||||
post = "break"
|
||||
identifier = "contribute"
|
||||
url = "/contribute/"
|
||||
|
||||
#[[docs]]
|
||||
# name = "Tags"
|
||||
# weight = 120
|
||||
# identifier = "tags"
|
||||
# url = "/tags/"
|
||||
|
||||
|
||||
# [[docs]]
|
||||
# name = "Categories"
|
||||
# weight = 140
|
||||
# identifier = "categories"
|
||||
# url = "/categories/"
|
||||
|
||||
######## QUICKLINKS
|
||||
|
||||
[[quicklinks]]
|
||||
name = "Fundamentals"
|
||||
weight = 1
|
||||
identifier = "fundamentals"
|
||||
url = "/tags/fundamentals/"
|
||||
|
||||
|
||||
|
||||
[[quicklinks]]
|
||||
name = "Fundamentals"
|
||||
weight = 1
|
||||
identifier = "fundamentals"
|
||||
url = "/tags/fundamentals/"
|
||||
|
||||
######## GLOBAL ITEMS TO BE SHARED WITH THE HUGO SITES
|
||||
|
||||
@@ -118,37 +106,37 @@
|
||||
identifier = "news"
|
||||
url = "/news/"
|
||||
|
||||
[[global]]
|
||||
name = "Docs"
|
||||
weight = 5
|
||||
identifier = "docs"
|
||||
url = "/documentation/"
|
||||
[[global]]
|
||||
name = "Docs"
|
||||
weight = 5
|
||||
identifier = "docs"
|
||||
url = "/documentation/"
|
||||
|
||||
[[global]]
|
||||
name = "Themes"
|
||||
weight = 10
|
||||
identifier = "themes"
|
||||
url = "https://themes.gohugo.io/"
|
||||
[[global]]
|
||||
name = "Themes"
|
||||
weight = 10
|
||||
identifier = "themes"
|
||||
url = "https://themes.gohugo.io/"
|
||||
|
||||
[[global]]
|
||||
name = "Showcase"
|
||||
weight = 20
|
||||
identifier = "showcase"
|
||||
url = "/showcase/"
|
||||
[[global]]
|
||||
name = "Showcase"
|
||||
weight = 20
|
||||
identifier = "showcase"
|
||||
url = "/showcase/"
|
||||
|
||||
# Anything with a weight > 100 gets an external icon
|
||||
[[global]]
|
||||
name = "Community"
|
||||
weight = 150
|
||||
icon = true
|
||||
identifier = "community"
|
||||
post = "external"
|
||||
url = "https://discourse.gohugo.io/"
|
||||
# Anything with a weight > 100 gets an external icon
|
||||
|
||||
[[global]]
|
||||
name = "Community"
|
||||
weight = 150
|
||||
icon = true
|
||||
identifier = "community"
|
||||
post = "external"
|
||||
url = "https://discourse.gohugo.io/"
|
||||
|
||||
[[global]]
|
||||
name = "GitHub"
|
||||
weight = 200
|
||||
identifier = "github"
|
||||
post = "external"
|
||||
url = "https://github.com/gohugoio/hugo"
|
||||
[[global]]
|
||||
name = "GitHub"
|
||||
weight = 200
|
||||
identifier = "github"
|
||||
post = "external"
|
||||
url = "https://github.com/gohugoio/hugo"
|
||||
|
||||
@@ -1,121 +0,0 @@
|
||||
|
||||
# Chinese menus
|
||||
|
||||
[[docs]]
|
||||
name = "关于 Hugo"
|
||||
weight = 1
|
||||
identifier = "about"
|
||||
url = "/zh/about/"
|
||||
|
||||
[[docs]]
|
||||
name = "入门"
|
||||
weight = 5
|
||||
identifier = "getting-started"
|
||||
url = "/zh/getting-started/"
|
||||
|
||||
[[docs]]
|
||||
name = "主题"
|
||||
weight = 15
|
||||
identifier = "themes"
|
||||
post = "break"
|
||||
url = "/zh/themes/"
|
||||
|
||||
# Core languages.zh.menus
|
||||
|
||||
[[docs]]
|
||||
name = "内容管理"
|
||||
weight = 20
|
||||
identifier = "content-management"
|
||||
post = "expanded"
|
||||
url = "/zh/content-management/"
|
||||
|
||||
[[docs]]
|
||||
name = "模板"
|
||||
weight = 25
|
||||
identifier = "templates"
|
||||
url = "/zh/templates/"
|
||||
|
||||
[[docs]]
|
||||
name = "函数"
|
||||
weight = 30
|
||||
identifier = "functions"
|
||||
url = "/zh/functions/"
|
||||
|
||||
[[docs]]
|
||||
name = "变量"
|
||||
weight = 35
|
||||
identifier = "variables"
|
||||
url = "/zh/variables/"
|
||||
|
||||
[[docs]]
|
||||
name = "CLI"
|
||||
weight = 40
|
||||
post = "break"
|
||||
identifier = "commands"
|
||||
url = "/commands/"
|
||||
|
||||
# LOW LEVEL ITEMS
|
||||
[[docs]]
|
||||
name = "故障排除"
|
||||
weight = 60
|
||||
identifier = "troubleshooting"
|
||||
url = "/zh/troubleshooting/"
|
||||
|
||||
[[docs]]
|
||||
name = "工具"
|
||||
weight = 70
|
||||
identifier = "tools"
|
||||
url = "/zh/tools/"
|
||||
|
||||
[[docs]]
|
||||
name = "托管与部署"
|
||||
weight = 80
|
||||
identifier = "hosting-and-deployment"
|
||||
url = "/zh/hosting-and-deployment/"
|
||||
|
||||
[[docs]]
|
||||
name = "贡献"
|
||||
weight = 100
|
||||
post = "break"
|
||||
identifier = "contribute"
|
||||
url = "/zh/contribute/"
|
||||
|
||||
[[global]]
|
||||
name = "新闻"
|
||||
weight = 1
|
||||
identifier = "news"
|
||||
url = "/zh/news/"
|
||||
|
||||
[[global]]
|
||||
name = "文档"
|
||||
weight = 5
|
||||
identifier = "docs"
|
||||
url = "/zh/documentation/"
|
||||
|
||||
[[global]]
|
||||
name = "主题"
|
||||
weight = 10
|
||||
identifier = "themes"
|
||||
url = "https://themes.gohugo.io/"
|
||||
|
||||
[[global]]
|
||||
name = "作品展示"
|
||||
weight = 20
|
||||
identifier = "showcase"
|
||||
url = "/zh/showcase/"
|
||||
|
||||
# Anything with a weight > 100 gets an external icon
|
||||
[[global]]
|
||||
name = "社区"
|
||||
weight = 150
|
||||
icon = true
|
||||
identifier = "community"
|
||||
post = "external"
|
||||
url = "https://discourse.gohugo.io/"
|
||||
|
||||
[[global]]
|
||||
name = "GitHub"
|
||||
weight = 200
|
||||
identifier = "github"
|
||||
post = "external"
|
||||
url = "https://github.com/gohugoio/hugo"
|
||||
@@ -1,6 +1,6 @@
|
||||
# Config for production
|
||||
|
||||
# This is turned off in development as it is relatively slow.
|
||||
# This is turned off in development as it is relatively slow.
|
||||
# This is needed to get accurate lastMod and Git commit info
|
||||
# on the docs pages.
|
||||
enableGitInfo = true
|
||||
@@ -27,14 +27,13 @@ This has many benefits. The most noticeable is performance. HTTP servers are *ve
|
||||
|
||||
## More on Static Site Generators
|
||||
|
||||
* ["An Introduction to Static Site Generators", David Walsh][]
|
||||
* ["An Introduction to Static Site Generators", David Walsh]
|
||||
* ["Hugo vs. WordPress page load speed comparison: Hugo leaves WordPress in its dust", GettingThingsTech][hugovwordpress]
|
||||
* ["Static Site Generators", O'Reilly][]
|
||||
* [StaticGen: Top Open-Source Static Site Generators (GitHub Stars)][]
|
||||
* ["Top 10 Static Website Generators", Netlify blog][]
|
||||
* ["Static Site Generators", O'Reilly]
|
||||
* [StaticGen: Top Open-Source Static Site Generators (GitHub Stars)]
|
||||
* ["Top 10 Static Website Generators", Netlify blog]
|
||||
* ["The Resurgence of Static", dotCMS][dotcms]
|
||||
|
||||
|
||||
["An Introduction to Static Site Generators", David Walsh]: https://davidwalsh.name/introduction-static-site-generators
|
||||
["Static Site Generators", O'Reilly]: https://github.com/gohugoio/hugoDocs/files/1242701/static-site-generators.pdf
|
||||
["Top 10 Static Website Generators", Netlify blog]: https://www.netlify.com/blog/2016/05/02/top-ten-static-website-generators/
|
||||
|
||||
@@ -17,43 +17,42 @@ toc: true
|
||||
|
||||
## General
|
||||
|
||||
* [Extremely fast][] build times (< 1 ms per page)
|
||||
* [Extremely fast] build times (< 1 ms per page)
|
||||
* Completely cross platform, with [easy installation][install] on macOS, Linux, Windows, and more
|
||||
* Renders changes on the fly with [LiveReload][] as you develop
|
||||
* [Powerful theming][]
|
||||
* Renders changes on the fly with [LiveReload] as you develop
|
||||
* [Powerful theming]
|
||||
* [Host your site anywhere][hostanywhere]
|
||||
|
||||
## Organization
|
||||
|
||||
* Straightforward [organization for your projects][], including website sections
|
||||
* Customizable [URLs][]
|
||||
* Support for configurable [taxonomies][], including categories and tags
|
||||
* [Sort content][] as you desire through powerful template [functions][]
|
||||
* Automatic [table of contents][] generation
|
||||
* [Dynamic menu][] creation
|
||||
* [Pretty URLs][] support
|
||||
* [Permalink][] pattern support
|
||||
* Redirects via [aliases][]
|
||||
* Straightforward [organization for your projects], including website sections
|
||||
* Customizable [URLs]
|
||||
* Support for configurable [taxonomies], including categories and tags
|
||||
* [Sort content] as you desire through powerful template [functions]
|
||||
* Automatic [table of contents] generation
|
||||
* [Dynamic menu] creation
|
||||
* [Pretty URLs] support
|
||||
* [Permalink] pattern support
|
||||
* Redirects via [aliases]
|
||||
|
||||
## Content
|
||||
|
||||
* Native Markdown and Emacs Org-Mode support, as well as other languages via *external helpers* (see [supported formats][])
|
||||
* TOML, YAML, and JSON metadata support in [front matter][]
|
||||
* Customizable [homepage][]
|
||||
* Multiple [content types][]
|
||||
* Automatic and user defined [content summaries][]
|
||||
* [Shortcodes][] to enable rich content inside of Markdown
|
||||
* Native Markdown and Emacs Org-Mode support, as well as other languages via *external helpers* (see [supported formats])
|
||||
* TOML, YAML, and JSON metadata support in [front matter]
|
||||
* Customizable [homepage]
|
||||
* Multiple [content types]
|
||||
* Automatic and user defined [content summaries]
|
||||
* [Shortcodes] to enable rich content inside of Markdown
|
||||
* ["Minutes to Read"][pagevars] functionality
|
||||
* ["WordCount"][pagevars] functionality
|
||||
|
||||
## Additional Features
|
||||
|
||||
* Integrated [Disqus][] comment support
|
||||
* Integrated [Google Analytics][] support
|
||||
* Automatic [RSS][] creation
|
||||
* Support for [Go][] HTML templates
|
||||
* [Syntax highlighting][] powered by [Chroma][]
|
||||
|
||||
* Integrated [Disqus] comment support
|
||||
* Integrated [Google Analytics] support
|
||||
* Automatic [RSS] creation
|
||||
* Support for [Go] HTML templates
|
||||
* [Syntax highlighting] powered by [Chroma]
|
||||
|
||||
[aliases]: /content-management/urls/#aliases
|
||||
[Chroma]: https://github.com/alecthomas/chroma
|
||||
@@ -64,11 +63,11 @@ toc: true
|
||||
[Extremely fast]: https://github.com/bep/hugo-benchmark
|
||||
[front matter]: /content-management/front-matter/
|
||||
[functions]: /functions/
|
||||
[Go]: https://golang.org/pkg/html/template/
|
||||
[Go]: https://pkg.go.dev/html/template
|
||||
[Google Analytics]: https://google-analytics.com/
|
||||
[homepage]: /templates/homepage/
|
||||
[hostanywhere]: /hosting-and-deployment/
|
||||
[install]: /getting-started/installing/
|
||||
[install]: /installation/
|
||||
[LiveReload]: /getting-started/usage/
|
||||
[organization for your projects]: /getting-started/directory-structure/
|
||||
[pagevars]: /variables/page/
|
||||
|
||||
@@ -16,7 +16,6 @@ aliases: [/privacy/,/gdpr/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
|
||||
General Data Protection Regulation ([GDPR](https://en.wikipedia.org/wiki/General_Data_Protection_Regulation)) is a regulation in EU law on data protection and privacy for all individuals within the European Union and the European Economic Area. It became enforceable on 25 May 2018.
|
||||
|
||||
**Hugo is a static site generator. By using Hugo you are already standing on very solid ground. Static HTML files on disk are much easier to reason about compared to server and database driven web sites.**
|
||||
@@ -95,6 +94,7 @@ useSessionStorage
|
||||
{{% warning %}}
|
||||
`useSessionStorage` is not supported when using Google Analytics v4 (gtag.js).
|
||||
{{% /warning %}}
|
||||
|
||||
### Instagram
|
||||
|
||||
simple
|
||||
@@ -116,8 +116,7 @@ enableDNT
|
||||
simple
|
||||
: If simple mode is enabled, a static and no-JS version of a tweet will be built.
|
||||
|
||||
|
||||
**Note:** If you use the _simple mode_ for Twitter, you may want to disable the inlines styles provided by Hugo:
|
||||
**Note:** If you use the _simple mode_ for Twitter, you may want to disable the inline styles provided by Hugo:
|
||||
|
||||
{{< code-toggle file="config">}}
|
||||
[services]
|
||||
@@ -137,4 +136,3 @@ enableDNT
|
||||
|
||||
simple
|
||||
: If simple mode is enabled, the video thumbnail is fetched from Vimeo's servers and it is overlayed with a play button. If the user clicks to play the video, it will open in a new tab directly on Vimeo's website.
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ menu:
|
||||
weight: 4
|
||||
weight: 5
|
||||
sections_weight: 5
|
||||
draft: false
|
||||
aliases: [/security/]
|
||||
toc: true
|
||||
---
|
||||
@@ -28,11 +27,8 @@ But when developing and building your site, the runtime is the `hugo` executable
|
||||
* User-defined components have read-only access to the filesystem.
|
||||
* We shell out to some external binaries to support [Asciidoctor](/content-management/formats/#list-of-content-formats) and similar, but those binaries and their flags are predefined and disabled by default (see [Security Policy](#security-policy)). General functions to run arbitrary external OS commands have been [discussed](https://github.com/gohugoio/hugo/issues/796), but not implemented because of security concerns.
|
||||
|
||||
|
||||
## Security Policy
|
||||
|
||||
{{< new-in "0.91.0" >}}
|
||||
|
||||
Hugo has a built-in security policy that restricts access to [os/exec](https://pkg.go.dev/os/exec), remote communication and similar.
|
||||
|
||||
The default configuration is listed below. Any build using features not in the allow list of the security policy will fail with a detailed message about what needs to be done. Most of these settings are allow lists (string or slice, [Regular Expressions](https://pkg.go.dev/regexp) or `none` which matches nothing).
|
||||
@@ -41,7 +37,7 @@ The default configuration is listed below. Any build using features not in the a
|
||||
|
||||
Note that these and other config settings in Hugo can be overridden by the OS environment. If you want to block all remote HTTP fetching of data:
|
||||
|
||||
```
|
||||
```txt
|
||||
HUGO_SECURITY_HTTP_URLS=none hugo
|
||||
```
|
||||
|
||||
@@ -57,7 +53,7 @@ These are the security threats as defined by [OWASP](https://en.wikipedia.org/wi
|
||||
|
||||
For HTML output, this is the core security model:
|
||||
|
||||
https://golang.org/pkg/html/template/#hdr-Security_Model
|
||||
<https://pkg.go.dev/html/template#hdr-Security_Model>
|
||||
|
||||
In short:
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ aliases: [/overview/introduction/,/about/why-i-built-hugo/]
|
||||
toc: true
|
||||
---
|
||||
|
||||
Hugo is a general-purpose website framework. Technically speaking, Hugo is a [static site generator][]. Unlike systems that dynamically build a page with each visitor request, Hugo builds pages when you create or update your content. Since websites are viewed far more often than they are edited, Hugo is designed to provide an optimal viewing experience for your website's end users and an ideal writing experience for website authors.
|
||||
Hugo is a general-purpose website framework. Technically speaking, Hugo is a [static site generator]. Unlike systems that dynamically build a page with each visitor request, Hugo builds pages when you create or update your content. Since websites are viewed far more often than they are edited, Hugo is designed to provide an optimal viewing experience for your website's end users and an ideal writing experience for website authors.
|
||||
|
||||
Websites built with Hugo are extremely fast and secure. Hugo sites can be hosted anywhere, including [Netlify][], [Heroku][], [GoDaddy][], [DreamHost][], [GitHub Pages][], [GitLab Pages][], [Surge][], [Firebase][], [Google Cloud Storage][], [Amazon S3][], [Rackspace][], [Azure][], and [CloudFront][] and work well with CDNs. Hugo sites run without the need for a database or dependencies on expensive runtimes like Ruby, Python, or PHP.
|
||||
Websites built with Hugo are extremely fast and secure. Hugo sites can be hosted anywhere, including [Netlify], [Heroku], [GoDaddy], [DreamHost], [GitHub Pages], [GitLab Pages], [Surge], [Firebase], [Google Cloud Storage], [Amazon S3], [Rackspace], [Azure], and [CloudFront] and work well with CDNs. Hugo sites run without the need for a database or dependencies on expensive runtimes like Ruby, Python, or PHP.
|
||||
|
||||
We think of Hugo as the ideal website creation tool with nearly instant build times, able to rebuild whenever a change is made.
|
||||
|
||||
@@ -47,7 +47,7 @@ Hugo is for people building a blog, a company site, a portfolio site, documentat
|
||||
[Firebase]: https://firebase.google.com/docs/hosting/ "Firebase static hosting"
|
||||
[GitHub Pages]: https://pages.github.com/
|
||||
[GitLab Pages]: https://about.gitlab.com/features/pages/
|
||||
[Go language]: https://golang.org/
|
||||
[Go language]: https://go.dev/
|
||||
[GoDaddy]: https://www.godaddy.com/ "GoDaddy.com Hosting"
|
||||
[Google Cloud Storage]: https://cloud.google.com/storage/
|
||||
[Heroku]: https://www.heroku.com/
|
||||
|
||||
@@ -30,7 +30,7 @@ hugo [flags]
|
||||
--cacheDir string filesystem path to cache directory. Defaults: $TMPDIR/hugo_cache/
|
||||
--cleanDestinationDir remove files from destination not found in static directories
|
||||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
-c, --contentDir string filesystem path to content directory
|
||||
--debug debug output
|
||||
|
||||
@@ -23,7 +23,7 @@ See each sub-command's help for details on how to use the generated script.
|
||||
|
||||
```
|
||||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-e, --environment string build environment
|
||||
|
||||
@@ -26,7 +26,7 @@ To load completions for every new session, execute once:
|
||||
|
||||
#### macOS:
|
||||
|
||||
hugo completion bash > /usr/local/etc/bash_completion.d/hugo
|
||||
hugo completion bash > $(brew --prefix)/etc/bash_completion.d/hugo
|
||||
|
||||
You will need to start a new shell for this setup to take effect.
|
||||
|
||||
@@ -46,7 +46,7 @@ hugo completion bash
|
||||
|
||||
```
|
||||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-e, --environment string build environment
|
||||
|
||||
@@ -37,7 +37,7 @@ hugo completion fish [flags]
|
||||
|
||||
```
|
||||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-e, --environment string build environment
|
||||
|
||||
@@ -34,7 +34,7 @@ hugo completion powershell [flags]
|
||||
|
||||
```
|
||||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-e, --environment string build environment
|
||||
|
||||
@@ -16,6 +16,10 @@ to enable it. You can execute the following once:
|
||||
|
||||
echo "autoload -U compinit; compinit" >> ~/.zshrc
|
||||
|
||||
To load completions in your current shell session:
|
||||
|
||||
source <(hugo completion zsh); compdef _hugo hugo
|
||||
|
||||
To load completions for every new session, execute once:
|
||||
|
||||
#### Linux:
|
||||
@@ -24,7 +28,7 @@ To load completions for every new session, execute once:
|
||||
|
||||
#### macOS:
|
||||
|
||||
hugo completion zsh > /usr/local/share/zsh/site-functions/_hugo
|
||||
hugo completion zsh > $(brew --prefix)/share/zsh/site-functions/_hugo
|
||||
|
||||
You will need to start a new shell for this setup to take effect.
|
||||
|
||||
@@ -44,7 +48,7 @@ hugo completion zsh [flags]
|
||||
|
||||
```
|
||||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-e, --environment string build environment
|
||||
|
||||
@@ -18,25 +18,25 @@ hugo config [flags]
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for config
|
||||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
-e, --environment string build environment
|
||||
-h, --help help for config
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
--verboseLog verbose logging
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
-v, --verbose verbose output
|
||||
--verboseLog verbose logging
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
@@ -21,7 +21,7 @@ hugo config mounts [flags]
|
||||
|
||||
```
|
||||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-e, --environment string build environment
|
||||
|
||||
@@ -16,27 +16,27 @@ See convert's subcommands toJSON, toTOML and toYAML for more information.
|
||||
### Options
|
||||
|
||||
```
|
||||
-h, --help help for convert
|
||||
-o, --output string filesystem path to write files to
|
||||
--unsafe enable less safe operations, please backup first
|
||||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
-e, --environment string build environment
|
||||
-h, --help help for convert
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
-o, --output string filesystem path to write files to
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
--unsafe enable less safe operations, please backup first
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
--verboseLog verbose logging
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
-v, --verbose verbose output
|
||||
--verboseLog verbose logging
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
@@ -26,7 +26,7 @@ hugo convert toJSON [flags]
|
||||
|
||||
```
|
||||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-e, --environment string build environment
|
||||
|
||||
@@ -26,7 +26,7 @@ hugo convert toTOML [flags]
|
||||
|
||||
```
|
||||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-e, --environment string build environment
|
||||
|
||||
@@ -26,7 +26,7 @@ hugo convert toYAML [flags]
|
||||
|
||||
```
|
||||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-e, --environment string build environment
|
||||
|
||||
@@ -22,31 +22,31 @@ hugo deploy [flags]
|
||||
### Options
|
||||
|
||||
```
|
||||
--confirm ask for confirmation before making changes to the target
|
||||
--dryRun dry run
|
||||
--force force upload of all files
|
||||
-h, --help help for deploy
|
||||
--invalidateCDN invalidate the CDN cache listed in the deployment target (default true)
|
||||
--maxDeletes int maximum # of files to delete, or -1 to disable (default 256)
|
||||
--target string target deployment from deployments section in config file; defaults to the first one
|
||||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--confirm ask for confirmation before making changes to the target
|
||||
--dryRun dry run
|
||||
-e, --environment string build environment
|
||||
--force force upload of all files
|
||||
-h, --help help for deploy
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
--invalidateCDN invalidate the CDN cache listed in the deployment target (default true)
|
||||
--maxDeletes int maximum # of files to delete, or -1 to disable (default 256)
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--target string target deployment from deployments section in config file; defaults to the first one
|
||||
--themesDir string filesystem path to themes directory
|
||||
```
|
||||
|
||||
### Options inherited from parent commands
|
||||
|
||||
```
|
||||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-e, --environment string build environment
|
||||
--ignoreVendorPaths string ignores any _vendor for module paths matching the given Glob pattern
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
-s, --source string filesystem path to read files relative from
|
||||
--themesDir string filesystem path to themes directory
|
||||
-v, --verbose verbose output
|
||||
--verboseLog verbose logging
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
--log enable Logging
|
||||
--logFile string log File path (if set, logging enabled automatically)
|
||||
--quiet build in quiet mode
|
||||
-v, --verbose verbose output
|
||||
--verboseLog verbose logging
|
||||
```
|
||||
|
||||
### SEE ALSO
|
||||
|
||||
@@ -28,7 +28,7 @@ hugo env [flags]
|
||||
|
||||
```
|
||||
--clock string set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00
|
||||
--config string config file (default is path/config.yaml|json|toml)
|
||||
--config string config file (default is hugo.yaml|json|toml)
|
||||
--configDir string config dir (default "config")
|
||||
--debug debug output
|
||||
-e, --environment string build environment
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user