Commit graph

120 commits

Author SHA1 Message Date
Bjørn Erik Pedersen
9df98ec49c Add proper Media Type handling in js.Build
See #732
2020-07-13 10:56:23 +02:00
Remko Tronçon
2fc3380707 Add js.Build asset bundling
Fixes #7321
2020-07-13 10:56:23 +02:00
Bjørn Erik Pedersen
12a65e76df Add openapi3.Unmarshal
Fixes #7442
Fixes #7443
2020-07-06 20:03:36 +02:00
Niklas Fasching
127d5feb32 deps: Update go-org to v1.3.0
- Add support for image links (i.e. link with image as description)
- Kinda breaking: Wrap headlines and headline+content in containers as emacs
  Org mode does. Could break people's styles - I don't expect it, but who knows
  what counts as sane when it comes to css.

  Before:

  ```
  <h2 id="headline-1">FOO</h2>
  foo bar
  ```

  After:

  ```
  <div id="outline-container-headline-1" class="outline-2">
  <h2 id="headline-1">FOO</h2>
  <div id="outline-text-headline-1" class="outline-text-2">
  foo bar
  </div>
  </div>
  ```
2020-06-29 18:08:06 +02:00
Niklas Fasching
2d42ba912b deps: Update go-org to v1.2.0
- Add support for #+MACRO
- fix a bug with #+LINK (edge case, should never happen anyways :TM:)
- Make title export optional (add export option)
- Remove cosmetic whitespace added by go-org (for easier visual
  diffing) inside p tags (<p>\nfoo\n</p> => <p>foo</p>)
  (should make `white-space: pre` on p look more in line with expectations)
- implement table separators via multiple tbodies (the html spec is ok with
  that)
2020-06-27 13:28:01 +02:00
Bjørn Erik Pedersen
432885c499
deps: Update Goldmark to improve Typographer
See https://github.com/yuin/goldmark/releases/tag/v1.1.31
See #7289
2020-05-29 19:02:30 +02:00
Cameron Little
b342e8fbdb Upgrade chroma to 0.7.3 to fix invalid css
The new version of chroma includes a fix to not emit styles for tokens
without a class (which is invalid).

Fixes #7207
2020-05-09 17:05:14 +02:00
Piotr Perzyna
01befcce35
deps: Update minify to v2.6.2
Fixes #6699
2020-05-03 17:29:26 +02:00
Bjørn Erik Pedersen
dd31e80007 deps: Update to Libsass 3.6.4
Fixes #7231
2020-05-01 19:14:04 +02:00
SatowTakeshi
5c41f41ad4 deps: Update goldmark-highlighting
Recreate #7027
Fixes #6596
2020-04-23 18:48:52 +02:00
Niklas Fasching
2b28e5a9cb deps: Update go-org to v1.1.0
- inline source blocks and exports
- result blocks and source block :exports parameter
- fix: html escaping in example blocks
- #+LINK based links
2020-04-17 22:07:52 +02:00
Steve
102ec2da7a
commands: Modify gen chromastyles to output all CSS classes
Chroma was updated to include a new function to output all CSS
classes without skipping any considered redundant with the current
style.

This will modify the `hugo gen chromastyles` command to use this new
function by default, which avoids potential problems if the style is
later modified.

Also includes requires the updated Chroma (v0.7.2).

Resolves #7167
2020-04-13 18:31:33 +02:00
Bjørn Erik Pedersen
feaa582cbe
deps: Update to goldmark v1.1.28
Fixes #7113
2020-04-13 16:55:23 +02:00
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
Shubham Shahare
4de3ecdc26
deps: Updateto gitmap v1.1.2
Fixes #6985
2020-04-04 23:24:33 +02: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
Bjørn Erik Pedersen
b1106f8715 deps: Update Blackfriday
Fixes #7039
2020-03-10 13:06:23 +01:00
satotake
a21a9373e0
deps: Update goldmark-highlighting
See  #6901
2020-02-18 14:08:46 +01:00
Bjørn Erik Pedersen
898a0a96af deps: Update golibsass
Fixes #6885
2020-02-12 18:56:47 +01:00
Bjørn Erik Pedersen
40ba7e6d63 Update to LibSass v3.6.3
Fixes #6862
2020-02-10 10:42:05 +01:00
Bhavin Gandhi
281abb18ee deps: Update goldmark to v1.1.22
v1.1.22 has a fix for issue where links with newline in the title
don't get parsed correctly. Reference:
https://github.com/yuin/goldmark/issues/94

Signed-off-by: Bhavin Gandhi <bhavin7392@gmail.com>
2020-01-29 19:48:33 +01:00
Bjørn Erik Pedersen
7ed22e9fb6
Revert to minify v2.6.1
Closes #6791
2020-01-23 17:03:23 +01:00
Bjørn Erik Pedersen
c6d650c8c8
tpl/tplimpl: Rework template management to get rid of concurrency issues
This more or less completes the simplification of the template handling code in Hugo started in v0.62.

The main motivation was to fix a long lasting issue about a crash in HTML content files  without front matter.

But this commit also comes with a big functional improvement.

As we now have moved the base template evaluation to the build stage we now use the same lookup rules for `baseof` as for `list` etc. type of templates.

This means that in this simple example you can have a `baseof` template for the `blog` section without having to duplicate the others:

```
layouts
├── _default
│   ├── baseof.html
│   ├── list.html
│   └── single.html
└── blog
    └── baseof.html
```

Also, when simplifying code, you often get rid of some double work, as shown in the "site building" benchmarks below.

These benchmarks looks suspiciously good, but I have repeated the below with ca. the same result. Compared to master:

```
name                              old time/op    new time/op    delta
SiteNew/Bundle_with_image-16        13.1ms ± 1%    10.5ms ± 1%  -19.34%  (p=0.029 n=4+4)
SiteNew/Bundle_with_JSON_file-16    13.0ms ± 0%    10.7ms ± 1%  -18.05%  (p=0.029 n=4+4)
SiteNew/Tags_and_categories-16      46.4ms ± 2%    43.1ms ± 1%   -7.15%  (p=0.029 n=4+4)
SiteNew/Canonify_URLs-16            52.2ms ± 2%    47.8ms ± 1%   -8.30%  (p=0.029 n=4+4)
SiteNew/Deep_content_tree-16        77.9ms ± 1%    70.9ms ± 1%   -9.01%  (p=0.029 n=4+4)
SiteNew/Many_HTML_templates-16      43.0ms ± 0%    37.2ms ± 1%  -13.54%  (p=0.029 n=4+4)
SiteNew/Page_collections-16         58.2ms ± 1%    52.4ms ± 1%   -9.95%  (p=0.029 n=4+4)

name                              old alloc/op   new alloc/op   delta
SiteNew/Bundle_with_image-16        3.81MB ± 0%    2.22MB ± 0%  -41.70%  (p=0.029 n=4+4)
SiteNew/Bundle_with_JSON_file-16    3.60MB ± 0%    2.01MB ± 0%  -44.20%  (p=0.029 n=4+4)
SiteNew/Tags_and_categories-16      19.3MB ± 1%    14.1MB ± 0%  -26.91%  (p=0.029 n=4+4)
SiteNew/Canonify_URLs-16            70.7MB ± 0%    69.0MB ± 0%   -2.40%  (p=0.029 n=4+4)
SiteNew/Deep_content_tree-16        37.1MB ± 0%    31.2MB ± 0%  -15.94%  (p=0.029 n=4+4)
SiteNew/Many_HTML_templates-16      17.6MB ± 0%    10.6MB ± 0%  -39.92%  (p=0.029 n=4+4)
SiteNew/Page_collections-16         25.9MB ± 0%    21.2MB ± 0%  -17.99%  (p=0.029 n=4+4)

name                              old allocs/op  new allocs/op  delta
SiteNew/Bundle_with_image-16         52.3k ± 0%     26.1k ± 0%  -50.18%  (p=0.029 n=4+4)
SiteNew/Bundle_with_JSON_file-16     52.3k ± 0%     26.1k ± 0%  -50.16%  (p=0.029 n=4+4)
SiteNew/Tags_and_categories-16        336k ± 1%      269k ± 0%  -19.90%  (p=0.029 n=4+4)
SiteNew/Canonify_URLs-16              422k ± 0%      395k ± 0%   -6.43%  (p=0.029 n=4+4)
SiteNew/Deep_content_tree-16          401k ± 0%      313k ± 0%  -21.79%  (p=0.029 n=4+4)
SiteNew/Many_HTML_templates-16        247k ± 0%      143k ± 0%  -42.17%  (p=0.029 n=4+4)
SiteNew/Page_collections-16           282k ± 0%      207k ± 0%  -26.55%  (p=0.029 n=4+4)
```

Fixes #6716
Fixes #6760
Fixes #6768
Fixes #6778
2020-01-22 09:39:49 +01:00
Niklas Fasching
8585b388d2 deps: Update go-org
Not really a new major version but it's used in production and apparently that
means it should be a 1+. Will try to follow semver better from now on.

Changes:

- `#+OPTIONS: toc:1` now supports not just true/false but numbers to limit
  headline levels included in table of conents
- bug fix latex fragment parsing
2020-01-21 10:21:57 +01:00
Ghislain Bourgeois
3efa1d8121 deps: Update github.com/alecthomas/chroma
This new release improves YAML syntax highlighting.
2020-01-16 20:57:02 +01:00
Bjørn Erik Pedersen
65ec8fe827
deps: Update minify to v2.7.2
Fixes #6756
2020-01-15 16:04:44 +01:00
Matt Riggott
d3e8ab2e39 deps: Update Goldmark to v1.1.21
This is the first version of Goldmark that supports all the
Smartypants-style typographic punctuation transformations. Now, a
straight single quote in the middle of a word is translated into a curly
quote (e.g. "that's" becomes "that&rsquo;s"). Earlier versions leave
them untouched. This brings Goldmark in line with Blackfriday.

Fixes #6571.
2020-01-15 12:07:25 +01:00
Bjørn Erik Pedersen
0c0bb37285
deps: Update github.com/gohugoio/testmodBuilder 2020-01-14 17:09:11 +01:00
Bjørn Erik Pedersen
94cfdf6bef deps: Update direct dependencies
Closes #6719
2020-01-07 20:12:20 +01:00
Bjørn Erik Pedersen
56354a63bb
deps: Update to Minify v2.7.0
Updates ##6719
2020-01-07 16:13:38 +01:00
Bjørn Erik Pedersen
b9b73a2f63
Revert "Add support for freebsd/arm64"
golang.org/x/sys is an indirect dependency and needs to be updates as such.

This reverts commit aead8108b8.
2020-01-07 13:42:43 +01:00
Dmitri Goutnik
aead8108b8 Add support for freebsd/arm64
Update #6719 6719
2020-01-07 13:21:19 +01:00
Bjørn Erik Pedersen
1fb17be9a0 deps: Update Goldmark to v1.1.18
Fixes #6649
2019-12-22 18:14:04 +01:00
Niklas Fasching
51d89dab18 deps: Update go-org
- export #+TITLE (front-matter title) as `<h1>` and demote all normal headlines
  by 1 accordingly (i.e. a normal top level headline now becomes a `<h2>`
  rather than a `<h1>`)
- preserve whitespace in paragraphs - this allows rendering meaningful
  whitespace when wished for using e.g. css `white-space: pre;` (e.g. in verse
  / quote blocks)
2019-12-22 16:18:55 +01:00
Bjørn Erik Pedersen
0453683816
deps: Update to Goldmark v1.1.17
Fixes #6641
2019-12-20 08:00:37 +01:00
Bjørn Erik Pedersen
eef934ae7e deps: Update Goldmark
Fixes #6626
2019-12-19 09:05:35 +01:00
Bjørn Erik Pedersen
03d6960a15
deps: Re-introduce the correct version of Goldmark
It was accidently pulled back to an old version earlier today.
2019-12-12 14:45:46 +01:00
Bjørn Erik Pedersen
167c01530b
Create lightweight forks of text/template and html/template
This commit also removes support for Ace and Amber templates.

Updates #6594
2019-12-12 09:59:34 +01:00
Bjørn Erik Pedersen
3cc217a650 deps: Update Goldmark 2019-12-11 08:41:57 +01:00
Bjørn Erik Pedersen
40a092b068 markup: Reimplement pygmentsCodefencesGuessSyntax
Fixes #6565
2019-12-02 14:12:23 +01:00
Bjørn Erik Pedersen
d534ce9424 deps: Update Goldmark
Fixes #6557
2019-12-01 22:07:31 +01:00
MeiK
86a5b59f64 deps: Update minify
Fixes #6475
2019-11-29 14:37:32 +01:00
Bjørn Erik Pedersen
347cfb0c17 deps: Update Goldmark
Fixes #6549
Fixes #6551
2019-11-29 13:44:29 +01:00
Bjørn Erik Pedersen
b0c7749fa1 deps: Update Goldmark
Closes https://github.com/yuin/goldmark/issues/36#event-2832923993
2019-11-26 23:51:31 +01:00
Bjørn Erik Pedersen
ea96e1dc55
Revert "deps: Update Goldmark"
See https://github.com/yuin/goldmark/issues/36

This reverts commit 8221912869.
2019-11-25 16:58:37 +01:00
Bjørn Erik Pedersen
8221912869
deps: Update Goldmark 2019-11-25 12:50:45 +01:00
Bjørn Erik Pedersen
a2d77f4a80
markup/highlight: Replace the temp for with a dependency 2019-11-24 13:59:16 +01:00
Bjørn Erik Pedersen
b546417a27
deps: Update Chroma 2019-11-24 12:29:55 +01:00
Bjørn Erik Pedersen
4175b04686
deps: Update Goldmark 2019-11-24 12:28:57 +01:00