brevno-suite/hugo
9 years agoReset Scratch for 404
Bjørn Erik Pedersen [Fri, 7 Aug 2015 18:30:01 +0000 (20:30 +0200)]
Reset Scratch for 404

The 404 pages etc. need a better solution, but fix this issue for now.

Fixes #1336

9 years agoRevert "Fix some Go code doc issues"
Bjørn Erik Pedersen [Fri, 7 Aug 2015 18:09:40 +0000 (20:09 +0200)]
Revert "Fix some Go code doc issues"

This reverts commit de7dd70bbc1ac533f137e5f788e1b337d6ba6b8c.

Broke the code fence feat.

9 years agoAvoid panic in shortcode param handling
Bjørn Erik Pedersen [Fri, 7 Aug 2015 18:08:23 +0000 (20:08 +0200)]
Avoid panic in shortcode param handling

Fixes #1337

9 years agoDo not panic on index out of range in shortcode.Get
Bjørn Erik Pedersen [Fri, 7 Aug 2015 17:21:26 +0000 (19:21 +0200)]
Do not panic on index out of range in shortcode.Get

Fixes #1335

9 years agoAlso rename readDir in docs shortcode
Bjørn Erik Pedersen [Fri, 7 Aug 2015 12:55:53 +0000 (14:55 +0200)]
Also rename readDir in docs shortcode

9 years agoRename ReadDir to readDir
Bjørn Erik Pedersen [Fri, 7 Aug 2015 12:33:48 +0000 (14:33 +0200)]
Rename ReadDir to readDir

To make it consistent with the other template funcs.

9 years agoMake sort tpl func accept field/key chaining arg
Tatsushi Demachi [Fri, 7 Aug 2015 11:05:18 +0000 (20:05 +0900)]
Make sort tpl func accept field/key chaining arg

'sort' template function used to accept only each element's struct field
name, method name and map key name as its second argument. This extends
it to accept a field/method/key chaining key string like
'Params.foo.bar' as the argument. It evaluates sub elements of each
array or map elements and sorts by them.

Typical use case would be sorting pages by user defined front matter
value. For example, sorting pages by 'Params.foo.bar' is possible by
writing the following template code

    {{ range sort .Data.Pages "Params.foo.bar" }}
        {{ .Content }}
    {{ end }}

It ignores all leading and trailing dots so "Params.foo.bar" can be
written in ".Params.foo.bar"

This also fixes the issue that 'sort' cannot evaluate a pointer value.

Fix #1330

9 years agoFix sort tpl func to return explicit type value
Tatsushi Demachi [Thu, 6 Aug 2015 17:27:15 +0000 (02:27 +0900)]
Fix sort tpl func to return explicit type value

sort template function returns `[]interface{}` type slice value
regardless of its original element type.

This fixes it to keep the original element type. For example, if it
sorts `map[string]int` type value, it returns `[]int` slice value
instead of `[]interface{}` slice value.

9 years agoFix Unicode issue in Slicestr and Substr
Bjørn Erik Pedersen [Fri, 7 Aug 2015 06:52:22 +0000 (08:52 +0200)]
Fix Unicode issue in Slicestr and Substr

Fixes #1333

9 years agoFix some Go code doc issues
Bjørn Erik Pedersen [Thu, 6 Aug 2015 20:58:10 +0000 (22:58 +0200)]
Fix some Go code doc issues

9 years agoAdd missing formatting directive in Printf call
Bjørn Erik Pedersen [Thu, 6 Aug 2015 20:46:01 +0000 (22:46 +0200)]
Add missing formatting directive in Printf call

To make Go Vet happy.

9 years agodocs: Extend documentation on Blackfriday options
Anthony Fok [Wed, 5 Aug 2015 22:24:03 +0000 (16:24 -0600)]
docs: Extend documentation on Blackfriday options

Especially to spell out how the `latexDashes` flag
changes the behavior of smart dashes

9 years agoAdd some float tests to TestArethmic
Bjørn Erik Pedersen [Wed, 5 Aug 2015 16:55:25 +0000 (18:55 +0200)]
Add some float tests to TestArethmic

9 years agoAdd option to disable Blackfriday Smartypants
Anthony Fok [Tue, 4 Aug 2015 19:05:48 +0000 (13:05 -0600)]
Add option to disable Blackfriday Smartypants

Can be used in site config or per page front matter:

```
[blackfriday]
smartypants = false
```

9 years agodocs: Fix typos
Anthony Fok [Tue, 4 Aug 2015 19:01:25 +0000 (13:01 -0600)]
docs: Fix typos

9 years agodocs: Bolden the blackfriday flags to make them stand out
Anthony Fok [Tue, 4 Aug 2015 18:34:47 +0000 (12:34 -0600)]
docs: Bolden the blackfriday flags to make them stand out

And other minor HTML/CSS tweaks.

9 years agodoc: Strip trailing whitespace; other revisions
Anthony Fok [Tue, 4 Aug 2015 18:00:08 +0000 (12:00 -0600)]
doc: Strip trailing whitespace; other revisions

Make some random and non-comprehensive changes to the
template functions documentation to make them more
consistent.

9 years agoStrip trailing whitespace in code
Anthony Fok [Tue, 4 Aug 2015 17:59:32 +0000 (11:59 -0600)]
Strip trailing whitespace in code

9 years agoImprove formatting of Hugo command descriptions
Anthony Fok [Tue, 4 Aug 2015 09:15:12 +0000 (03:15 -0600)]
Improve formatting of Hugo command descriptions

Trying to make them look good both in the terminal (`hugo help [command]`)
and in the web browser (http://gohugo.io/commands/).  :-)

9 years agoBump `hugo new theme` template min_version to 0.14
Anthony Fok [Tue, 4 Aug 2015 08:59:57 +0000 (02:59 -0600)]
Bump `hugo new theme` template min_version to 0.14

9 years agoFix searching YAML/TOML delimiters in frontmatter
Tatsushi Demachi [Mon, 3 Aug 2015 14:32:51 +0000 (23:32 +0900)]
Fix searching YAML/TOML delimiters in frontmatter

When a YAML/TOML's delimiter character sequence is included in a
frontmatter string, parser mistakes it as a delimiter. This fixes it by
checking a character right before the delimiter sequence is '\n' or it
is the beginning of the frontmatter.

Fix #1320

9 years agoAdd map support to scratch
Marek Janda [Sun, 2 Aug 2015 05:00:43 +0000 (07:00 +0200)]
Add map support to scratch

9 years agoTrim trailing spaces from YAML and TOML delimiters
Jeff Hodges [Sun, 2 Aug 2015 05:24:22 +0000 (22:24 -0700)]
Trim trailing spaces from YAML and TOML delimiters

When someone hits space after typing "---" (or "+++") but before they
hit return, hugo silently failed to parse the file. This corrects that.

9 years ago[Docs] Add <br> to an extra-long title in the Press page
Anthony Fok [Sat, 1 Aug 2015 17:38:58 +0000 (11:38 -0600)]
[Docs] Add <br> to an extra-long title in the Press page

9 years agodocs: add netlify article to press section
Bjørn Erik Pedersen [Fri, 31 Jul 2015 11:43:45 +0000 (13:43 +0200)]
docs: add netlify article to press section

9 years agoRemove deprecated fields and methods for v0.15
Anthony Fok [Thu, 30 Jul 2015 07:17:10 +0000 (01:17 -0600)]
Remove deprecated fields and methods for v0.15

Special thanks to @bep for his guidance and
for making sure all of the Hugo themes get updated.

Fixes #1172

9 years agoAsciidoc[tor]: use --no-header-footer option
Baptiste Mathus [Wed, 29 Jul 2015 14:11:59 +0000 (16:11 +0200)]
Asciidoc[tor]: use --no-header-footer option

This simplifies the retrieval of the HTML (no more need to extract the
part within body) and also removes the unwanted "Last Updated" part in
the article.

9 years agoAlways use the template provided in page.Render
Bjørn Erik Pedersen [Tue, 28 Jul 2015 23:19:29 +0000 (01:19 +0200)]
Always use the template provided in page.Render

Fixes #1306

9 years agoFix inconsistent front matter handling
Bjørn Erik Pedersen [Sun, 26 Jul 2015 13:28:56 +0000 (15:28 +0200)]
Fix inconsistent front matter handling

Fixes #768

9 years agoAdd ReadDir function to list local files.
Russell Oliver [Fri, 26 Jun 2015 10:23:37 +0000 (20:23 +1000)]
Add ReadDir function to list local files.

Includes documentation.

9 years agoIgnore non-presence of "layouts" directory in watch logic
Scott C Wilson [Sat, 18 Jul 2015 13:14:39 +0000 (09:14 -0400)]
Ignore non-presence of "layouts" directory in watch logic
Fixes #691

9 years agoFix periods in taxonomies create bad paths
Ryan Clarke [Tue, 2 Jun 2015 00:29:29 +0000 (20:29 -0400)]
Fix periods in taxonomies create bad paths
Fixes #1188

9 years agoReplace strings.Compare
Bjørn Erik Pedersen [Sat, 25 Jul 2015 15:38:13 +0000 (17:38 +0200)]
Replace strings.Compare

Which is a Go 1.5 func.

See #1299

9 years agoFix sort test and title sort
Bjørn Erik Pedersen [Sat, 25 Jul 2015 15:22:19 +0000 (17:22 +0200)]
Fix sort test and title sort

See #1299

9 years agoFall back to link title for default page sort
Bjørn Erik Pedersen [Sat, 25 Jul 2015 14:34:35 +0000 (16:34 +0200)]
Fall back to link title for default page sort

Fixes #1299

9 years agoThe guide is updated to fit the current Wercker interface and configurations.
Sam Debruyn [Mon, 13 Jul 2015 20:22:27 +0000 (22:22 +0200)]
The guide is updated to fit the current Wercker interface and configurations.
Wercker changed its interface and default infrastructure (Docker).

9 years agoRemove point 7 in contributors guide
Bjørn Erik Pedersen [Fri, 24 Jul 2015 09:41:45 +0000 (11:41 +0200)]
Remove point 7 in contributors guide

It makes sense on its own, but it contradicts 6). We need to revisit this one to make it more clear/better.

9 years agoMake small fixes to README file
Scott C Wilson [Mon, 13 Jul 2015 09:41:46 +0000 (05:41 -0400)]
Make small fixes to README file
- Add a step to Contributor instructions for those modifying commands
- Change forum link to http (https does not work)
- Add "Sign the forum release thread" to contributor instructions

9 years agodocs: fix prev in highlightling
Bjørn Erik Pedersen [Fri, 24 Jul 2015 09:31:26 +0000 (11:31 +0200)]
docs: fix prev in highlightling

9 years agoAdded szymonkatra.github.io site to showcase
Szymon Katra [Fri, 10 Jul 2015 14:27:39 +0000 (16:27 +0200)]
Added szymonkatra.github.io site to showcase

9 years agoFix links to Ace and Amber pages
Scott C Wilson [Mon, 20 Jul 2015 22:29:36 +0000 (18:29 -0400)]
Fix links to Ace and Amber pages

9 years agoAdd scottcwilson.github.io to showcase site
Scott C Wilson [Tue, 21 Jul 2015 10:06:14 +0000 (06:06 -0400)]
Add scottcwilson.github.io to showcase site

9 years agoMove apply before cache put
Bjørn Erik Pedersen [Thu, 23 Jul 2015 22:28:21 +0000 (00:28 +0200)]
Move apply before cache put

It just looks better.

See #1293

9 years agodocs: Rename dynamic content to data-driven content
Bjørn Erik Pedersen [Thu, 23 Jul 2015 10:54:58 +0000 (12:54 +0200)]
docs: Rename dynamic content to data-driven content

Fixes #925

9 years agoFix data races in sorting and Reverse
Bjørn Erik Pedersen [Mon, 20 Jul 2015 23:29:22 +0000 (01:29 +0200)]
Fix data races in sorting and Reverse

The custom sort functions used from the templates had some subtle data race- and related issues,
especially when used in the single page template.

This commit fixes this by making copies and protect the read and writes with a RWMutex.

The results are cached (it will typically be invoked *number of pages* times with exactly the same data).

This is, not surprisingly, also faster:

```
benchmark                           old ns/op     new ns/op     delta
BenchmarkSortByWeightAndReverse     14228         491           -96.55%

benchmark                           old allocs     new allocs     delta
BenchmarkSortByWeightAndReverse     1              0              -100.00%

benchmark                           old bytes     new bytes     delta
BenchmarkSortByWeightAndReverse     32            0             -100.00%
```

Fixes #1293

9 years agoFix broken test
Bjørn Erik Pedersen [Tue, 21 Jul 2015 19:12:03 +0000 (21:12 +0200)]
Fix broken test

9 years agoAdd benchmark for sort and reverse
Bjørn Erik Pedersen [Tue, 21 Jul 2015 19:01:56 +0000 (21:01 +0200)]
Add benchmark for sort and reverse

9 years agosource/File: Fix data races
Bjørn Erik Pedersen [Tue, 21 Jul 2015 18:02:42 +0000 (20:02 +0200)]
source/File: Fix data races

9 years agoDocument Amber templates
Scott C Wilson [Mon, 20 Jul 2015 12:49:18 +0000 (08:49 -0400)]
Document Amber templates
Fixes #1064

9 years agoOn error, return error message, not nil
Scott C Wilson [Mon, 20 Jul 2015 01:02:03 +0000 (21:02 -0400)]
On error, return error message, not nil

9 years agoAdd a check for the setting of watch flag in config file
Scott C Wilson [Sat, 18 Jul 2015 00:42:09 +0000 (20:42 -0400)]
Add a check for the setting of watch flag in config file

Fixes #1074

9 years agoLet Amber template call Hugo's custom functions
Tatsushi Demachi [Mon, 20 Jul 2015 00:07:55 +0000 (09:07 +0900)]
Let Amber template call Hugo's custom functions

Amber doesn't share text/template `FuncMap` functions and has its own
function list. This allows Amber to call Hugo's custom functions.

9 years agoFix name logic for Amber templates
Bjørn Erik Pedersen [Sun, 19 Jul 2015 18:12:05 +0000 (20:12 +0200)]
Fix name logic for Amber templates

9 years agoFix link to front matter
Christopher Eliot [Tue, 14 Jul 2015 13:36:39 +0000 (09:36 -0400)]
Fix link to front matter

added leading backslash, changing [front matter](content/front-matter) to [front matter](/content/front-matter)

9 years agoFix unclear RSS template docs
Clam- [Fri, 17 Jul 2015 13:29:58 +0000 (23:29 +1000)]
Fix unclear RSS template docs

The documentation for the RSS templating is a little unclear.
http://gohugo.io/templates/rss/

Some users may attempt to look for a ```__internal``` directory rather than assume that's the aforementioned "Hugo own template."

Here's my suggestion.

9 years agoAdd mention about .Hugo.Generator in 'Creating a theme' section
digitalcraftsman [Sat, 18 Jul 2015 10:23:52 +0000 (12:23 +0200)]
Add mention about .Hugo.Generator in 'Creating a theme' section

9 years agoFix typo: "taxononomy" -> "taxonomy"
Edward Vielmetti [Thu, 16 Jul 2015 11:47:35 +0000 (07:47 -0400)]
Fix typo: "taxononomy" -> "taxonomy"

9 years agoAdd paginator support for page groups
Bjørn Erik Pedersen [Thu, 16 Jul 2015 11:17:54 +0000 (13:17 +0200)]
Add paginator support for page groups

Fixed #1274

9 years agofix TestHomeNodeMenu test
Valere JEANTET [Mon, 13 Jul 2015 20:07:04 +0000 (22:07 +0200)]
fix TestHomeNodeMenu test

Signed-off-by: Valere JEANTET <valere.jeantet@gmail.com>
9 years agoAllow page.HasMenuCurrent() and node.HasMenuCurrent() to proceed with multi-level...
Valere JEANTET [Thu, 25 Jun 2015 10:26:48 +0000 (12:26 +0200)]
Allow page.HasMenuCurrent() and node.HasMenuCurrent() to proceed with multi-level nested menus
Currently HasMenuCurrent only process the first 2 levels.

9 years agoLog missing theme as FATAL
Bjørn Erik Pedersen [Mon, 13 Jul 2015 08:38:28 +0000 (10:38 +0200)]
Log missing theme as FATAL

See #1234

9 years agoChecks to ensure theme directory, if specified, exists
Scott C Wilson [Sun, 12 Jul 2015 17:25:43 +0000 (13:25 -0400)]
Checks to ensure theme directory, if specified, exists

See #1234

9 years agoFix log message in test
Bjørn Erik Pedersen [Sun, 12 Jul 2015 17:27:29 +0000 (19:27 +0200)]
Fix log message in test

9 years agoOptimize RuneCount
Bjørn Erik Pedersen [Sun, 12 Jul 2015 09:28:19 +0000 (11:28 +0200)]
Optimize RuneCount

Do not create it unless used.

See #1266

9 years agoAdd RuneCount to Page
Bjørn Erik Pedersen [Sun, 12 Jul 2015 09:05:37 +0000 (11:05 +0200)]
Add RuneCount to Page

Fixes #1266

9 years agoOmit protocol from embedded font resources
Éli Marshal [Fri, 10 Jul 2015 22:53:03 +0000 (16:53 -0600)]
Omit protocol from embedded font resources

Fixes the mixed content errors and loads fonts when accessing
https://gohugo.io/

9 years agoChange arianv sourceLink to master branch
Arian Allenson M. Valdez [Thu, 9 Jul 2015 08:59:00 +0000 (16:59 +0800)]
Change arianv sourceLink to master branch

9 years agoAdd learnoverpass
Arian Allenson M. Valdez [Thu, 9 Jul 2015 03:17:35 +0000 (11:17 +0800)]
Add learnoverpass

9 years agoAdd arianv
Arian Allenson M. Valdez [Thu, 9 Jul 2015 03:17:29 +0000 (11:17 +0800)]
Add arianv

9 years agoadd a showcase of sa.muel.be
Sam Debruyn [Wed, 8 Jul 2015 12:12:09 +0000 (14:12 +0200)]
add a showcase of sa.muel.be

9 years ago[Docs] Press page. Fix URL
Borys Borysenko [Wed, 8 Jul 2015 10:57:49 +0000 (13:57 +0300)]
[Docs] Press page. Fix URL

9 years agoAdd support for GitHub-flavoured markdown code fences for highlighting
Andrew Brampton [Fri, 3 Jul 2015 21:53:50 +0000 (14:53 -0700)]
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

9 years agoIf no language is provided to Pygments, then try and guess it
Andrew Brampton [Fri, 3 Jul 2015 21:51:43 +0000 (14:51 -0700)]
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.

9 years agoAdd a showcase of Kangkona
kangkona [Sun, 5 Jul 2015 11:13:42 +0000 (19:13 +0800)]
Add a showcase of Kangkona

9 years agoAdd how-to for foreign language month names
Rick Cogley [Wed, 8 Jul 2015 02:09:11 +0000 (11:09 +0900)]
Add how-to for foreign language month names

FYI @nicolinuxfr, added the month name example.

9 years agoAdd Rick and eSolia's sites to the Hugo docs showcase
Rick Cogley [Wed, 8 Jul 2015 01:35:47 +0000 (10:35 +0900)]
Add Rick and eSolia's sites to the Hugo docs showcase

9 years agoAdded missing "Social" section to SiteInfo
delputnam [Thu, 2 Jul 2015 14:04:17 +0000 (10:04 -0400)]
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.

9 years agoDocument Page.RawContent in templates/variables/
Marc-Antoine Ruel [Thu, 2 Jul 2015 15:58:38 +0000 (11:58 -0400)]
Document Page.RawContent in templates/variables/

9 years agoAdd Page.RawContent() to access raw Markdown as a string.
Marc-Antoine Ruel [Thu, 2 Jul 2015 13:32:57 +0000 (09:32 -0400)]
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.

9 years agoAdd nil comparison to where tpl function
Tatsushi Demachi [Sat, 27 Jun 2015 17:15:42 +0000 (02:15 +0900)]
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

9 years agoFix watcher detecting changes as static when no theme
Bjørn Erik Pedersen [Sun, 28 Jun 2015 17:27:28 +0000 (19:27 +0200)]
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

9 years agoAdd doc for new Blackfriday options
Bjørn Erik Pedersen [Sun, 28 Jun 2015 13:27:47 +0000 (15:27 +0200)]
Add doc for new Blackfriday options

See #1220
See #1231

9 years agoAdd config option for Blackfriday HTML_HREF_TARGET_BLANK
Bjørn Erik Pedersen [Sun, 28 Jun 2015 13:18:15 +0000 (15:18 +0200)]
Add config option for Blackfriday HTML_HREF_TARGET_BLANK

Fixes #1220

9 years agoAdd option to disable Blackfriday LaTeX style dashes
Bjørn Erik Pedersen [Sun, 28 Jun 2015 13:08:52 +0000 (15:08 +0200)]
Add option to disable Blackfriday LaTeX style dashes

Can be used in site config of per page front matter:

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

Fixes #1231

9 years ago404 is homeless
Bjørn Erik Pedersen [Sun, 28 Jun 2015 08:43:43 +0000 (10:43 +0200)]
404 is homeless

Fixes #1235

9 years agoadded thumbnail
Mario Sanchez Carrion [Wed, 24 Jun 2015 02:03:47 +0000 (22:03 -0400)]
added thumbnail

9 years agoCreate mariosanchez.md
Mario Sanchez Carrion [Sun, 21 Jun 2015 01:04:44 +0000 (21:04 -0400)]
Create mariosanchez.md

Submitting site for consideration in Hugo Showcase

9 years agoadd vamp.io site as showcase
tim [Fri, 26 Jun 2015 13:55:16 +0000 (15:55 +0200)]
add vamp.io site as showcase

9 years agoUse helpers.GetThemeDir() to find base templates.
Jonathan Anderson [Fri, 19 Jun 2015 13:30:34 +0000 (11:00 -0230)]
Use helpers.GetThemeDir() to find base templates.

Now that we have the helpers.GetThemeDir() function, use it instead of
calling directly into viper.

9 years agoRefactor theme path helper functions.
Jonathan Anderson [Fri, 19 Jun 2015 13:26:32 +0000 (10:56 -0230)]
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?

9 years agoAdd support for baseof.ace templates in themes.
Jonathan Anderson [Fri, 19 Jun 2015 01:29:08 +0000 (22:59 -0230)]
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.

9 years agoProper parsing structured array from yaml based FrontMatter
Piotr Kowalczuk [Thu, 25 Jun 2015 09:46:09 +0000 (11:46 +0200)]
Proper parsing structured array from yaml based FrontMatter

9 years agoUse pooled buffer in replaceShortcodes
Bjørn Erik Pedersen [Mon, 22 Jun 2015 17:40:12 +0000 (19:40 +0200)]
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

9 years agodocs: make the named value Data File example simpler
Bjørn Erik Pedersen [Mon, 22 Jun 2015 18:25:17 +0000 (20:25 +0200)]
docs: make the named value Data File example simpler

9 years agoUpdate datafiles.md
Sebastian Krause [Mon, 15 Jun 2015 23:09:24 +0000 (01:09 +0200)]
Update datafiles.md

additional example for named data values

9 years agoFix map-order dependent menu tests
Bjørn Erik Pedersen [Sun, 21 Jun 2015 21:36:58 +0000 (23:36 +0200)]
Fix map-order dependent menu tests

Fixes #1222

9 years agoPrint URL when failing menu test
Bjørn Erik Pedersen [Sun, 21 Jun 2015 21:09:39 +0000 (23:09 +0200)]
Print URL when failing menu test

See #1222

9 years agoRemove unused var
Bjørn Erik Pedersen [Sun, 21 Jun 2015 20:57:42 +0000 (22:57 +0200)]
Remove unused var

9 years agoRemove superfluous p-tags around shortcodes
Bjørn Erik Pedersen [Sun, 21 Jun 2015 11:08:30 +0000 (13:08 +0200)]
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

9 years agoComment out mystery test
Bjørn Erik Pedersen [Sun, 21 Jun 2015 20:28:50 +0000 (22:28 +0200)]
Comment out mystery test

Fails on Travis in Go 1.3 + 1.5.

Will have to look into that one.