Commit graph

122 commits

Author SHA1 Message Date
Icaro Seara
e791835e6d Fix typo, "delemiters" -> "delimiters" 2015-08-19 08:06:13 -06:00
Tatsushi Demachi
98659bf3b8 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
2015-08-03 18:30:55 +02:00
Jeff Hodges
8d28686edc 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.
2015-08-02 14:46:46 +02:00
bep
a52e508d46 Update test logs for uniformity and consistency
Many minor fixes to make test logs more consistent and correct a
mispelling.

Standardize on "[%i] got X but expected Y" for log messages. Using
a consistent layout makes it easier to read the test results. This
was mostly changing "Got" to "got". Swapped the order of values on
several calls to bring them in line with the convention.

A few log messages had a sequence number added to identify the
exact scenario that failed. Otherwise, there would be no way to
ascertain which failed When there are many scenarios.

Correct spelling of "expected."

Fixes #1028
Merged be2097e1ad

[close #1040]
2015-05-08 22:27:00 -04:00
Joel Scoble
b4871787f0 add undraft command 2015-05-08 22:18:51 -04:00
Anthony Fok
67df33f500 Correct initialisms as suggested by golint
First step to use initialisms that golint suggests,
for example:

    Line 116: func GetHtmlRenderer should be GetHTMLRenderer

as see on http://goreportcard.com/report/spf13/hugo

Thanks to @bep for the idea!

Note that command-line flags (cobra and pflag)
as well as struct fields like .BaseUrl and .Url
that are used in Go HTML templates need more work
to maintain backward-compatibility, and thus
are NOT yet dealt with in this commit.

First step in fixing #959.
2015-03-11 21:55:00 +01:00
bep
f85d1a7da2 parser: add some frontmatter test cases 2015-03-10 23:17:39 +01:00
bep
63ffb916d6 parser: apply some Golint rules 2015-03-07 12:59:04 +01:00
Anthony Fok
a0c6dba305 Upgrade from gopkg.in/yaml.v1 to gopkg.in/yaml.v2 2015-01-24 04:30:00 -07:00
Tatsushi Demachi
78e9229c52 Fix "hugo new" EOF error with an archetype file without the final EOL
This rewrites `extractFrontMatterDelims` function to make it work with
an archetype file without the final EOL and adds more detailed error
messages and comments.

It also removes `matches` and `matches_quick` functions which aren't
called anywhere.
2015-01-10 19:48:35 +01:00
Andrew Gerrand
634d7b2638 switch to new location of goyaml 2014-08-18 11:31:55 -04:00
spf13
6b9d4a93da Adding new commands (new site [path], new theme [name]) 2014-05-08 18:30:58 -04:00
spf13
6d9a2d2497 adding a front matter format to lead rune method 2014-05-02 01:01:44 -04:00
spf13
cbd9506c29 moving front matter parsing (and creation) to parse package 2014-05-01 13:20:09 -04:00
Mike Keesey
2540d884d8 Fixing issues go vet reports. 2014-03-01 09:56:17 -05:00
Ask Bjørn Hansen
1dbed5ee06 Call the json delimiter 'json_lead' instead of 'java_lead' 2014-02-18 18:44:27 -05:00
spf13
8055838c70 Allowing empty files (ignored) so you can touch a new file while watching 2013-12-28 13:47:34 -05:00
Egon Elbre
1c60d5bf20 Don't shutdown hugo on an empty file. 2013-12-28 13:47:21 -05:00
spf13
18f2b82658 Switching to the rjson library which is more friendly to human generated json. 2013-10-01 22:45:24 -04:00
Noah Campbell
67b2abaf09 Add IsRenderable to Page
As pages are read from the target, they will be assessed if they should
be rendered or not.  The logic for IsRenderable is in the parser/page.go
and looks for anything exception '<'.
2013-09-18 10:17:43 -07:00
Noah Campbell
d8e1834910 Fix parsing edge case of frontmatter
When the frontmatter contains a - (or other delimiter) close to the
closing frontmatter delimiter, frontmatter detection would fail.
2013-09-18 09:15:46 -07:00
Noah Campbell
a82efe5bb1 Merge remote-tracking branch 'origin/parser' into mrg_praser
Also brought in parse for github.com/noahcampbell/akebia

Conflicts:
	hugolib/page.go
	hugolib/page_test.go
2013-09-17 15:52:40 -07:00