Commit graph

5799 commits

Author SHA1 Message Date
Bjørn Erik Pedersen
095bf64c99
Collect HTML elements during the build to use in PurgeCSS etc.
The main use case for this is to use with resources.PostProcess and resources.PostCSS with purgecss.

You would normally set it up to extract keywords from your templates, doing it from the full /public takes forever for bigger sites.

Doing the template thing misses dynamically created class names etc., and it's hard/impossible to set up in when using themes.

You can enable this in your site config:

```toml
[build]
  writeStats = true
```

It will then write a `hugo_stats.json` file to the project root as part of the build.

If you're only using this for the production build, you should consider putting it below `config/production`.

You can then set it up with PostCSS like this:

```js
const purgecss = require('@fullhuman/postcss-purgecss')({
    content: [ './hugo_stats.json' ],
    defaultExtractor: (content) => {
        let els = JSON.parse(content).htmlElements;
        return els.tags.concat(els.classes, els.ids);
    }
});

module.exports = {
    plugins: [
        require('tailwindcss'),
        require('autoprefixer'),
        ...(process.env.HUGO_ENVIRONMENT === 'production' ? [ purgecss ] : [])
    ]
};
```

Fixes #6999
2020-04-09 22:57:26 +02:00
Elliott Sales de Andrade
7791a804e2
deps: Update to latest emoji package 2020-04-08 12:56:14 +02:00
Helicer
c774b230e9 Update hosting-on-aws-amplify.md
AWS Amplify now supports a GUI method for using the latest `hugo` version. Please feel free to modify my wording here, etc.
2020-04-07 22:48:55 +02:00
Bjørn Erik Pedersen
2f721f8ec6
Add basic "post resource publish support"
Fixes #7146
2020-04-07 21:59:20 +02:00
Cameron Moore
8568928aa8 tpl: Extend Jsonify to support options map
Add support for prefix and indent options used by json.MarshalIndent
from the Go stdlib.
2020-04-07 20:01:57 +02:00
Cameron Moore
1bc93021e3 tpl: Extend Jsonify to support optional indent parameter
Fixes #5040
2020-04-07 20:01:57 +02:00
Robert Fekete
7eba37ae9b Typo correction 2020-04-07 19:47:44 +02:00
Jay Williams
efc61d6f3b
commands: Use semver for min_version per recommendations
See https://github.com/gohugoio/hugoThemes#themetoml
2020-04-07 19:42:45 +02:00
Bjørn Erik Pedersen
d8d6a25b57
modules: Fix hugo mod vendor for regular file mounts
Fixes #7140
2020-04-07 10:13:55 +02:00
Bjørn Erik Pedersen
9f12be54ee
Revert "Revert "common/herrors: Fix typos in comments""
OK, I'm getting tired. Sorry for the noise.

This reverts commit 4437e918cd.
2020-04-06 01:07:57 +02:00
Bjørn Erik Pedersen
4437e918cd
Revert "common/herrors: Fix typos in comments"
This reverts commit 1123711b09.
2020-04-06 01:06:27 +02:00
Shubham Shahare
4de3ecdc26
deps: Updateto gitmap v1.1.2
Fixes #6985
2020-04-04 23:24:33 +02:00
rnazmo
1123711b09 common/herrors: Fix typos in comments 2020-04-02 22:06:22 +02:00
Bjørn Erik Pedersen
3d84ef9720
Merge commit 'c494c37a4523fbf2db6274dc87e0877fd5bec24b' 2020-03-31 22:11:54 +02:00
Bjørn Erik Pedersen
c494c37a45 Squashed 'docs/' changes from 2a0ea423d..20d77860b
20d77860b Remove the calibre image action
58f53654d Improve image metadata formatting (#1067)
c569f3657 Update theme
80e6d362e Update theme
d5806cca5 Update theme
efc5cb227 Remove broken link on "where" page (#1058)
443266076 Comments Alternatives (#1036)
9b480ebb7 Fix typo
1402365ee Fix included typo in build-options.md
3b5a76de1 Update index.md
1196c7695 Update index.md
1887ea1ed Update index.md
d0666e74e Hugo 0.68.3
d514cfac9 Merge branch 'temp683'
49e57362b releaser: Add release notes to /docs for release of 0.68.3
fa0ac3bf1 Merge branch 'temp682'
46993c209 Release 0.68.2
4c8d6d242 releaser: Add release notes to /docs for release of 0.68.2
9694f4d36 Update index.md
368a03754 Update index.md
0d997010c Merge branch 'temp681'
24138a9cd releaser: Add release notes to /docs for release of 0.68.1
7dd6cc788 Update index.md
b6125b4a8 Update build-options.md
a2dead37a Release 0.68.0
7cff41348 Merge branch 'temp680'
b3b37959c releaser: Add release notes to /docs for release of 0.68.0
0f98184b0 Some minify configuration adjustments
02219f787 Add minify config
efeea7be0 Allow headless bundles to list pages via $page.Pages and $page.RegularPages
7950d0ad1 Mention `resources` folder in the "Directory structure"  docs.

git-subtree-dir: docs
git-subtree-split: 20d77860b2a992b4917af75a657419b19baafa43
2020-03-31 22:10:45 +02:00
SatowTakeshi
9c9987535f helpers: Fix TrimShortHTML
Where some tags are siblings of p tag.

Fixes #7081
2020-03-28 11:10:25 +01:00
Bjørn Erik Pedersen
4a39564efe Fix IsDescendant/IsAncestor for overlapping section names
Fixes #7096
2020-03-26 16:11:36 +01:00
Stéphane Wirtel
b6e097cfe6 fix typo in getting started 2020-03-24 17:31:37 +01:00
hugoreleaser
19a8accc9f releaser: Prepare repository for 0.69.0-DEV
[ci skip]
2020-03-24 12:16:13 +00:00
hugoreleaser
157669a0e6 releaser: Add release notes to /docs for release of 0.68.3
[ci skip]
2020-03-24 12:04:27 +00:00
hugoreleaser
8f49df946a releaser: Bump versions for release of 0.68.3
[ci skip]
2020-03-24 12:04:27 +00:00
hugoreleaser
1a68ad4e31 releaser: Add release notes for 0.68.3
[ci skip]
2020-03-24 12:04:27 +00:00
Bjørn Erik Pedersen
523d51948f Fix _build.list.local logic
Fixes #7089
2020-03-24 12:47:42 +01:00
hugoreleaser
971b28904b releaser: Prepare repository for 0.69.0-DEV
[ci skip]
2020-03-24 08:33:02 +00:00
hugoreleaser
63bbb40dfb releaser: Add release notes to /docs for release of 0.68.2
[ci skip]
2020-03-24 08:21:09 +00:00
hugoreleaser
73ae6d581d releaser: Bump versions for release of 0.68.2
[ci skip]
2020-03-24 08:21:09 +00:00
hugoreleaser
e18a2ad3f4 releaser: Add release notes for 0.68.2
[ci skip]
2020-03-24 08:21:09 +00:00
Bjørn Erik Pedersen
cfa73050a4 Fix cache reset for a page's collections on server live reload
Fixes #7085
2020-03-23 23:14:39 +01:00
hugoreleaser
244e49c0ea releaser: Prepare repository for 0.69.0-DEV
[ci skip]
2020-03-22 10:47:54 +00:00
hugoreleaser
98dc46e1a9 releaser: Add release notes to /docs for release of 0.68.1
[ci skip]
2020-03-22 10:36:42 +00:00
hugoreleaser
87dd5725de releaser: Bump versions for release of 0.68.1
[ci skip]
2020-03-22 10:36:42 +00:00
hugoreleaser
8c6a03a92b releaser: Add release notes for 0.68.1
[ci skip]
2020-03-22 10:36:42 +00:00
Bjørn Erik Pedersen
1ce3e7d521
releaser: Include "Revert" commits in change log 2020-03-21 18:51:29 +01:00
Bjørn Erik Pedersen
c9dc316ad1
Revert "resources: Add data context to the key in ExecuteAsTemplate"
This reverts commit 18cb21ff2e.

Fixes #7064
2020-03-21 18:38:19 +01:00
hugoreleaser
1664a0e893 releaser: Prepare repository for 0.69.0-DEV
[ci skip]
2020-03-21 11:59:39 +00:00
hugoreleaser
1e67854b1a releaser: Add release notes to /docs for release of 0.68.0
[ci skip]
2020-03-21 11:47:37 +00:00
hugoreleaser
e1b609af9b releaser: Bump versions for release of 0.68.0
[ci skip]
2020-03-21 11:47:37 +00:00
Bjørn Erik Pedersen
8e5566af6e
Release 0.68.0 2020-03-21 12:41:25 +01:00
Bjørn Erik Pedersen
1005f754e0
Update 0.68.0-relnotes.md
[ci skip]
2020-03-21 12:40:46 +01:00
hugoreleaser
efde7078ed releaser: Add release notes for 0.68.0
Rename to *-ready.md to continue.
[ci skip]
2020-03-21 11:33:28 +00:00
Bjørn Erik Pedersen
2ebb9f5484
Fix Go build version 2020-03-21 12:25:03 +01:00
Bjørn Erik Pedersen
7204b354a9 Some minify configuration adjustments 2020-03-20 20:35:57 +01:00
SatowTakeshi
574c2959b8 Add minify config
Fixes #6750
Updates #6892
2020-03-20 20:35:57 +01:00
Bjørn Erik Pedersen
99958f90fe Allow headless bundles to list pages via $page.Pages and $page.RegularPages
Fixes #7075
2020-03-20 18:28:55 +01:00
Bjørn Erik Pedersen
1d91d8e14b Update to Go 1.14.1 and 1.13.9
Fixes #7078
2020-03-20 18:25:54 +01:00
Carl Johnson
95f492114e
Fix GetTerms nil pointer
Fixes #7061
2020-03-20 14:35:41 +01:00
Bjørn Erik Pedersen
c947351d7c
Merge commit 'aa54803a84208816e9c678359bd3f86760484ce0' 2020-03-20 09:19:29 +01:00
Bjørn Erik Pedersen
aa54803a84 Squashed 'docs/' changes from 988f7d5c2..2a0ea423d
2a0ea423d Wrap cascade ex in code toggle
841573e3e Correcting reference for YouTube shortcode (#1055)
8f9378f93 Release 0.67.1
178759468 Merge branch 'temp671'
1b5ae9cb1 releaser: Add release notes to /docs for release of 0.67.1
a87aa44ec Don't set GOPATH when building from source
bd35dfbd8 Update hugo-deploy.md
527cf3b2b Adding a commercial search service
709844459 Add languageDirection to language configuration
523be23eb Fix include typo on v67 Release Notes
fdd7cc66c Adjust relase notes
613ba75e8 releaser: Add release notes to /docs for release of 0.67.0
3fb1376d1 docs: Doument the server config
6408a9b4e Merge commit '14e369b961943a0b977776899e24e8bea63834df'
10457ca46 deploy: Add include and exclude support for remote

git-subtree-dir: docs
git-subtree-split: 2a0ea423d77a81c4dd439708505b4680e49d7c5d
2020-03-20 09:18:47 +01:00
Evan Anderson
cc2a5d52a4 Pass directory name to filters in LstatIfPossible in the same way as Readdir 2020-03-19 20:09:34 +01:00
Elliott Sales de Andrade
52c159c452 Update to goldmark 1.1.25.
This fixes a bug, so there's a small change to tests.
2020-03-19 12:26:19 +01:00