Commit graph

74 commits

Author SHA1 Message Date
Bjørn Erik Pedersen 930a3df1b7 hugolib, output: Restrict Render to regular Pages
Using it for list pages doesn't work and has potential weird side-effects.

The user probably meant to range over .Site.ReqularPages, and that is now marked clearly in the log.
2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen 09c88e84d1 output: Rename HTMLType etc. to HTMLFormat 2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen b7ed67d425 hugolib: More TODO fixes 2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen 3cd97951f1 hugolib, layout: Consolidate RSS template handling 2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen 5761b93c96 hugolib, output: Fix RSSLink vs output formats
And remove the now superflous setPageURLs method.
2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen 87188496fb hugolib, output: Handle aliases for all HTML formats 2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen d851d6b98f Add custom protocol support in Permalink 2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen 8bcc08e3b0 media, output: Add Calendar type 2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen dbb83f925a hugolib: Read default output formats from site config 2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen c7dbee2321 hugolib, output: Add Rel to the output format
To make it super-easy to create rel-links.
2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen 1b2be5e878 hugolib: Add OutputFormats with permalinks to Page 2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen baa29f6534 output: Rework the base template logic
Extract the logic to a testable function and add support for custom output types.

Fixes #2995
2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen 6178238a0b output: Speed up layout calculations
```
BenchmarkLayout-4     4883          497           -89.82%

benchmark             old allocs     new allocs     delta
BenchmarkLayout-4     18             1              -94.44%

benchmark             old bytes     new bytes     delta
BenchmarkLayout-4     1624          32            -98.03%
```
2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen ad8cea87f3 Refactor layout resolve to a descriptor/adapter pattern 2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen 4c2abe0015 Rename OutputType to OutputFormat 2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen 6bf010fed4 hugolib: Refactor/-work the permalink/target path logic
This is a pretty fundamental change in Hugo, but absolutely needed if we should have any hope of getting "multiple outputs" done.

This commit's goal is to say:

* Every file target path is created by `createTargetPath`, i.e. one function for all.
* That function takes every page and site parameter into account, to avoid fragile string parsing to uglify etc. later on.
* The path creation logic has full test coverage.
* All permalinks, paginator URLs etc. are then built on top of that same logic.

Fixes #1252
Fixes #2110
Closes #2374
Fixes #1885
Fixes #3102
Fixes #3179
Fixes #1641
Fixes #1989
2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen c8fff9501d Implement the first generic JSON output testcase 2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen 3ec5fc3504 hugolib, output: Incorporate suffix and type in layout resolve
And remove some now superflous and hard to maintain tests.
2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen f091fc23ed hugolib: Add basic setup for output def per Kind 2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen 50c64415aa hugolib, output: Add theme logic to LayoutHandler 2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen 254cd89c8e hugolob: A first incorporation of output types in rendering 2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen 10de077164 hugolib: Use the new layout logic in Page 2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen 3bb52bf7bf output: Move layout logic to the output package 2017-03-27 15:43:56 +02:00
Bjørn Erik Pedersen d3d2c63dd9 output: Add output type 2017-03-27 15:43:56 +02:00