1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

1409 Commits

Author SHA1 Message Date
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
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
450dc7a411 Add a showcase of Kangkona 2015-07-08 07:42:04 +02:00
a945412475 Add how-to for foreign language month names
FYI @nicolinuxfr, added the month name example.
2015-07-08 07:38:52 +02:00
617fa2fe65 Add Rick and eSolia's sites to the Hugo docs showcase 2015-07-08 07:37:30 +02:00
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
24c8226cbf Document Page.RawContent in templates/variables/ 2015-07-02 19:24:30 +02:00
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
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
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
a509a23255 Add doc for new Blackfriday options
See #1220
See #1231
2015-06-28 15:27:47 +02:00
483fc8fa3d Add config option for Blackfriday HTML_HREF_TARGET_BLANK
Fixes #1220
2015-06-28 15:18:15 +02:00
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
664a97819f 404 is homeless
Fixes #1235
2015-06-28 10:43:43 +02:00
50df31406f added thumbnail 2015-06-26 21:26:17 +02:00
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
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
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
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
29e786aac5 Proper parsing structured array from yaml based FrontMatter 2015-06-25 17:56:22 +02:00
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
67209dbfb3 docs: make the named value Data File example simpler 2015-06-22 20:25:17 +02:00
e96624cce8 Update datafiles.md
additional example for named data values
2015-06-22 00:02:48 +02:00
d4b6f9aca3 Fix map-order dependent menu tests
Fixes #1222
2015-06-21 23:36:58 +02:00
c507229191 Print URL when failing menu test
See #1222
2015-06-21 23:09:39 +02:00
dbd93f5112 Remove unused var 2015-06-21 22:57:42 +02:00
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
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
6bcb7e83e7 Revert "add preliminary support for content/index.md file to be homepage content"
This reverts commit 5f84bc02cd9706af92311cc27ae01d2ffc1410fa.
2015-06-21 15:01:09 +02:00
3eb301b57a Revert "refactor and clean up site tests"
This reverts commit 99e250917ddc351d45adfeb81057ea3607d1b148.
2015-06-21 15:01:06 +02:00
f25ce7fefa Revert "Move matchRender to test helpers file"
This reverts commit 32d91d616e99cd05b59644e292b29be415d5054f.
2015-06-21 15:01:02 +02:00
d770fa59a5 Revert "Add tests for homepage content support"
This reverts commit 24351c58bedea72e4e113e2d2e5753a32ce2a0e3.
2015-06-21 15:01:01 +02:00
59c6ba4e45 Revert "Make .IsHome work when homepage as page"
This reverts commit 7e765cc1bd0ab06dbf05a467f3c648012265742b.
2015-06-21 15:00:53 +02:00
7e765cc1bd Make .IsHome work when homepage as page 2015-06-19 10:07:47 -04:00
24351c58be Add tests for homepage content support 2015-06-17 12:35:44 -04:00
32d91d616e Move matchRender to test helpers file 2015-06-17 10:47:49 -04:00
99e250917d refactor and clean up site tests 2015-06-17 10:47:49 -04:00
5f84bc02cd add preliminary support for content/index.md file to be homepage content 2015-06-17 10:47:49 -04:00
50269f2512 Remove superfluous return 2015-06-16 22:31:51 +02:00
4b7c1342fd Make removal of accents in taxonomy and section paths optional
And default off.

Fixes #1180
2015-06-16 19:25:48 +02:00
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
cc9536ec46 Update docs for last template function 2015-06-15 21:18:38 +02:00
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
627d016cc9 Refactor var name limit to index 2015-06-15 21:18:38 +02:00
40a92a062d Add after to template function documentation 2015-06-15 21:18:38 +02:00
c335efdd06 Add after template function
Where `first` will return the first N items of a rangeable list,
`after` will return all items after the Nth item.

This allows the user to do something with the first N items and
something different with the remaining items after N.
2015-06-15 21:18:38 +02:00
82cc1ac0f8 Add Blackfriday definition lists extension support 2015-06-15 21:15:05 +02:00
bep
be6cf6a9c6 Revert "Add some debug to failing menu test"
This reverts commit becc627e1e55f08e04892212350fa4db72f5c43a.
2015-06-12 22:49:49 +02:00
bep
becc627e1e Add some debug to failing menu test 2015-06-11 22:49:07 +02:00