Commit graph

492 commits

Author SHA1 Message Date
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
Noah Campbell
d45fb72f67 Add /index.html to unadorned alias paths
Bring code to be better in line with documentation.
2013-09-13 14:51:28 -07:00
Noah Campbell
803a0fce1e Remove RenderedContent from page.
The output is written directly to disk after being written.  Not
entirely sure why it was split into two steps.
2013-09-13 10:30:27 -07:00
Noah Campbell
74b55fc7c8 Normalize paths within hugo
filepath was used inconsistently throughout the hugolib.  With the
introduction of source and target modules, all path are normalized to
"/".  This simplifies the processing of paths.  It does mean that
contributors need to be aware of using path/filepath in any module other
than source or target is not recommended.  The current exception is
hugolib/config.go
2013-09-12 10:48:59 -07:00
Noah Campbell
d4d9da9f3a Remove page module dependence on opening files
The site is responsible for reading files, page only operates on
buffers.
2013-09-04 19:36:06 -07:00
Noah Campbell
79d9f82e79 Code reorg, helpers.go has been decomposed.
It started with wanting to move templates in template bundles and the
rest followed.  I did my best to start grouping related functions
together, but there are some that I missed.  There is also the method
Urlize that seems to be a special function used in both worlds.  I'll
need to revisit this method.
2013-09-03 16:16:07 -07:00
Noah Campbell
3ecc698f5e Remove hugolib.HTML and hugolib.URL types
These types were not be rendered correctly by the html/template package.
Removing them gets the correct behavior.

Fixes #74
2013-09-03 12:43:56 -07:00
Fabrizio (Misto) Milo
ba82a20321 Add support for amber files
If a layout file ends with .amber it will interpreted as a Amber file

Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-09-01 19:51:32 -07:00
Fabrizio (Misto) Milo
ee5865f239 Abstract html/template dependency
Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-09-01 19:51:27 -07:00
Mark Sanborn
6c8e7edbb4 The <!--more--> (summary divider) now works even if it is on the same line as content
Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-09-01 07:44:29 -07:00
Noah Campbell
bc3c229002 Ensure Section is set before returning Page object. 2013-08-30 20:13:22 -07:00
Fabrizio (Misto) Milo
3ab5245049 clean up logic
Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-08-28 20:39:58 -07:00
Noah Campbell
554375b2ad Using new parser. 2013-08-25 20:27:03 -07:00
Ross Lawley
9930011ea2 Wordpress summaries
Allow full control of summaries which can be rendered as html rather
than text.  Using a `<!--more-->` html comment in your markdown / rst
you can indiciate where the summary should end and have the summary
converted to html.

Signed-off-by: Noah Campbell <noahcampbell@gmail.com>

Conflicts:
	hugolib/page_test.go
2013-08-23 16:46:19 -07:00
Noah Campbell
599e6672f7 Removing GetSection
Using GetXXX is not idiomatic to Go.  Also added a bunch of unit testing
around this method.
2013-08-23 14:14:54 -07:00
elij
b9e835b101 avoid handling a redirect from slug to slug/
because the url lacks a trailing /, many webservers will issue a
redirect to the canonical url with trailing slash for directory index
w/index.htm(l).
Append a slash to avoid this.
2013-08-16 13:14:20 -07:00
spf13
480e01eb15 Further work on path/section stuff. Tests passing now. 2013-08-14 08:57:14 -04:00
spf13
b4bcc591e4 Now support for nested paths. Better section detection. 2013-08-13 19:39:24 -04:00
spf13
d5518c0966 Adding support for aliases (redirects) 2013-08-10 15:35:34 +01:00
spf13
45ce6e2b30 Merge branch 'redirect' of https://github.com/rozza/hugo into rozza-redirect
Conflicts:
	hugolib/page.go
2013-08-10 14:08:38 +01:00
Noah Campbell
e26b43f6d9 Adding more test cases 2013-08-09 17:36:32 -07:00
Noah Campbell
085ce15f7c Adding ability to read from io.Reader
This allows for testing without relying on the file system.  Parsing algorithm to not read the entire file into memory.
2013-08-09 17:36:32 -07:00
Noah Campbell
274d324c8b Introduce unit testing for page.go 2013-08-09 17:36:32 -07:00
Noah Campbell
0595f27e6d Using a composite literal to create a page.
Wonder why the need for composite structs.  Not sure if my go knowledge is lacking or if this is cruft from other programming language doctrine.
2013-08-09 17:36:32 -07:00
Noah Campbell
19538a1bd6 Support pages without folders 2013-08-09 17:36:31 -07:00
Ross Lawley
e2a28114d1 Add redirect to page parameters and redirects example 2013-08-09 21:57:22 +01:00
Noah Campbell
c9a09418e7 Fixed section labels causing panic on windows.
The filename path was being split using a unix specific path seperator.  This fix uses the os.PathSeperator to ensure proper evaluation regardless of platform.
2013-08-01 13:27:56 -07:00
spf13
92c31bbe10 permalink now respects pretty urls 2013-07-26 09:56:00 -04:00
spf13
8fae5f0dd6 Default is now pretty urls (without .html)
Adding --uglyurls option to retain previous behavior
2013-07-19 00:10:42 -07:00
spf13
e76c3feb52 Fix bug with JSON front matter parsing. 2013-07-09 19:04:22 -04:00
spf13
a6914e9c4c Better error handling for parsing front matter 2013-07-09 18:53:08 -04:00
tycho garen
4951ff998c rst: fixing rst output processing 2013-07-09 08:16:29 -04:00
spf13
d2a6267ad7 Adding support for TOML, updating documentation 2013-07-08 22:23:54 -04:00
spf13
3c80cd323c YAML support similar to jekyll (start and end with '---') 2013-07-08 17:57:01 -04:00
tycho garen
f851c4162b fix: changing terminal yaml line, generalizing forematter splitting 2013-07-07 10:01:53 -04:00
tycho garen
b024454ea9 fixes: returning json parsing, error messages, yaml header offsets 2013-07-07 01:03:12 -04:00
tycho garen
67f4da30b1 revert: adding json support 2013-07-06 23:52:14 -04:00
tycho garen
6c42d3d490 fix: parsing of yaml forematter 2013-07-06 23:37:47 -04:00
tycho garen
431fa0e2d7 changing to suport yaml rather than json and adding optional restructuredtext support 2013-07-06 22:48:12 -04:00
tycho garen
a7f5f97bc2 sanity: move from json to yaml 2013-07-06 22:32:50 -04:00
spf13
6e16449e5f adding hugo 2013-07-04 11:32:55 -04:00