Commit graph

93 commits

Author SHA1 Message Date
Vincent Batoufflet
2a902bbca6 Add Sitemaps config values handling 2014-05-09 23:11:33 -04:00
spf13
08c30b6e44 Using new helpers in page.go 2014-05-02 01:04:48 -04:00
spf13
fb7d45e613 permitting empty files again. Fixing some tests to now pass. 2014-05-01 14:11:56 -04:00
spf13
859a78e1bd Providing the ability to save (write) a content's source file. 2014-05-01 13:21:37 -04:00
spf13
1302ef9f63 Making site page initialization a bit more granular and accessible 2014-05-01 13:20:58 -04:00
spf13
cbd9506c29 moving front matter parsing (and creation) to parse package 2014-05-01 13:20:09 -04:00
spf13
bdf7cd9f9d Creating site menu configuration and have the docs site use it 2014-04-24 16:11:08 -06:00
spf13
9ecf58e29b new menus system including active link & nesting 2014-04-23 02:59:19 -04:00
spf13
69c1944f1f Add handling of deeply nested front matter 2014-04-23 02:55:43 -04:00
spf13
4a8de8ea46 Add Disqus support out of the box. Move template/bundle into hugolib. 2014-04-23 02:53:12 -04:00
spf13
c8269d6dbc Making node.Keywords the correct length 2014-04-08 21:40:03 -04:00
spf13
62dd1d45c1 Hugo config abstracted into a general purpose config library called "Viper".
Hugo casting now in own library called "cast"
2014-04-05 01:40:33 -04:00
spf13
e50b9d8ac1 Adding support for logging & verbose logging. Consolidation of error handling. Integration of jWalterWeatherman library. Fixed #137 2014-03-31 13:23:34 -04:00
Ask Bjørn Hansen
0becad727a Make error message when encountering unrecognized file extensions more helpful 2014-02-28 22:11:41 -05:00
Ask Bjørn Hansen
ea8d0981d5 Make per-page url overrides take precedence over section permalink settings
This seems more reasonable to me.

I didn't understand why the pUrl comparision was on len > 2; I changed it to 0.

Closes #212.
2014-02-28 11:55:37 -05:00
spf13
14227351fa Reorganization of helpers. Centralized Url/Path logic. Fixed #175. 2014-02-27 20:33:18 -05:00
Anton Ageev
72ba6d633d Fix permalink bug in uglyurls mode (refs #187). 2014-02-02 00:56:01 -05:00
Niels Widger
c1b9380dfd Add back blackfriday extensions during Markdown conversion
Modified markdownRender and markdownRenderWithTOC in hugolib/page.go to
use the same flags and extensions as were previously used when we simply
called blackfriday.MarkdownCommon to convert Markdown to HTML.  These
flags/extensions were dropped during the refactor that added the
`.TableOfContents` page variable, and caused features like Markdown
tables to no longer work.

Modified the expected output for TestTableOfContents in page_test.go,
apparently changing the flags/extensions caused an `—` to become
`–`.
2014-01-30 23:04:37 -05:00
Tibor Vass
6dd2e9a49a gofmt all go code 2014-01-29 18:03:35 -05:00
spf13
1882ffabc6 Adding support for boolean params 2014-01-28 23:24:59 -05:00
spf13
1da3fd039a Continue with TOC integration and page refactor. Updated a few tests to match new generated output. 2014-01-28 23:11:05 -05:00
spf13
9666f33e2f Don’t render short codes on summary twice 2014-01-27 17:32:36 -05:00
spf13
d0825a211a Big refactor of pages code. Changed TOC code to only parse when actually used 2014-01-27 17:20:20 -05:00
Niels Widger
f62e3e9940 Add new TableOfContents Page variable (Markdown only)
Added TableOfContents field to hugolib.Page struct.  New function
getTableOfContents is used in convertMarkdown to set the TableOfContents
field.

Added new test file hugolib/page_toc_test.go with a simple test of the
new functionality.

Conflicts:
	hugolib/page.go
2014-01-23 17:27:08 -05:00
spf13
3851117c25 renaming MinRead to ReadingTime and adding to documentation. 2014-01-21 20:08:24 -05:00
spf13
065928fcf0 Adding page sorting by weight function (the default) 2013-12-28 12:56:12 -05:00
spf13
70745e8cb5 Complete refactor of indexes, move (and rewrite) page sorting to page.go, add tests 2013-12-20 09:10:05 -05:00
spf13
0e04b9a029 Moving processing short codes to the page 2013-12-06 23:57:24 -05:00
spf13
d0ef3d43bd better handling of detecting markup format 2013-12-06 23:56:51 -05:00
spf13
f432b187a0 render shortcodes prior to converting to html 2013-12-06 23:32:00 -05:00
spf13
44d57fdc0c Reorganize helpers 2013-12-05 09:29:41 -05:00
Tim Esselens
860f982cc4 fixed trailing dir slash when using slug
See testcase, dir + slug contained double slash when dir had a trailing
slash.

Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-11-20 15:32:22 -08:00
Phil Pennock
07978e4a49 configurable permalinks support
A sample config.yaml for a site might contain:

```yaml
permalinks:
  post: /:year/:month/:title/
```

Then, any article in the `post` section, will have the canonical URL
formed via the permalink specification given.

Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-11-18 13:32:56 -08:00
Phil Pennock
40d05f12a7 Truncated; .Site.Params; First function
* Add `.Truncated` bool to each page; will be set true if the
  `.Summary` is truncated and it's worth showing a "more" link of some
  kind.
* Add `Params` to the site config, defining `.Site.Params` accessible
  to each page; this lets the site maintainer associate arbitrary data
  with names, on a site-wide basis.
* Provide a `First` function to templates:
  * Use-case: `{{range First 5 .Site.Recent}}` or anything else which
    is a simple iterable provided by hugolib
* Tests by me for `.Truncated` and `First`

Also @noahcampbell contributed towards this:

* Add UnitTest for `.Site.Params`:
> Digging into this test case a bit more, I'm realizing that we need
> to create a param test case to ensure that for each type we render
> (page, index, homepage, rss, etc.) that the proper fields are
> represented.  This will help us refactor without fear in the
> future.

Sample config.yaml:

```yaml
title: "Test site"
params:
  Subtitle: "More tests always good"
  AuthorName: "John Doe"
  SidebarRecentLimit: 5
```

Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-11-12 22:49:54 +00:00
spf13
9388f23606 Adding support for linkTitles 2013-10-25 18:37:53 -04:00
spf13
471fb1ff69 Adding support for date field in front matter as date (as TOML provides) 2013-10-24 15:18:57 -07:00
spf13
f3c816eabd Adding support for more front matter types (int, float & date) 2013-10-24 14:31:04 -07:00
spf13
3558e3d6f0 Add support for weighted pages
Now pages can be sorted by other than date
2013-10-18 11:01:31 -04:00
spf13
4263094d75 Adding support for MinRead. Closed #106 2013-10-15 09:32:21 -04:00
spf13
be5ace1588 Wordcount restored. fixed #92 2013-10-15 09:15:52 -04:00
Noah Campbell
4993152dda Permalink to include multiple directories levels 2013-10-08 18:44:15 +02:00
Noah Campbell
9500ec1b6b Refactor layout selection code
The render code path would use a fallback if there was an exception.
This change instead relies on explicit declaration of the layout to use
and includes a check to see if the layout indeed exists before
attempting to render it.
2013-10-08 18:44:15 +02:00
Noah Campbell
197aacb647 Add support for Relative Permalinks 2013-10-08 18:42:03 +02:00
Noah Campbell
06da609138 Refactor Permalink to private function
This will allow for reuse of this particular function.
2013-10-08 18:42:03 +02:00
spf13
266f583a8c Restoring former snippet behavior & adding test to ensure future behavior 2013-10-04 12:28:28 -04: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
db50154e75 Support index.html indexes in content directory
If a file named index.html exists in a directory, or root, it will be
rendered as if ugly urls are turned on.  This allows for top level
content to not need a supporting layout file and content in content.
This change should not affect anyone who is using the perscribed way.

I also cleaned up a bunch of one off functions in site.go.
2013-09-24 21:27:25 -07:00
Noah Campbell
bffe4baf42 Create a TargetPath() method that provides OutFile
Moved the generation of the target path to the page breaking all
dependecies on Site.
2013-09-20 17:24:25 -07:00
Noah Campbell
52e8c7a0ac Section is determined by the source, not the url
This change allows for top level html content to exists.
2013-09-20 17:03:43 -07:00
Noah Campbell
311e102223 Allow non-markdown content in content directory
Allow content that is not markdown and does not need to be rendered to
exists in the content directory.  Currently any valid html or xml
document can exist.  Templates are applied to these documents as well.
If you need to have content that doesn't have templates or AbsUrlify
like operations, then continue to put this content in static and it will
be copied over.
2013-09-18 14:21:27 -07:00