diff --git a/README.md b/README.md index dacad52..913130b 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,250 @@ -# action-hugo +[bep]: https://github.com/bep +[bugs]: https://github.com/gohugoio/hugo/issues?q=is%3Aopen+is%3Aissue+label%3ABug +[contributing]: CONTRIBUTING.md +[create a proposal]: https://github.com/gohugoio/hugo/issues/new?labels=Proposal%2C+NeedsTriage&template=feature_request.md +[documentation repository]: https://github.com/gohugoio/hugoDocs +[documentation]: https://gohugo.io/documentation +[dragonfly bsd, freebsd, netbsd, and openbsd]: https://gohugo.io/installation/bsd +[features]: https://gohugo.io/about/features/ +[forum]: https://discourse.gohugo.io +[friends]: https://github.com/gohugoio/hugo/graphs/contributors +[go]: https://go.dev/ +[hugo modules]: https://gohugo.io/hugo-modules/ +[installation]: https://gohugo.io/installation +[issue queue]: https://github.com/gohugoio/hugo/issues +[linux]: https://gohugo.io/installation/linux +[macos]: https://gohugo.io/installation/macos +[prebuilt binary]: https://github.com/gohugoio/hugo/releases/latest +[requesting help]: https://discourse.gohugo.io/t/requesting-help/9132 +[spf13]: https://github.com/spf13 +[static site generator]: https://en.wikipedia.org/wiki/Static_site_generator +[support]: https://discourse.gohugo.io +[themes]: https://themes.gohugo.io/ +[website]: https://gohugo.io +[windows]: https://gohugo.io/installation/windows -The world’s fastest framework for building websites now has a Github Action that's just as fast! Why wait for Hugo to -**build** each time you deploy your site? +Hugo -`utahcon/action-hugo` uses **pre-built** Docker containers to run your Hugo builds. - -You can even leverage them without Github Actions: [see here](https://hub.docker.com/r/utahcon/hugo) +A fast and flexible static site generator built with love by [bep], [spf13], and [friends] in [Go]. -## Hugo Modules support added in v0.80.0 +--- -Starting with `action-hugo` v0.80.0 you can now use [Hugo Modules](https://gohugo.io/hugo-modules/). Enjoy! +[![GoDoc](https://godoc.org/github.com/gohugoio/hugo?status.svg)](https://godoc.org/github.com/gohugoio/hugo) +[![Tests on Linux, MacOS and Windows](https://github.com/gohugoio/hugo/workflows/Test/badge.svg)](https://github.com/gohugoio/hugo/actions?query=workflow%3ATest) +[![Go Report Card](https://goreportcard.com/badge/github.com/gohugoio/hugo)](https://goreportcard.com/report/github.com/gohugoio/hugo) -## Usage -Simple to use, just add a step to your workflow as follows: +[Website] | [Installation] | [Documentation] | [Support] | [Contributing] | Mastodon +## Overview -```yaml -- name: Hugo Build - uses: utahcon/actions-hugo@%%VERSION%% +Hugo is a [static site generator] written in [Go], optimized for speed and designed for flexibility. With its advanced templating system and fast asset pipelines, Hugo renders a complete site in seconds, often less. + +Due to its flexible framework, multilingual support, and powerful taxonomy system, Hugo is widely used to create: + +- Corporate, government, nonprofit, education, news, event, and project sites +- Documentation sites +- Image portfolios +- Landing pages +- Business, professional, and personal blogs +- Resumes and CVs + +Use Hugo's embedded web server during development to instantly see changes to content, structure, behavior, and presentation. Then deploy the site to your host, or push changes to your Git provider for automated builds and deployment. + +Hugo's fast asset pipelines include: + +- Image processing – Convert, resize, crop, rotate, adjust colors, apply filters, overlay text and images, and extract EXIF data +- JavaScript bundling – Transpile TypeScript and JSX to JavaScript, bundle, tree shake, minify, create source maps, and perform SRI hashing. +- Sass processing – Transpile Sass to CSS, bundle, tree shake, minify, create source maps, perform SRI hashing, and integrate with PostCSS +- Tailwind CSS processing – Compile Tailwind CSS utility classes into standard CSS, bundle, tree shake, optimize, minify, perform SRI hashing, and integrate with PostCSS + +And with [Hugo Modules], you can share content, assets, data, translations, themes, templates, and configuration with other projects via public or private Git repositories. + +See the [features] section of the documentation for a comprehensive summary of Hugo's capabilities. + +## Sponsors + +

 

+

+ Linode +    + The complete IDE crafted for professional Go developers. +

+ +## Installation + +Install Hugo from a [prebuilt binary], package manager, or package repository. Please see the installation instructions for your operating system: + +- [macOS] +- [Linux] +- [Windows] +- [DragonFly BSD, FreeBSD, NetBSD, and OpenBSD] + +## Build from source + +Hugo is available in two editions: standard and extended. With the extended edition you can: + +- Encode to the WebP format when processing images. You can decode WebP images with either edition. +- Transpile Sass to CSS using the embedded LibSass transpiler. The extended edition is not required to use the Dart Sass transpiler. + +Prerequisites to build Hugo from source: + +- Standard edition: Go 1.20 or later +- Extended edition: Go 1.20 or later, and GCC + +Build the standard edition: + +```text +go install github.com/gohugoio/hugo@latest +``` + +Build the extended edition: + +```text +CGO_ENABLED=1 go install -tags extended github.com/gohugoio/hugo@latest ``` -Want to stay on the bleeding edge? You can use the tag `latest` to always pull the latest build of Hugo. We build every -time a new version of Hugo is released! - -You can substitute any version of Hugo back to `v0.59.0`!! +## Star History + +[![Star History Chart](https://api.star-history.com/svg?repos=gohugoio/hugo&type=Timeline)](https://star-history.com/#gohugoio/hugo&Timeline) + +## Documentation + +Hugo's [documentation] includes installation instructions, a quick start guide, conceptual explanations, reference information, and examples. + +Please submit documentation issues and pull requests to the [documentation repository]. + +## Support + +Please **do not use the issue queue** for questions or troubleshooting. Unless you are certain that your issue is a software defect, use the [forum]. + +Hugo’s [forum] is an active community of users and developers who answer questions, share knowledge, and provide examples. A quick search of over 20,000 topics will often answer your question. Please be sure to read about [requesting help] before asking your first question. + +## Contributing -## Flexible -Each version allows you to pass in the appropriate command line arguments through `inputs`; these are the inputs allowed -for `%%VERSION%%` +You can contribute to the Hugo project by: -| Name | Type | Description | -|------|------|-------------|%%README_INPUTS%% +- Answering questions on the [forum] +- Improving the [documentation] +- Monitoring the [issue queue] +- Creating or improving [themes] +- Squashing [bugs] + +Please submit documentation issues and pull requests to the [documentation repository]. + +If you have an idea for an enhancement or new feature, create a new topic on the [forum] in the "Feature" category. This will help you to: + +- Determine if the capability already exists +- Measure interest +- Refine the concept + +If there is sufficient interest, [create a proposal]. Do not submit a pull request until the project lead accepts the proposal. + +For a complete guide to contributing to Hugo, see the [Contribution Guide](CONTRIBUTING.md). + +## Dependencies + +Hugo stands on the shoulders of great open source libraries. Run `hugo env --logLevel info` to display a list of dependencies. + +
+See current dependencies + +```text +github.com/BurntSushi/locker="v0.0.0-20171006230638-a6e239ea1c69" +github.com/alecthomas/chroma/v2="v2.14.0" +github.com/armon/go-radix="v1.0.1-0.20221118154546-54df44f2176c" +github.com/bep/clocks="v0.5.0" +github.com/bep/debounce="v1.2.0" +github.com/bep/gitmap="v1.6.0" +github.com/bep/goat="v0.5.0" +github.com/bep/godartsass/v2="v2.3.2" +github.com/bep/golibsass="v1.2.0" +github.com/bep/gowebp="v0.3.0" +github.com/bep/imagemeta="v0.8.3" +github.com/bep/lazycache="v0.7.0" +github.com/bep/logg="v0.4.0" +github.com/bep/mclib="v1.20400.20402" +github.com/bep/overlayfs="v0.9.2" +github.com/bep/simplecobra="v0.4.0" +github.com/bep/tmc="v0.5.1" +github.com/cespare/xxhash/v2="v2.3.0" +github.com/clbanning/mxj/v2="v2.7.0" +github.com/cli/safeexec="v1.0.1" +github.com/cpuguy83/go-md2man/v2="v2.0.4" +github.com/disintegration/gift="v1.2.1" +github.com/dlclark/regexp2="v1.11.0" +github.com/evanw/esbuild="v0.24.0" +github.com/fatih/color="v1.18.0" +github.com/frankban/quicktest="v1.14.6" +github.com/fsnotify/fsnotify="v1.8.0" +github.com/getkin/kin-openapi="v0.123.0" +github.com/ghodss/yaml="v1.0.0" +github.com/go-openapi/jsonpointer="v0.20.2" +github.com/go-openapi/swag="v0.22.8" +github.com/gobuffalo/flect="v1.0.3" +github.com/gobwas/glob="v0.2.3" +github.com/gohugoio/go-i18n/v2="v2.1.3-0.20230805085216-e63c13218d0e" +github.com/gohugoio/hashstructure="v0.1.0" +github.com/gohugoio/httpcache="v0.7.0" +github.com/gohugoio/hugo-goldmark-extensions/extras="v0.2.0" +github.com/gohugoio/hugo-goldmark-extensions/passthrough="v0.3.0" +github.com/gohugoio/locales="v0.14.0" +github.com/gohugoio/localescompressed="v1.0.1" +github.com/google/go-cmp="v0.6.0" +github.com/gorilla/websocket="v1.5.3" +github.com/hairyhenderson/go-codeowners="v0.7.0" +github.com/hashicorp/golang-lru/v2="v2.0.7" +github.com/invopop/yaml="v0.2.0" +github.com/jdkato/prose="v1.2.1" +github.com/josharian/intern="v1.0.0" +github.com/kr/pretty="v0.3.1" +github.com/kr/text="v0.2.0" +github.com/kyokomi/emoji/v2="v2.2.13" +github.com/mailru/easyjson="v0.7.7" +github.com/makeworld-the-better-one/dither/v2="v2.4.0" +github.com/marekm4/color-extractor="v1.2.1" +github.com/mattn/go-colorable="v0.1.13" +github.com/mattn/go-isatty="v0.0.20" +github.com/mattn/go-runewidth="v0.0.9" +github.com/mitchellh/mapstructure="v1.5.1-0.20231216201459-8508981c8b6c" +github.com/mohae/deepcopy="v0.0.0-20170929034955-c48cc78d4826" +github.com/muesli/smartcrop="v0.3.0" +github.com/niklasfasching/go-org="v1.7.0" +github.com/olekukonko/tablewriter="v0.0.5" +github.com/pbnjay/memory="v0.0.0-20210728143218-7b4eea64cf58" +github.com/pelletier/go-toml/v2="v2.2.3" +github.com/perimeterx/marshmallow="v1.1.5" +github.com/pkg/browser="v0.0.0-20240102092130-5ac0b6a4141c" +github.com/pkg/errors="v0.9.1" +github.com/rogpeppe/go-internal="v1.13.1" +github.com/russross/blackfriday/v2="v2.1.0" +github.com/sass/dart-sass/compiler="1.81.0" +github.com/sass/dart-sass/implementation="1.81.0" +github.com/sass/dart-sass/protocol="3.1.0" +github.com/sass/libsass="3.6.6" +github.com/spf13/afero="v1.11.0" +github.com/spf13/cast="v1.7.1" +github.com/spf13/cobra="v1.8.1" +github.com/spf13/fsync="v0.10.1" +github.com/spf13/pflag="v1.0.5" +github.com/tdewolff/minify/v2="v2.20.37" +github.com/tdewolff/parse/v2="v2.7.15" +github.com/tetratelabs/wazero="v1.8.2" +github.com/webmproject/libwebp="v1.3.2" +github.com/yuin/goldmark-emoji="v1.0.4" +github.com/yuin/goldmark="v1.7.8" +go.uber.org/automaxprocs="v1.5.3" +golang.org/x/crypto="v0.31.0" +golang.org/x/exp="v0.0.0-20221031165847-c99f073a8326" +golang.org/x/image="v0.22.0" +golang.org/x/mod="v0.22.0" +golang.org/x/net="v0.33.0" +golang.org/x/sync="v0.10.0" +golang.org/x/sys="v0.28.0" +golang.org/x/text="v0.21.0" +golang.org/x/tools="v0.28.0" +google.golang.org/protobuf="v1.35.2" +gopkg.in/yaml.v2="v2.4.0" +gopkg.in/yaml.v3="v3.0.1" +rsc.io/qr="v0.2.0" +software.sslmate.com/src/go-pkcs12="v0.2.0" +``` +
diff --git a/action.yml b/action.yml index 2dfc08c..a9db4de 100644 --- a/action.yml +++ b/action.yml @@ -6,9 +6,173 @@ branding: icon: package color: orange -inputs: %%INPUTS%% +inputs: + baseURL: + description: "hostname (and path) to the root, e.g. https://spf13.com/" + required: false + buildDrafts: + description: "include content marked as draft" + required: false + buildExpired: + description: "include expired content" + required: false + buildFuture: + description: "include content with publishdate in the future" + required: false + cacheDir: + description: "filesystem path to cache directory" + required: false + cleanDestinationDir: + description: "remove files from destination not found in static directories" + required: false + clock: + description: "set the clock used by Hugo, e.g. --clock 2021-11-06T22:30:00.00+09:00" + required: false + config: + description: "config file (default is hugo.yaml|json|toml)" + required: false + configDir: + description: "config dir (default config)" + required: false + contentDir: + description: "filesystem path to content directory" + required: false + destination: + description: "filesystem path to write files to" + required: false + disableKinds: + description: "disable different kind of pages (home, RSS etc.)" + required: false + enableGitInfo: + description: "add Git revision, date, author, and CODEOWNERS info to the pages" + required: false + environment: + description: "build environment" + required: false + forceSyncStatic: + description: "copy all files when static is changed." + required: false + gc: + description: "enable to run some cleanup tasks (remove unused cache files) after the build" + required: false + help: + description: "help for hugo" + required: false + ignoreCache: + description: "ignores the cache directory" + required: false + ignoreVendorPaths: + description: "ignores any _vendor for module paths matching the given Glob pattern" + required: false + layoutDir: + description: "filesystem path to layout directory" + required: false + logLevel: + description: "log level (debug|info|warn|error)" + required: false + minify: + description: "minify any supported output format (HTML, XML etc.)" + required: false + noBuildLock: + description: "don't create .hugo_build.lock file" + required: false + noChmod: + description: "don't sync permission mode of files" + required: false + noTimes: + description: "don't sync modification time of files" + required: false + panicOnWarning: + description: "panic on first WARNING log" + required: false + poll: + description: "set this to a poll interval, e.g --poll 700ms, to use a poll based approach to watch for file system changes" + required: false + printI18nWarnings: + description: "print missing translations" + required: false + printMemoryUsage: + description: "print memory usage to screen at intervals" + required: false + printPathWarnings: + description: "print warnings on duplicate target paths etc." + required: false + printUnusedTemplates: + description: "print warnings on unused templates." + required: false + quiet: + description: "build in quiet mode" + required: false + renderSegments: + description: "named segments to render (configured in the segments config)" + required: false + renderToMemory: + description: "render to memory (mostly useful when running the server)" + required: false + source: + description: "filesystem path to read files relative from" + required: false + templateMetrics: + description: "display metrics about template executions" + required: false + templateMetricsHints: + description: "calculate some improvement hints when combined with --templateMetrics" + required: false + theme: + description: "themes to use (located in /themes/THEMENAME/)" + required: false + themesDir: + description: "filesystem path to themes directory" + required: false + trace: + description: "write trace to file (not useful in general)" + required: false + watch: + description: "watch filesystem for changes and recreate as needed" + required: false runs: using: docker - image: docker://utahcon/hugo:v%%VERSION%% - args: %%ARGS%% + image: docker://utahcon/hugo:v0.141.0 + args: + - ${{ inputs.baseURL }} + - ${{ inputs.buildDrafts }} + - ${{ inputs.buildExpired }} + - ${{ inputs.buildFuture }} + - ${{ inputs.cacheDir }} + - ${{ inputs.cleanDestinationDir }} + - ${{ inputs.clock }} + - ${{ inputs.config }} + - ${{ inputs.configDir }} + - ${{ inputs.contentDir }} + - ${{ inputs.destination }} + - ${{ inputs.disableKinds }} + - ${{ inputs.enableGitInfo }} + - ${{ inputs.environment }} + - ${{ inputs.forceSyncStatic }} + - ${{ inputs.gc }} + - ${{ inputs.help }} + - ${{ inputs.ignoreCache }} + - ${{ inputs.ignoreVendorPaths }} + - ${{ inputs.layoutDir }} + - ${{ inputs.logLevel }} + - ${{ inputs.minify }} + - ${{ inputs.noBuildLock }} + - ${{ inputs.noChmod }} + - ${{ inputs.noTimes }} + - ${{ inputs.panicOnWarning }} + - ${{ inputs.poll }} + - ${{ inputs.printI18nWarnings }} + - ${{ inputs.printMemoryUsage }} + - ${{ inputs.printPathWarnings }} + - ${{ inputs.printUnusedTemplates }} + - ${{ inputs.quiet }} + - ${{ inputs.renderSegments }} + - ${{ inputs.renderToMemory }} + - ${{ inputs.source }} + - ${{ inputs.templateMetrics }} + - ${{ inputs.templateMetricsHints }} + - ${{ inputs.theme }} + - ${{ inputs.themesDir }} + - ${{ inputs.trace }} + - ${{ inputs.watch }} diff --git a/entrypoint.sh b/entrypoint.sh old mode 100644 new mode 100755 index 16b24a7..12732b2 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -7,7 +7,48 @@ arg_pos=1 while (( "$#" )); do if [[ -n $1 ]]; then - case $arg_pos in %%ENTRY%% + case $arg_pos in + 1) ARGUMENTS+="--baseURL ${1} ";; + 2) ARGUMENTS+="--buildDrafts ${1} ";; + 3) ARGUMENTS+="--buildExpired ${1} ";; + 4) ARGUMENTS+="--buildFuture ${1} ";; + 5) ARGUMENTS+="--cacheDir ${1} ";; + 6) ARGUMENTS+="--cleanDestinationDir ${1} ";; + 7) ARGUMENTS+="--clock ${1} ";; + 8) ARGUMENTS+="--config ${1} ";; + 9) ARGUMENTS+="--configDir ${1} ";; + 10) ARGUMENTS+="--contentDir ${1} ";; + 11) ARGUMENTS+="--destination ${1} ";; + 12) ARGUMENTS+="--disableKinds ${1} ";; + 13) ARGUMENTS+="--enableGitInfo ${1} ";; + 14) ARGUMENTS+="--environment ${1} ";; + 15) ARGUMENTS+="--forceSyncStatic ${1} ";; + 16) ARGUMENTS+="--gc ${1} ";; + 17) ARGUMENTS+="--help ${1} ";; + 18) ARGUMENTS+="--ignoreCache ${1} ";; + 19) ARGUMENTS+="--ignoreVendorPaths ${1} ";; + 20) ARGUMENTS+="--layoutDir ${1} ";; + 21) ARGUMENTS+="--logLevel ${1} ";; + 22) ARGUMENTS+="--minify ${1} ";; + 23) ARGUMENTS+="--noBuildLock ${1} ";; + 24) ARGUMENTS+="--noChmod ${1} ";; + 25) ARGUMENTS+="--noTimes ${1} ";; + 26) ARGUMENTS+="--panicOnWarning ${1} ";; + 27) ARGUMENTS+="--poll ${1} ";; + 28) ARGUMENTS+="--printI18nWarnings ${1} ";; + 29) ARGUMENTS+="--printMemoryUsage ${1} ";; + 30) ARGUMENTS+="--printPathWarnings ${1} ";; + 31) ARGUMENTS+="--printUnusedTemplates ${1} ";; + 32) ARGUMENTS+="--quiet ${1} ";; + 33) ARGUMENTS+="--renderSegments ${1} ";; + 34) ARGUMENTS+="--renderToMemory ${1} ";; + 35) ARGUMENTS+="--source ${1} ";; + 36) ARGUMENTS+="--templateMetrics ${1} ";; + 37) ARGUMENTS+="--templateMetricsHints ${1} ";; + 38) ARGUMENTS+="--theme ${1} ";; + 39) ARGUMENTS+="--themesDir ${1} ";; + 40) ARGUMENTS+="--trace ${1} ";; + 41) ARGUMENTS+="--watch ${1} ";; esac fi arg_pos=$((arg_pos+1))