Age | Commit message (Collapse) | Author |
|
rendering
|
|
* Add `.Truncated` bool to each page; will be set true if the
`.Summary` is truncated and it's worth showing a "more" link of some
kind.
* Add `Params` to the site config, defining `.Site.Params` accessible
to each page; this lets the site maintainer associate arbitrary data
with names, on a site-wide basis.
* Provide a `First` function to templates:
* Use-case: `{{range First 5 .Site.Recent}}` or anything else which
is a simple iterable provided by hugolib
* Tests by me for `.Truncated` and `First`
Also @noahcampbell contributed towards this:
* Add UnitTest for `.Site.Params`:
> Digging into this test case a bit more, I'm realizing that we need
> to create a param test case to ensure that for each type we render
> (page, index, homepage, rss, etc.) that the proper fields are
> represented. This will help us refactor without fear in the
> future.
Sample config.yaml:
```yaml
title: "Test site"
params:
Subtitle: "More tests always good"
AuthorName: "John Doe"
SidebarRecentLimit: 5
```
Signed-off-by: Noah Campbell <[email protected]>
|
|
Remove the hugo-nav since it relied on a slow library. The current
build reimplements the absurl functionality based on string replace.
Discovered that my prior implementation missed the requirement for
making absolute paths (/path) absolute with the host, whereas a relative
path is left untouched. Updated the test cases to support this if this
is reimplemented.
|
|
Checks to make sure the xml document starts with <?xml. Previously, the
html translate package would write additional details into the document
that caused it to fail.
|
|
|
|
|
|
50% speedup. Fix #91
to run the benchmark:
go test -test.run=NONE -bench=".*" -test.benchmem=true ./transform/ > new.txt
to compare the results:
/usr/local/go/misc/benchcmp baseline.txt new.txt
Speedup and memory improvements
benchmark old ns/op new ns/op delta
BenchmarkChain 101219 50453 -50.15%
BenchmarkTransform 51625 45531 -11.80%
benchmark old allocs new allocs delta
BenchmarkChain 222 103 -53.60%
BenchmarkTransform 135 106 -21.48%
benchmark old bytes new bytes delta
BenchmarkChain 23919 10998 -54.02%
BenchmarkTransform 11858 10665 -10.06%
|
|
Removed these checks so a single file in content can generate a site.
For example, given a site with a content directory and an index.html,
running hugo -s dir will generate a project without any more input.
|
|
|
|
pin to top.
|
|
alphabetically. Also made full indexes available to the Site variable.
|
|
|
|
In watch mode it should continue to watch for changes, in any other mode it should exit with a -1 error code so can check for success when scripting
|
|
indexes)
|
|
|
|
|
|
Now pages can be sorted by other than date
|
|
date)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The render code path would use a fallback if there was an exception.
This change instead relies on explicit declaration of the layout to use
and includes a check to see if the layout indeed exists before
attempting to render it.
|
|
|
|
This will allow for reuse of this particular function.
|
|
|
|
|
|
Panic is too extreme. Instead the library will write out a message in
verbose mode.
|
|
Also clean up logic for finding layouts.
|
|
All render(Thing) calls have a WritePublic call directly after it. This
refactor creates one function that makes the specific call sequence.
|
|
|
|
|
|
Typically the destination is on the left and the src is on the right.
|
|
|
|
|
|
|
|
|
|
summary.
|
|
|
|
|
|
|
|
|
|
|
|
If a file named index.html exists in a directory, or root, it will be
rendered as if ugly urls are turned on. This allows for top level
content to not need a supporting layout file and content in content.
This change should not affect anyone who is using the perscribed way.
I also cleaned up a bunch of one off functions in site.go.
|
|
I mistakenly make RenderHomePage a NOP. Bad programmer.
|
|
Moved the generation of the target path to the page breaking all
dependecies on Site.
|
|
This change allows for top level html content to exists.
|
|
Found that fragments were getting the BaseURL applied creating a proper
anchor url and redirecting off the page.
|