summaryrefslogtreecommitdiffstats
path: root/magefile.go
Commit message (Collapse)AuthorAge
* mage: Simplify magefileOleksandr Redko2025-02-03
|
* Build without the deploy feature by defaultBjørn Erik Pedersen2024-10-30
| | | | | | | | | | | | | Build tags setup changed to: * !nodeploy => withdeploy * nodeploy => !withdeploy Also move the deploy feature out into its own release archives. See #12994 for the primary motivation for this change. But this also greatly reduces the number of dependencies in Hugo when you don't need this feature and cuts the binary size greatly. Fixes #12994
* github: Try to fix "no space left on device" on MacOSBjørn Erik Pedersen2024-08-31
|
* content adapter: Add support for menus in AddPageBjørn Erik Pedersen2024-05-30
| | | | Fixes #12507
* livereload: Improve the livereload script build and update to v4.0.2Bjørn Erik Pedersen2024-05-10
| | | | | | | | | | | | | This script has very infrequent updates, but just copy pasting the minified source creates some potential trust issues. This JS will now be pulled from a Git version and both the unminified and minified version gets written to disk. This way it should be easier to reason about changes in the future. To upgrade, change the commit hash and run `mage generate`. Closes #12451 Closes #6290
* Create default link and image render hooksBjørn Erik Pedersen2024-01-30
| | | | Fixes #11933
* magefile: Update isGoLatest to check for Go 1.21abdullah-alaadine2023-10-04
|
* github: Fix Windows buildBjørn Erik Pedersen2023-06-01
| | | | | | Also update some Actions to get rid of some warnings. Fixes #11052
* Misc ioutil deprecation adjustmentsBjørn Erik Pedersen2023-03-01
| | | | | | | | | | To make the tests pass. * Replace io => os.ReadFile in magefile.go * Adjust failing image test vs fs.DirEntry * Adjust poller test See #10732
* Replace deprecated ioutil with io and osOleksandr Redko2023-03-01
| | | | https://pkg.go.dev/io/ioutil is deprecated since Go 1.16.
* Also consider wrapped errors when checking for file IsNotExist errorsBjørn Erik Pedersen2022-12-14
| | | | Fixes #10534
* github: Set HUGO_BUILD_TAGS: extended when running testsBjørn Erik Pedersen2022-05-27
| | | | | | Also fix TestDecodeConfig/Basic which started to fail in the extended build in 0.99.1. Closes #9935
* commands: Improve server startup to make tests less flakyBjørn Erik Pedersen2022-03-21
| | | | Do this by announcing/listen on the local address before we start the server.
* all: gofmt -w -r 'interface{} -> any' .Bjørn Erik Pedersen2022-03-17
| | | | Updates #9687
* Use revision etc. from debug.BuildInfoBjørn Erik Pedersen2022-03-17
| | | | Fixes #9680
* tpl: Use go:embed to load internal templatesBjørn Erik Pedersen2022-02-14
| | | | Fixes #8297
* all: Format code with gofumptBjørn Erik Pedersen2020-12-03
| | | | See https://github.com/mvdan/gofumpt
* build: Allow optional "nodeploy" tag to exclude deploy command from binEric Hagman2020-10-23
| | | Fixes #7826
* Update to Go 1.15Bjørn Erik Pedersen2020-08-16
| | | | Fixes #7554
* mage: Add uninstall targetRicardo N Feliciano2020-07-30
|
* Add genDocsHelper mage targetCameron Moore2020-06-15
| | | | | Expose the functionality of the hidden `hugo gen docshelper` command as a mage target.
* Update to Go 1.14 and 1.13.8Bjørn Erik Pedersen2020-02-26
| | | | Fixes #6958
* Create lightweight forks of text/template and html/templateBjørn Erik Pedersen2019-12-12
| | | | | | This commit also removes support for Ace and Amber templates. Updates #6594
* mage: Restore -v behaviourBjørn Erik Pedersen2019-11-25
|
* mage: Fix mage check on darwin and add debugging outputChris Trimble2019-11-25
| | | | | Darwin no longer supports 386 builds after Catalina. Also add debugging output when running test suites from mage.
* mage: Skip Test386 on non-AMD64 architecturesAnthony Fok2019-11-01
| | | | This is to allow "mage check" to run on arm64 on Travis CI.
* tests: Convert from testify to quicktestBjørn Erik Pedersen2019-08-12
|
* Add Hugo ModulesBjørn Erik Pedersen2019-07-24
| | | | | | | | | | | | | | | | | | | | | | | This commit implements Hugo Modules. This is a broad subject, but some keywords include: * A new `module` configuration section where you can import almost anything. You can configure both your own file mounts nd the file mounts of the modules you import. This is the new recommended way of configuring what you earlier put in `configDir`, `staticDir` etc. And it also allows you to mount folders in non-Hugo-projects, e.g. the `SCSS` folder in the Bootstrap GitHub project. * A module consists of a set of mounts to the standard 7 component types in Hugo: `static`, `content`, `layouts`, `data`, `assets`, `i18n`, and `archetypes`. Yes, Theme Components can now include content, which should be very useful, especially in bigger multilingual projects. * Modules not in your local file cache will be downloaded automatically and even "hot replaced" while the server is running. * Hugo Modules supports and encourages semver versioned modules, and uses the minimal version selection algorithm to resolve versions. * A new set of CLI commands are provided to manage all of this: `hugo mod init`, `hugo mod get`, `hugo mod graph`, `hugo mod tidy`, and `hugo mod vendor`. All of the above is backed by Go Modules. Fixes #5973 Fixes #5996 Fixes #6010 Fixes #5911 Fixes #5940 Fixes #6074 Fixes #6082 Fixes #6092
* Avoid nilpointer on no File on PageBjørn Erik Pedersen2019-03-26
| | | | Fixes #5781
* Make Page an interfaceBjørn Erik Pedersen2019-03-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main motivation of this commit is to add a `page.Page` interface to replace the very file-oriented `hugolib.Page` struct. This is all a preparation step for issue #5074, "pages from other data sources". But this also fixes a set of annoying limitations, especially related to custom output formats, and shortcodes. Most notable changes: * The inner content of shortcodes using the `{{%` as the outer-most delimiter will now be sent to the content renderer, e.g. Blackfriday. This means that any markdown will partake in the global ToC and footnote context etc. * The Custom Output formats are now "fully virtualized". This removes many of the current limitations. * The taxonomy list type now has a reference to the `Page` object. This improves the taxonomy template `.Title` situation and make common template constructs much simpler. See #5074 Fixes #5763 Fixes #5758 Fixes #5090 Fixes #5204 Fixes #4695 Fixes #5607 Fixes #5707 Fixes #5719 Fixes #3113 Fixes #5706 Fixes #5767 Fixes #5723 Fixes #5769 Fixes #5770 Fixes #5771 Fixes #5759 Fixes #5776 Fixes #5777 Fixes #5778
* Add /config dir supportBjørn Erik Pedersen2018-12-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds support for a configuration directory (default `config`). The different pieces in this puzzle are: * A new `--environment` (or `-e`) flag. This can also be set with the `HUGO_ENVIRONMENT` OS environment variable. The value for `environment` defaults to `production` when running `hugo` and `development` when running `hugo server`. You can set it to any value you want (e.g. `hugo server -e "Sensible Environment"`), but as it is used to load configuration from the file system, the letter case may be important. You can get this value in your templates with `{{ hugo.Environment }}`. * A new `--configDir` flag (defaults to `config` below your project). This can also be set with `HUGO_CONFIGDIR` OS environment variable. If the `configDir` exists, the configuration files will be read and merged on top of each other from left to right; the right-most value will win on duplicates. Given the example tree below: If `environment` is `production`, the left-most `config.toml` would be the one directly below the project (this can now be omitted if you want), and then `_default/config.toml` and finally `production/config.toml`. And since these will be merged, you can just provide the environment specific configuration setting in you production config, e.g. `enableGitInfo = true`. The order within the directories will be lexical (`config.toml` and then `params.toml`). ```bash config ├── _default │   ├── config.toml │   ├── languages.toml │   ├── menus │   │   ├── menus.en.toml │   │   └── menus.zh.toml │   └── params.toml ├── development │   └── params.toml └── production ├── config.toml └── params.toml ``` Some configuration maps support the language code in the filename (e.g. `menus.en.toml`): `menus` (`menu` also works) and `params`. Also note that the only folders with "a meaning" in the above listing is the top level directories below `config`. The `menus` sub folder is just added for better organization. We use `TOML` in the example above, but Hugo also supports `JSON` and `YAML` as configuration formats. These can be mixed. Fixes #5422
* Add tpl/site and tpl/hugoBjørn Erik Pedersen2018-12-06
| | | | | | | | This means that the current `.Site` and ´.Hugo` is available as a globals, so you can do `site.IsServer`, `hugo.Version` etc. Fixes #5470 Fixes #5467 Fixes #5503
* Fix error message for go vetMichael Henderson2018-08-30
|
* mage: Init packages onceBjørn Erik Pedersen2018-08-30
| | | | `go list ./...` fails when run in parallel on Windows. This also applies to running `go test ./...` and `go list/...` so we serialize tests.
* build: Remove the remains of Go DepBjørn Erik Pedersen2018-08-30
| | | | | | Appveyor is now Go 1.11 ready, so we can go all "Go Modules". Closes #5115
* Use Go 1.11 modules with MageBjørn Erik Pedersen2018-08-25
| | | | See #5115
* Update Travis to Go 1.11 and Go 1.10.4Bjørn Erik Pedersen2018-08-25
| | | | See #5115
* Add Hugo Piper with SCSS support and much moreBjørn Erik Pedersen2018-07-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, you would have to use page bundles to do image processing etc. in Hugo. This commit adds * A new `/assets` top-level project or theme dir (configurable via `assetDir`) * A new template func, `resources.Get` which can be used to "get a resource" that can be further processed. This means that you can now do this in your templates (or shortcodes): ```bash {{ $sunset := (resources.Get "images/sunset.jpg").Fill "300x200" }} ``` This also adds a new `extended` build tag that enables powerful SCSS/SASS support with source maps. To compile this from source, you will also need a C compiler installed: ``` HUGO_BUILD_TAGS=extended mage install ``` Note that you can use output of the SCSS processing later in a non-SCSSS-enabled Hugo. The `SCSS` processor is a _Resource transformation step_ and it can be chained with the many others in a pipeline: ```bash {{ $css := resources.Get "styles.scss" | resources.ToCSS | resources.PostCSS | resources.Minify | resources.Fingerprint }} <link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Digest }}" media="screen"> ``` The transformation funcs above have aliases, so it can be shortened to: ```bash {{ $css := resources.Get "styles.scss" | toCSS | postCSS | minify | fingerprint }} <link rel="stylesheet" href="{{ $styles.RelPermalink }}" integrity="{{ $styles.Data.Digest }}" media="screen"> ``` A quick tip would be to avoid the fingerprinting part, and possibly also the not-superfast `postCSS` when you're doing development, as it allows Hugo to be smarter about the rebuilding. Documentation will follow, but have a look at the demo repo in https://github.com/bep/hugo-sass-test New functions to create `Resource` objects: * `resources.Get` (see above) * `resources.FromString`: Create a Resource from a string. New `Resource` transformation funcs: * `resources.ToCSS`: Compile `SCSS` or `SASS` into `CSS`. * `resources.PostCSS`: Process your CSS with PostCSS. Config file support (project or theme or passed as an option). * `resources.Minify`: Currently supports `css`, `js`, `json`, `html`, `svg`, `xml`. * `resources.Fingerprint`: Creates a fingerprinted version of the given Resource with Subresource Integrity.. * `resources.Concat`: Concatenates a list of Resource objects. Think of this as a poor man's bundler. * `resources.ExecuteAsTemplate`: Parses and executes the given Resource and data context (e.g. .Site) as a Go template. Fixes #4381 Fixes #4903 Fixes #4858
* tpl/tplimpl: Extract internal templatesBjørn Erik Pedersen2018-05-04
| | | | | | | | | | | | | | Having them in separate files should make maintainance easier. When adding new or making changes to the templates: ```bash mage generate ``` This will get the Go code in sync. Fixes #4457
* Run gofmt -s with Go 1.10Bjørn Erik Pedersen2018-02-21
| | | | See #4434
* magefile: Disable Go 1.10 gofmt check for nowBjørn Erik Pedersen2018-02-17
|
* resource: Add front matter metadata to ResourceBjørn Erik Pedersen2018-01-17
| | | | | | | | | | | | This commit expands the Resource interface with 3 new methods: * Name * Title * Params All of these can be set in the Page front matter. `Name` will get its default value from the base filename, and is the value used in the ByPrefix and GetByPrefix lookup methods. Fixes #4244
* Support offline buildsVas Sudanagunta2018-01-11
|
* mage: Do not run Go Fmt check on Go tipBjørn Erik Pedersen2017-12-07
|
* mage: Skip Check on Go 1.8Bjørn Erik Pedersen2017-10-21
| | | | See #3988
* Update magefile to use Go DepBjørn Erik Pedersen2017-10-21
| | | | See #3988
* Fix error handling in mage buildNate Finch2017-10-21
| | | | | | * print gofmt errors * don't error on lint failures * explanatory comments and fix an error text
* Fix mage vs make issuesBjørn Erik Pedersen2017-10-18
| | | | | | And remove Makefile ... for good. Fixes #3969
* Simplify HugoNoGitInfo in magefileCameron Moore2017-10-07
|
* Create magefile from MakefileNate Finch2017-10-03
This commit makes a magefile.go that should be functionally equivalent to the current Makefile.