The paths were seen as changed but not static because of the backslashes in
ev.Name. Once the backslashes were added, I discovered that the JSON
sent to livereload was invalid and failed to work because it had backslashes.
Hence the code to replace the backslashes from the path to make them work
in JSON and for the URL.
With this fix, changes to a stylesheet are shown on the page, and if it's a
single file that changed, it's reflected in the browser without reloading the whole
page.
Two new configuration properties, `Paginate` (default `0`) and `PaginatePath` (default `page`) are added.
Setting `paginate` to a positive value will split the list pages for the home page, sections and taxonomies into chunks of size of the `paginate` property.
A `.Paginator` is provided to help building a pager menu.
There are two ways to configure a `.Paginator`:
1. The simplest way is just to call `.Paginator.Pages` from a template. It will contain the pages for "that page" (`.Data.Pages` will (like today) contain all the pages).
2. Select a sub-set of the pages with the available template functions and pass the slice to `.Paginate` : `{{ range (.Paginate (where .Data.Pages "Type" "post")).Pages }}`
**NOTE:** For a given Node, it's one of the options above. It's perfectly legitimate to iterate over the same pager more than once, but it's static and cannot change.
The `.Paginator` contains enough information to build a full-blown paginator interface.
The pages are built on the form (note: BLANK means no value, i.e. home page):
```
[SECTION/TAXONOMY/BLANK]/index.html
[SECTION/TAXONOMY/BLANK]/page/1/index.html => redirect to [SECTION/TAXONOMY/BLANK]/index.html
[SECTION/TAXONOMY/BLANK]/page/2/index.html
....
```
Fixes#96
Make Blackfriday's `HTML_SMARTYPANTS_FRACTIONS` option
user-configurable. Defaults to `true` as before. See
discussions at:
http://discuss.gohugo.io/t/any-way-to-disable-smart-fractions/328
Thanks to @bjornerik and @spf13 for laying the groundwork
making it easy to expose Blackfriday's underlying configurable
options.
When a user uses Vim to open a file, it briefly creates a
".filename.md.swx" file which needlessly triggers a website rebuild.
According to a comment in Vim's src/memline.c:
/*
* on MS-DOS compatible filesystems (e.g. messydos) file.doc.swp
* and file.doc are the same file. To guess if this problem is
* present try if file.doc.swx exists. If it does, we set
* buf->b_shortname and try file_doc.swp (dots replaced by
* underscores for this file), and try again. If it doesn't we
* assume that "file.doc.swp" already exists.
*/
Before this commit any error (typically a YAML typing error in front matter) would exit server on rebuild when running `hugo server -w`.
This is very annoying as it doesn't give you any chance to fix the typo other than doing a manual restart.
This commit fixes that by just logging these errors when these rebuilds happen when changes are detected.
Fixes#781
The flag `HTML_SMARTYPANTS_ANGLED_QUOTES` was added to Blackfriday on Black Friday. This configures rendering of double quotes as angled left and right quotes («
»).
Typical use cases would be either or, or combined, but never in the same
document. As an example would be a person from Norway; he has a blog in both
English and Norwegian (his native tongue); he would then configure Blackfriday
to use angled quotes for the Norwegian section, but keep them as reqular
double quotes for the English.
This commit adds configuration support for this new flag, configuration that can be set in the site configuration, but overridden in page front matter.
Fixes#605
filepath.Walk does not follow symbolic links.
There's no easy fix for that outside of Go, so the best we can do for now is to give notice to the end user by ERROR log statements.
This commit also fixes a related panic situation in GenerateTemplateNameFrom when the layout dir was a symbolic link.
Fixes#283
- The config file can provide FootnoteAnchorPrefix, which will be used
by blackfriday when rendering to HTML. A value of `q:` has the effect
of making the anchor for a footnote `[^footie]` be `fn:q:footie`. The
default is `""`.
- The config file can provide FootnoteReturnLinkContents, which will be
used by blackfriday when rendering to HTML. A value of `^` has the
effect of making the return link be `^` instead of `[return]`.
Prior to this commit a dummy JavaScript filename was sent to LiveReload when changing a static file (CSS, image etc.), forcing a full browser reload of the page.
This commit fixes this by sending the relative file path of the changed static resource, enabling partial live reloading for CSS- and image-changes. If more than one static file happens to end up in the same changeevent-batch, it will fall back to do a full refresh. To enable this logic, the change events with names ending with ".goutputstream*" is now filtered out as temporary.
Changes in dynamic content behaves like before.
Issue #490