Commit graph

1413 commits

Author SHA1 Message Date
Arian Allenson M. Valdez
88fe0e7c2c Add learnoverpass 2015-07-09 19:13:31 +02:00
Arian Allenson M. Valdez
5f69d3d654 Add arianv 2015-07-09 19:13:31 +02:00
Sam Debruyn
6807151a22 add a showcase of sa.muel.be 2015-07-09 10:56:40 +02:00
Borys Borysenko
c6d46ff2bd [Docs] Press page. Fix URL 2015-07-09 10:52:00 +02:00
Andrew Brampton
c139c6e1ef Add support for GitHub-flavoured markdown code fences for highlighting
This commit adds a new PygmentsCodeFences config option (default false), which if true will allow GitHub style backtick code fences around code, which will then be rendered by Pygments.

For example:

``` language
your code
```

can be used instead of {{< highlight language >}}your code {{< /highlight >}}.

Fixes #362
2015-07-08 08:12:52 +02:00
Andrew Brampton
fdab118010 If no language is provided to Pygments, then try and guess it
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.
2015-07-08 08:12:06 +02:00
kangkona
450dc7a411 Add a showcase of Kangkona 2015-07-08 07:42:04 +02:00
Rick Cogley
a945412475 Add how-to for foreign language month names
FYI @nicolinuxfr, added the month name example.
2015-07-08 07:38:52 +02:00
Rick Cogley
617fa2fe65 Add Rick and eSolia's sites to the Hugo docs showcase 2015-07-08 07:37:30 +02:00
delputnam
9b3d0cf5bf Added missing "Social" section to SiteInfo
I could be wrong here, but it looks to me like .Site.Social.facebook is used in tpl/template_embedded.go, but the variable is never set. I've added a line to initializeSiteInfo to map the info from config into this variable.
2015-07-02 19:26:01 +02:00
Marc-Antoine Ruel
24c8226cbf Document Page.RawContent in templates/variables/ 2015-07-02 19:24:30 +02:00
Marc-Antoine Ruel
c9fc0e786f Add Page.RawContent() to access raw Markdown as a string.
In particular, RawContent() excludes the metadata header.

This is necessary in the use case of embedding remarkjs.com slides, as it needs
the unprocessed Markdown content to generate the slides.
2015-07-02 19:24:30 +02:00
Tatsushi Demachi
dd732e84f4 Add nil comparison to where tpl function
`where` template function's internal condition check function always
returns `false` when a target value doesn't exist or it's nil value but
this behavior makes it difficult to filter values which doesn't have a
particular parameter.

To solve it, this adds nil value comparison to the function.
`where Values ".Param.key" nil` like clause can be used for the case
above.

Only "=", "==", "eq", "!=", "<>", "ne" operators are allowed to be used
with `nil`. If an other operator is passed with `nil`, the condition
check function returns `false` like before.

Fix #1232
2015-06-29 19:50:45 +02:00
Bjørn Erik Pedersen
033a13e10e Fix watcher detecting changes as static when no theme
There have been some changes to the ´helpers.GetThemesDirPath()´ so it now returns an empty string when no theme.

This is correct, but it broke the watch service (at lest on OSX), as `strings.HasPrefix("", "somestring") evaluates to true somehow, and content changes are incorrectly branded as static.

There are other issues in there, but that will come later ...

See #1236
2015-06-28 19:27:28 +02:00
Bjørn Erik Pedersen
a509a23255 Add doc for new Blackfriday options
See #1220
See #1231
2015-06-28 15:27:47 +02:00
Bjørn Erik Pedersen
483fc8fa3d Add config option for Blackfriday HTML_HREF_TARGET_BLANK
Fixes #1220
2015-06-28 15:18:15 +02:00
Bjørn Erik Pedersen
05c07c561a Add option to disable Blackfriday LaTeX style dashes
Can be used in site config of per page front matter:

```
[blackfriday]
latexDashes = false
```

Fixes #1231
2015-06-28 15:08:52 +02:00
Bjørn Erik Pedersen
664a97819f 404 is homeless
Fixes #1235
2015-06-28 10:43:43 +02:00
Mario Sanchez Carrion
50df31406f added thumbnail 2015-06-26 21:26:17 +02:00
Mario Sanchez Carrion
d118d03714 Create mariosanchez.md
Submitting site for consideration in Hugo Showcase
2015-06-26 21:26:08 +02:00
tim
1b50ccd162 add vamp.io site as showcase 2015-06-26 20:59:40 +02:00
Jonathan Anderson
c4ad8f6498 Use helpers.GetThemeDir() to find base templates.
Now that we have the helpers.GetThemeDir() function, use it instead of
calling directly into viper.
2015-06-25 18:05:43 +02:00
Jonathan Anderson
1058cb17d1 Refactor theme path helper functions.
Reduce duplication (`x + FilePathSeparator + y` a few lines away from `filepath.Join(x, y)`) and add a `GetThemeDir()` function to get the current theme's directory.

Also add a comment complaining about the `GetThemesDirPath()` function, which doesn't seem to do what its name would suggest. This might be a candidate for deprecation?
2015-06-25 18:05:43 +02:00
Jonathan Anderson
0987e98db3 Add support for baseof.ace templates in themes.
When we find a template that requires a base template, we should also look
for that base template in the current theme.

Fixes #1215.
2015-06-25 18:05:43 +02:00
Piotr Kowalczuk
29e786aac5 Proper parsing structured array from yaml based FrontMatter 2015-06-25 17:56:22 +02:00
Bjørn Erik Pedersen
e764a6e638 Use pooled buffer in replaceShortcodes
Even as a copy at the end is needed, this consumes way less memory on Go 1.4.2:

```benchmark                           old ns/op     new ns/op     delta
BenchmarkParsePage                  145979        139964        -4.12%
BenchmarkReplaceShortcodeTokens     633574        631946        -0.26%
BenchmarkShortcodeLexer             195842        187938        -4.04%

benchmark                           old allocs     new allocs     delta
BenchmarkParsePage                  87             87             +0.00%
BenchmarkReplaceShortcodeTokens     9424           9415           -0.10%
BenchmarkShortcodeLexer             274            274            +0.00%

benchmark                           old bytes     new bytes     delta
BenchmarkParsePage                  141830        141830        +0.00%
BenchmarkReplaceShortcodeTokens     35219         25385         -27.92%
BenchmarkShortcodeLexer             30178         30177         -0.00%
```
See #1148
2015-06-22 20:30:20 +02:00
Bjørn Erik Pedersen
67209dbfb3 docs: make the named value Data File example simpler 2015-06-22 20:25:17 +02:00
Sebastian Krause
e96624cce8 Update datafiles.md
additional example for named data values
2015-06-22 00:02:48 +02:00
Bjørn Erik Pedersen
d4b6f9aca3 Fix map-order dependent menu tests
Fixes #1222
2015-06-21 23:36:58 +02:00
Bjørn Erik Pedersen
c507229191 Print URL when failing menu test
See #1222
2015-06-21 23:09:39 +02:00
Bjørn Erik Pedersen
dbd93f5112 Remove unused var 2015-06-21 22:57:42 +02:00
Bjørn Erik Pedersen
004fcddc80 Remove superfluous p-tags around shortcodes
This commit replaces the regexp driven `replaceShortcodeTokens` with a handwritten one.

It wasnt't possible to handle the p-tags case without breaking performance.

This fix actually improves in that area:

```
benchmark                           old ns/op     new ns/op     delta
BenchmarkParsePage                  142738        142667        -0.05%
BenchmarkReplaceShortcodeTokens     665590        575645        -13.51%
BenchmarkShortcodeLexer             176038        181074        +2.86%

benchmark                           old allocs     new allocs     delta
BenchmarkParsePage                  87             87             +0.00%
BenchmarkReplaceShortcodeTokens     9631           9424           -2.15%
BenchmarkShortcodeLexer             274            274            +0.00%

benchmark                           old bytes     new bytes     delta
BenchmarkParsePage                  141830        141830        +0.00%
BenchmarkReplaceShortcodeTokens     52275         35219         -32.63%
BenchmarkShortcodeLexer             30177         30178         +0.00%
```

Fixes #1148
2015-06-21 22:51:12 +02:00
Bjørn Erik Pedersen
ae4f72b091 Comment out mystery test
Fails on Travis in Go 1.3 + 1.5.

Will have to look into that one.
2015-06-21 22:28:50 +02:00
Bjørn Erik Pedersen
6bcb7e83e7 Revert "add preliminary support for content/index.md file to be homepage content"
This reverts commit 5f84bc02cd.
2015-06-21 15:01:09 +02:00
Bjørn Erik Pedersen
3eb301b57a Revert "refactor and clean up site tests"
This reverts commit 99e250917d.
2015-06-21 15:01:06 +02:00
Bjørn Erik Pedersen
f25ce7fefa Revert "Move matchRender to test helpers file"
This reverts commit 32d91d616e.
2015-06-21 15:01:02 +02:00
Bjørn Erik Pedersen
d770fa59a5 Revert "Add tests for homepage content support"
This reverts commit 24351c58be.
2015-06-21 15:01:01 +02:00
Bjørn Erik Pedersen
59c6ba4e45 Revert "Make .IsHome work when homepage as page"
This reverts commit 7e765cc1bd.
2015-06-21 15:00:53 +02:00
spf13
7e765cc1bd Make .IsHome work when homepage as page 2015-06-19 10:07:47 -04:00
spf13
24351c58be Add tests for homepage content support 2015-06-17 12:35:44 -04:00
spf13
32d91d616e Move matchRender to test helpers file 2015-06-17 10:47:49 -04:00
spf13
99e250917d refactor and clean up site tests 2015-06-17 10:47:49 -04:00
spf13
5f84bc02cd add preliminary support for content/index.md file to be homepage content 2015-06-17 10:47:49 -04:00
Bjørn Erik Pedersen
50269f2512 Remove superfluous return 2015-06-16 22:31:51 +02:00
Bjørn Erik Pedersen
4b7c1342fd Make removal of accents in taxonomy and section paths optional
And default off.

Fixes #1180
2015-06-16 19:25:48 +02:00
Rick Cogley
847ad36e45 Add new tutorial for multilingual sites
Simple tutorial showing one pattern for creating a multilingual site in
Hugo.
2015-06-16 12:17:09 +02:00
Ariejan de Vroom
cc9536ec46 Update docs for last template function 2015-06-15 21:18:38 +02:00
Ariejan de Vroom
0a2e5424ab Add last template function
`last` allows the user to select the last X items of
and array.
2015-06-15 21:18:38 +02:00
Ariejan de Vroom
627d016cc9 Refactor var name limit to index 2015-06-15 21:18:38 +02:00
Ariejan de Vroom
40a92a062d Add after to template function documentation 2015-06-15 21:18:38 +02:00