diff --git a/.github/actions/hugo-build-action/Dockerfile b/.github/actions/hugo-build-action/Dockerfile new file mode 100644 index 00000000..477d1903 --- /dev/null +++ b/.github/actions/hugo-build-action/Dockerfile @@ -0,0 +1,29 @@ +FROM golang:1.12-alpine + +LABEL repository="https://github.com/jakejarvis/hugo-build-action" +LABEL homepage="https://jarv.is/" +LABEL maintainer="Jake Jarvis " + +ARG HUGO_BRANCH=noopener +# ARG HUGO_COMMIT=a28865c +ARG HUGO_BUILD_TAGS=extended + +# CGO (and gcc/g++) required to build wellington/go-libsass +ARG CGO=1 +ENV CGO_ENABLED=${CGO} +ENV GOOS=linux +ENV GO111MODULE=on + +WORKDIR /go/src/github.com/gohugoio/hugo + +RUN apk update && \ + apk add --no-cache git gcc g++ musl-dev && \ + git clone https://github.com/jakejarvis/hugo.git $GOPATH/src/github.com/gohugoio/hugo && \ + if [ ! -z "$HUGO_BRANCH" ]; then git checkout $HUGO_BRANCH; fi && \ + if [ ! -z "$HUGO_COMMIT" ]; then git reset --hard $HUGO_COMMIT; fi && \ + go get github.com/magefile/mage && \ + mage hugo && mage install + +RUN hugo version + +ENTRYPOINT ["hugo"] diff --git a/.github/actions/hugo-build-action/LICENSE.md b/.github/actions/hugo-build-action/LICENSE.md new file mode 100644 index 00000000..129cdf95 --- /dev/null +++ b/.github/actions/hugo-build-action/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Jake Jarvis + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.github/actions/hugo-build-action/README.md b/.github/actions/hugo-build-action/README.md new file mode 100644 index 00000000..6171f029 --- /dev/null +++ b/.github/actions/hugo-build-action/README.md @@ -0,0 +1,23 @@ +# GitHub Action for [Hugo](https://github.com/gohugoio/hugo) ✏️ + +**⚠️ Warning:** This branch is specifically for testing the latest `dev` version built from the most recent commits to the [Hugo repository](https://github.com/gohugoio/hugo). For 99.9% of use cases, the stable [`master` branch](https://github.com/jakejarvis/hugo-build-action/tree/master) is more appropriate. + + +## Usage + +### `workflow.yml` Example + +``` +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: jakejarvis/hugo-build-action@develop + with: + args: --minify --buildDrafts +``` + + +## License + +This project is distributed under the [MIT license](LICENSE.md). diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 4bab663f..48674175 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -13,7 +13,8 @@ jobs: with: fetch-depth: 1 lfs: false - - uses: jakejarvis/hugo-build-action@develop-v0.53-DEV + # pull from local Hugo action b/c LOTS of opinionated customizations + - uses: ./.github/actions/hugo-build-action with: args: --gc --cleanDestinationDir - uses: jakejarvis/github-pages-deploy-action@master diff --git a/config.toml b/config.toml index 68159d3f..c5e485d6 100644 --- a/config.toml +++ b/config.toml @@ -23,9 +23,10 @@ enableRobotsTXT = true filename = "sitemap.xml" [blackfriday] - # hrefTargetBlank = true # prefer not to use this until noopener option implemented (https://discourse.gohugo.io/t/link-with--target-blank-in-markdown-tipp/7569/10) + hrefTargetBlank = true nofollowLinks = true noreferrerLinks = true + noopenerLinks = true # requires custom fork w/ custom blackfriday: https://github.com/jakejarvis/hugo/tree/noopener plainIDAnchors = true fractions = false