summaryrefslogtreecommitdiffstats
path: root/hugolib/page_permalink_test.go
AgeCommit message (Collapse)Author
2017-06-13all: Update import paths to gohugoio/hugoBjørn Erik Pedersen
2017-03-27Remove the now superflous defaultExtensionBjørn Erik Pedersen
And some other unsed fields and methods.
2017-02-17all: Refactor to nonglobal Viper, i18n etc.Bjørn Erik Pedersen
This is a final rewrite that removes all the global state in Hugo, which also enables the use if `t.Parallel` in tests. Updates #2701 Fixes #3016
2017-02-04all: Refactor to nonglobal file systemsBjørn Erik Pedersen
Updates #2701 Fixes #2951
2016-11-22node to page: Fix the Page copy()Bjørn Erik Pedersen
By embeding the init sync.Once var in a pointer so we can reset it when we copy the page. Updates #2297
2016-11-22node to page: Handle URLsBjørn Erik Pedersen
This includes removing the error return value from Permalink and RelPermalink. We ignore that error all over the place, so we might as well remove it. Updates #2297
2016-11-22node to page: Remove NodeBjørn Erik Pedersen
And misc. TODO-fixes Updates #2297
2016-11-22node to page: Rename PageType to KindBjørn Erik Pedersen
And embed that on Page. Updates #2297
2016-11-22node to page: Add Pages to PageBjørn Erik Pedersen
As an alias to .Data.Pages for home page etc. Also renamte NodeType to PageType and make it a string so it can be used in `where`. Updates #2297
2016-10-24all: Unify case of config variable namesAlbert Nigmatzianov
All config variables starts with low-case and uses camelCase. If there is abbreviation at the beginning of the name, the whole abbreviation will be written in low-case. If there is abbreviation at the end of the name, the whole abbreviation will be written in upper-case. For example, rssURI.
2016-10-24Avoid reading from Viper for path and URL funcsBjørn Erik Pedersen
The gain, given the "real sites benchmark" below, is obvious: ``` benchmark old ns/op new ns/op delta BenchmarkHugo-4 14497594101 13084156335 -9.75% benchmark old allocs new allocs delta BenchmarkHugo-4 57404335 48282002 -15.89% benchmark old bytes new bytes delta BenchmarkHugo-4 9933505624 9721984424 -2.13% ``` Fixes #2495
2016-09-06Make it possible to configure Blackfroday per languageBjørn Erik Pedersen
See #2309
2016-09-06Optimize the multilanguage build processBjørn Erik Pedersen
Work In Progress! This commit makes a rework of the build and rebuild process to better suit a multi-site setup. This also includes a complete overhaul of the site tests. Previous these were a messy mix that were testing just small parts of the build chain, some of it testing code-paths not even used in "real life". Now all tests that depends on a built site follows the same and real production code path. See #2309 Closes #2211 Closes #477 Closes #1744
2015-12-10Add copyright header to that source files that don’t have one.Anthony Fok
See #1646
2015-05-28Support `Fish and Chips` sectionbep
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-28Add some missing page permalink test casesbep
2015-05-27Never remove trailing slash in RelPermalinkbep
Fixed #1174
2015-05-20Stop Viper from leaking across many of the tests (now tests pass regardless ↵spf13
of order tested)
2015-03-18More initialism corrections (golint)Anthony Fok
Thanks to @bep's new, brilliant helpers.Deprecated() function, the following functions or variables are transitioned to their new names, preserving backward compatibility for v0.14 and warning the user of upcoming obsolescence in v0.15: * .Url → .URL (for node, menu and paginator) * .Site.BaseUrl → .Site.BaseURL * .Site.Indexes → .Site.Taxonomies * .Site.Recent → .Site.Pages * getJson → getJSON * getCsv → getCSV * safeHtml → safeHTML * safeCss → safeCSS * safeUrl → safeURL Also fix related initialisms in strings and comments. Continued effort in fixing #959.
2015-03-11Correct initialisms as suggested by golintAnthony Fok
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-01-23Fix RelPermalink() and Urls in menus vs canonifyUrlsbep
canonifyUrls=true, RelPermalink and baseUrl with sub-path did not work. This fixes that by adding a check for canonifyUrl=trues=true in RelPermalink(). So given - baseUrl "http://somehost.com/sub/" - the path "some-path/file.html" For canonifyUrls=false RelPermalink() returns "/sub/some-path/file.html" For canonifyUrls=true RelPermalink() returns "/some-path/file.html" In the last case, the Url will be made absolute and clickable in a later step. This commit also makes the menu urls defined in site config releative. To make them work with canonifying of urls, the context root is prepended if canonifying is turned off. Fixes #519 Fixes #711
2014-12-09Fix various Windows-issuesbep
File handling was broken on Windows. This commit contains a revision of the path handling with separation of file paths and urls where needed. There may be remaining issues and there may be better ways to do this, but it is easier to start that refactoring job with a set of passing tests. Fixes #687 Fixes #660
2014-10-16Big refactor of how source files are used. Also added default destination ↵spf13
extension option.
2014-08-25Fix #302. Links now have trailing slashes.spf13
2014-08-25Support subdir in baseurl.Nate Finch
Mainly this was a change to helpers.MakePermalink, but to get the local server to run correctly, we needed to redirect the path of the request from /foo to /. In addition, I added tests for the server's code for fixing up the base url with different config file & CLI options.
2014-05-28SiteInfo is now a pointer on the Nodespf13
2014-04-07Fixing all tests to pass with new Viper Configspf13
2014-02-28Make per-page url overrides take precedence over section permalink settingsAsk Bjørn Hansen
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-27Reorganization of helpers. Centralized Url/Path logic. Fixed #175.spf13
2014-02-02Fix permalink bug in uglyurls mode (refs #187).Anton Ageev
2013-11-20fixed trailing dir slash when using slugTim Esselens
See testcase, dir + slug contained double slash when dir had a trailing slash. Signed-off-by: Noah Campbell <noahcampbell@gmail.com>
2013-10-08Permalink to include multiple directories levelsNoah Campbell
2013-10-08Test case for permalink functionalityNoah Campbell
2013-10-08Refactor layout selection codeNoah Campbell
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.