Commit graph

518 commits

Author SHA1 Message Date
Bjørn Erik Pedersen f25ce7fefa Revert "Move matchRender to test helpers file"
This reverts commit 32d91d616e.
2015-06-21 15:01:02 +02:00
Bjørn Erik Pedersen d770fa59a5 Revert "Add tests for homepage content support"
This reverts commit 24351c58be.
2015-06-21 15:01:01 +02:00
Bjørn Erik Pedersen 59c6ba4e45 Revert "Make .IsHome work when homepage as page"
This reverts commit 7e765cc1bd.
2015-06-21 15:00:53 +02:00
spf13 7e765cc1bd Make .IsHome work when homepage as page 2015-06-19 10:07:47 -04:00
spf13 24351c58be Add tests for homepage content support 2015-06-17 12:35:44 -04:00
spf13 32d91d616e Move matchRender to test helpers file 2015-06-17 10:47:49 -04:00
spf13 99e250917d refactor and clean up site tests 2015-06-17 10:47:49 -04:00
spf13 5f84bc02cd add preliminary support for content/index.md file to be homepage content 2015-06-17 10:47:49 -04:00
bep be6cf6a9c6 Revert "Add some debug to failing menu test"
This reverts commit becc627e1e.
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
bep bed8197de5 Move Viper reset to correct level in menu tests 2015-06-11 22:41:17 +02:00
bep beda46d289 Reset Viper for every duplicate menu test iteration 2015-06-11 21:22:29 +02:00
bep be44345272 Silence chatty JSON test 2015-06-06 20:57:13 +02:00
bep be38acdce7 Add PreserveTaxonomyNames flag
Before this commit, taxonomy names were hyphenated, lower-cased and normalized -- then fixed and titleized on the archive page.

So what you entered in the front matter isn't necessarily what you got in the final site.

To preserve backwards compability, `PreserveTaxonomyNames` is default `false`.

Setting it to `true` will preserve what you type (the first characters is made toupper for titles), but normalized in URLs.

This also means that, if you manually construct URLs to the archive pages, you will have to pass the Taxonomy names through the `urlize` func.

Fixes #1180
2015-05-31 20:30:53 +02:00
bep be0903c71a Fix FullFilePath
Fixes #732
2015-05-31 18:54:20 +02:00
Artem Vorotnikov 3cee9b7786 Allow custom RSS Uri for section and taxonomy feeds
Fixes #1147
2015-05-31 15:59:51 +02:00
bep be7404e337 Support Fish and Chips section
Section names are also used as the title of the list pages, but naming section folders as `Fish and Chips` and similar didn't work very well.

This commit fixes that.

This commit also changes the title casing of the section titles. Some may argue that this is a breaking change, but the old behaviour was also pretty broken,
even for languages that use title capitalizations, as it didn't follow any particular style guide, `fish and chips` became `Fish And Chips` etc.

Now it just turns the first letter into upper case, so `Fish and Chips` will be left as `Fish and Chips`.

People wanting the good old behaviour can use the `title` template func.

Fixes #1176
2015-05-28 23:05:17 +02:00
bep be535832f7 Add IsHome
To determine if a page is the "Home Page" has inspired lots of creativity in the template department.

This commit makes it simpler: IsHome will tell the truth.
2015-05-28 03:20:08 +02:00
bep be6dfcc495 Add some missing page permalink test cases 2015-05-28 02:30:01 +02:00
bep be964e95a1 Never remove trailing slash in RelPermalink
Fixed #1174
2015-05-27 20:41:43 +02:00
bep bec697b0d5 Remove unused Completed chan on Site
See #1160
2015-05-23 22:13:07 +02:00
bep be7c3bbb09 Prevent cyclic ref crash in JSON encode
Note that this commit makes no promise about great JSON output from the encoder, but the cyclic refs should be broken.

Fixes #1123
2015-05-23 12:28:08 +02:00
bep be0784bbe9 Grammar fix in error message 2015-05-21 23:04:46 +02:00
bep be7f5a4268 Do not consider single.html for the home page
Fixes #1152
2015-05-21 20:12:18 +02:00
spf13 fc946ded29 Adding default handler & tests Fixes #147 2015-05-20 18:55:24 -04:00
spf13 bdb187e482 Merge branch 'master' of GitHub.com:spf13/hugo 2015-05-20 18:48:33 -04:00
spf13 a584ff207b Stop Viper from leaking across many of the tests (now tests pass regardless of order tested) 2015-05-20 02:21:21 -04:00
bep be0262786e Add benchmark test for replaceShortcodeTokens 2015-05-19 22:00:48 +02:00
Takuya Wakisaka 2890b6db36 Fix UTF8 permalink
Generate unencoded directory in public dir.

Fixes #988
2015-05-17 14:54:59 +02:00
Takuya Wakisaka 8a96234b1f Add Page tests with UTF8 paths
See #988
2015-05-17 14:54:27 +02:00
bep beaa8b1bca Add support for URLs relative to context root
Setting `RelativeURLs` to `true` will make all relative URLs in the site *really* relative.

And will do so with speed.

So:

In `/post/myblogpost.html`:

`/mycss.css` becomes `../mycss.css`

The same in `/index.html` will become:

`./mycss.css` etc.

Note that absolute URLs will not be touched (either external resources, or URLs constructed with `BaseURL`).

The speediness is about the same as before:

```
benchmark                    old ns/op     new ns/op     delta
BenchmarkAbsURL              17462         18164         +4.02%
BenchmarkAbsURLSrcset        18842         19632         +4.19%
BenchmarkXMLAbsURLSrcset     18643         19313         +3.59%
BenchmarkXMLAbsURL           9283          9656          +4.02%

benchmark                    old allocs     new allocs     delta
BenchmarkAbsURL              24             28             +16.67%
BenchmarkAbsURLSrcset        29             32             +10.34%
BenchmarkXMLAbsURLSrcset     27             30             +11.11%
BenchmarkXMLAbsURL           12             14             +16.67%

benchmark                    old bytes     new bytes     delta
BenchmarkAbsURL              3154          3404          +7.93%
BenchmarkAbsURLSrcset        2376          2573          +8.29%
BenchmarkXMLAbsURLSrcset     2569          2763          +7.55%
BenchmarkXMLAbsURL           1888          1998          +5.83%

```

Fixes #1104
Fixes #622
Fixes #937
Fixes #157
2015-05-16 00:11:44 +02:00
Juan B. Rodriguez d0a4645a34 Set s.Info.LastChange to Lastmod
Set sitemap.xml <lastmod> field to Lastmod.

See #733
2015-05-15 13:10:11 +02:00
Juan B. Rodriguez 3882e7ceaf Add Lastmod field
Create new field in Node
Update Page to look for lastmod field in the front matter. If not present, then assign Date to Lastmod
Update Site, to assign a value to Lastmod (based on the same logic used for Date)

Fixes #733
2015-05-15 13:09:30 +02:00
David Calavera d5c77bdf68 Allow to reverse taxonomy entries. 2015-05-12 18:26:40 +02:00
bep bec90e0850 Make page 1 alias ugly
When `uglyurls = true`

Fixes #1121
2015-05-10 18:28:44 +02:00
bep 0e00ca6a6e Fix paginator with uglyurls
Fixes #1120
2015-05-10 15:23:36 +02:00
bep bef496b97e Fix .Truncated in manual summaries
Fixes #1119
2015-05-10 13:34:02 +02:00
bep be325a3088 Fix IsMenuCurrent for SectionPagesMenu
Pretty sure it has worked at some point, but that PR probably has been rebased to pieces.

This refactors the fix by @dannys42 into a method, as this URL fix is applied several places.

Fixes #1114
2015-05-09 20:53:58 +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
Danny Sung 2b91b480d0 IsMenuCurrent now resolving correctly when baseUrl is not at the root path 2015-05-08 22:22:50 -04:00
Anthony Fok 563a6302a0 Very experimental support for mmark
Either name the content files as `*.mmark`,
or add `markup = "mmark"` in the front matter
of your `*.md` content files.
2015-05-08 22:05:41 -04:00
bep d4acacd4f5 Section menu for the lazy blogger
The current menu system works great, but is too much work if all you want is a simple menu with the sections as menu items, and having these menu items connected to the pages in a way that enables setting the correct menu item as active for both the section lists and the pages itself.

This commit adds a new option `SectionPagesMenu' which, if set, will create a new menu with that name with all the sections as menu items. The pages in the sections will behave as "shadow members" of these section items as `blogpage.HasMenuCurrent "sectionmenu" $sectionmenuitem` will return true.

If a menu item with the same `identifier` is defined in site config, *that* item will take precedence.
2015-05-08 21:28:19 -04:00
bep beb4ab162d Make RSS output test more realistic
By setting a non-default RSS uri config value.
2015-05-08 20:33:37 +02:00
Dana H. P'Simer fd08e16ec8 Add RSSUri to specify the name of the RSS file 2015-05-07 22:20:00 +02:00
bep bec2c1e37a Add shortcode support for HTML files
Fixes #674
2015-05-06 19:11:42 +02:00
bep bea9280fb3 Do not add trailing slash to baseURL
Fixes #1105
2015-05-05 16:02:44 +02:00
bep be9df84772 shortcodeparser: fix panic on slash following opening shortcode comment
Fixes #1093
2015-04-30 15:59:07 +02:00
bep be15b07733 Fix typo in test 2015-04-29 19:22:11 +02:00
bep bee1358e48 Return error from HandleShortcodes
To be able to test for it.
2015-04-29 19:08:27 +02:00
bep be2c67ad45 Fix broken Travis tests
No idea why these suddenly starts to fail.
2015-04-22 18:59:42 +02:00