feat: add AsciiDoc and Pandoc support for exts tags [build] (#73)

This commit is contained in:
Razon Yang 2024-06-03 15:22:22 +08:00 committed by GitHub
parent e1eba0073d
commit 81720c1549
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 71 additions and 17 deletions

View file

@ -205,6 +205,14 @@ jobs:
env:
IMAGE_PREFIX: ${{ matrix.prefix }}
- name: Test Extra Markdown Handlers
if: steps.check.outputs.exists == 'false' &&
contains(fromJson('["exts-"]'), matrix.prefix)
run: |
docker run --rm -v $PWD/site:/src hugomods/hugo:test hugo --config config.yaml,config-markdown-handlers.yaml
env:
IMAGE_PREFIX: ${{ matrix.prefix }}
- name: Check Git installation
if: |
steps.check.outputs.exists == 'false' &&

View file

@ -1,19 +1,10 @@
# syntax = edrevo/dockerfile-plus
INCLUDE+ ./Dockerfile-builder
FROM node:alpine as node
FROM alpine:edge
COPY --from=node /usr/lib /usr/lib
COPY --from=node /usr/local/lib /usr/local/lib
COPY --from=node /usr/local/include /usr/local/include
COPY --from=node /usr/local/bin /usr/local/bin
INCLUDE+ ./snippets/exts
INCLUDE+ ./snippets/go
INCLUDE+ ./snippets/git
INCLUDE+ ./snippets/exts
INCLUDE+ ./snippets/common

View file

@ -1,6 +1,20 @@
FROM node:alpine as node
FROM alpine:edge
COPY --from=node /usr/lib /usr/lib
COPY --from=node /usr/local/lib /usr/local/lib
COPY --from=node /usr/local/include /usr/local/include
COPY --from=node /usr/local/bin /usr/local/bin
# install Embedded Dart SASS.
RUN apk add dart-sass --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/
RUN apk add --no-cache dart-sass
# install packages.
# install extra Markdown handlers
RUN apk add --no-cache \
asciidoctor \
pandoc-cli
# install Node.js packages.
RUN npm i -g postcss-cli autoprefixer @fullhuman/postcss-purgecss rtlcss

View file

@ -0,0 +1 @@
cascade:

View file

@ -1,6 +0,0 @@
baseURL = 'http://example.org/'
languageCode = 'en-us'
title = 'Hugo Example Site'
[security.funcs]
getenv = ['^HUGO_', '^CI$', '^IMAGE_PREFIX$']

23
site/config.yaml Normal file
View file

@ -0,0 +1,23 @@
baseURL: 'http://example.org/'
languageCode: en-us
title: Hugo Example Site
cascade:
- _target:
path: /{adoc,pandoc}
build:
list: never
render: never
security:
funcs:
getenv:
- ^HUGO_
- ^CI$
- ^IMAGE_PREFIX$
exec:
allow:
- ^(dart-)?sass(-embedded)?$
- ^go$
- ^npx$
- ^postcss$
- ^asciidoctor$
- ^pandoc$

View file

@ -0,0 +1,18 @@
---
title: AsciiDoc
---
= Hello, AsciiDoc!
This is an interactive editor.
Use it to try https://asciidoc.org[AsciiDoc].
== Section Title
* A list item
* Another list item
[,ruby]
----
puts 'Hello, World!'
----

View file

@ -0,0 +1,5 @@
---
title: Pandoc
---
*Hello* world!