1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-19 08:55:32 -04:00

noopener support via custom Hugo and BlackFriday forks

This commit is contained in:
2019-10-06 12:47:00 -04:00
parent 0c5a7771b6
commit db9ded1ba0
5 changed files with 77 additions and 2 deletions

View File

@@ -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 <jake@jarv.is>"
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"]

View File

@@ -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.

View File

@@ -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).

View File

@@ -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

View File

@@ -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