Age | Commit message (Collapse) | Author |
|
|
|
This is a final rewrite that removes all the global state in Hugo, which also enables
the use if `t.Parallel` in tests.
Updates #2701
Fixes #3016
|
|
Updates #2701
Fixes #2951
|
|
|
|
* all: Delete some blank lines
* commands, tpl: Get rid of repeating viper accesses
|
|
All config variables starts with low-case and uses camelCase.
If there is abbreviation at the beginning of the name, the whole
abbreviation will be written in low-case.
If there is abbreviation at the end of the name, the
whole abbreviation will be written in upper-case.
For example, rssURI.
|
|
|
|
When the --ignoreCache flag is set to true, do not write and read
the Pygments results to/from the cache directory.
Fixes #2066
Closes #2068
|
|
This also includes a refactor of the hugofs package and its usage.
The motivation for that is:
The Afero filesystems are brilliant. Hugo's way of adding a dozen of global variables for the different filesystems was a mistake. In readFile (and also in some other places in Hugo today) we need a way to restrict the access inside the working dir. We could use ioutil.ReadFile and implement the path checking, checking the base path and the dots ("..") etc. But it is obviously better to use an Afero BasePathFs combined witha ReadOnlyFs. We could create a use-once-filesystem and handle the initialization ourselves, but since this is also useful to others and the initialization depends on some other global state (which would mean to create a new file system on every invocation), we might as well do it properly and encapsulate the predefined set of filesystems. This change also leads the way, if needed, to encapsulate the file systems in a struct, making it possible to have several file system sets in action at once (parallel multilanguage site building? With Moore's law and all...)
Fixes #1551
|
|
|
|
|
|
|
|
Still need to add some missing headers and an AUTHORS file.
See #1646
|
|
|
|
This allows default pygments settings to be used, if none are explictly set per shortcode.
Fixes #1260
|
|
Inserts a code tag into Pygments output with the language-info that is present when using client-side highlighting (useful for CSS hooks)
```html
<code class="language-go" data-lang="go">
```
closes #1490
|
|
|
|
Previously if no language was specified, then illegal args would be passed to pygments, for example `pygments -l -fhtml`, which would result in pygments printing an error.
|
|
|
|
To avoid writing cache files when testing.
|
|
Fixes #1021
|
|
|
|
Ensures that Hugo rehighlights source code whenever one of the
highlighting options changes.
|
|
Fixes #1000
|
|
Add an initial space after `//` where appropriate.
Minor copyediting.
|
|
|
|
This commit contains a restructuring and partial rewrite of the shortcode handling.
Prior to this commit rendering of the page content was mingled with handling of the shortcodes. This led to several oddities.
The new flow is:
1. Shortcodes are extracted from page and replaced with placeholders.
2. Shortcodes are processed and rendered
3. Page is processed
4. The placeholders are replaced with the rendered shortcodes
The handling of summaries is also made simpler by this.
This commit also introduces some other chenges:
1. distinction between shortcodes that need further processing and those who do not:
* `{{< >}}`: Typically raw HTML. Will not be processed.
* `{{% %}}`: Will be processed by the page's markup engine (Markdown or (infuture) Asciidoctor)
The above also involves a new shortcode-parser, with lexical scanning inspired by Rob Pike's talk called "Lexical Scanning in Go",
which should be easier to understand, give better error messages and perform better.
2. If you want to exclude a shortcode from being processed (for documentation etc.), the inner part of the shorcode must be commented out, i.e. `{{%/* movie 47238zzb */%}}`. See the updated shortcode section in the documentation for further examples.
The new parser supports nested shortcodes. This isn't new, but has two related design choices worth mentioning:
* The shortcodes will be rendered individually, so If both `{{< >}}` and `{{% %}}` are used in the nested hierarchy, one will be passed through the page's markdown processor, the other not.
* To avoid potential costly overhead of always looking far ahead for a possible closing tag, this implementation looks at the template itself, and is branded as a container with inner content if it contains a reference to `.Inner`
Fixes #565
Fixes #480
Fixes #461
And probably some others.
|
|
Fixes #204
Conflicts:
commands/hugo.go
|
|
|
|
handling. Integration of jWalterWeatherman library. Fixed #137
|
|
|
|
original string. (+1 squashed commit)
Squashed commits:
[849a7af] if highlighting doesn’t work, just return original string
|
|
|