summaryrefslogtreecommitdiffstats
path: root/hugolib/site_test.go
Commit message (Collapse)AuthorAge
...
* Render the shortcodes as late as possibleBjørn Erik Pedersen2016-09-06
| | | | | | | | | | | | | | | | This is needed to make shortcode users happy with the new multilanguage support, but it will also solve many other related posts about "stuff not available in the shortcode". We will have to revisit this re the handler chain at some point, but that will be easier now as the integration test story has improved so much. As part of this commit, the site-building tests in page_test.go is refreshed, they now tests for all the rendering engines (when available), and all of them now uses the same code-path as used in production. Fixes #1229 Fixes #2323 Fixes ##1076
* Optimize the multilanguage build processBjørn Erik Pedersen2016-09-06
| | | | | | | | | | | | | | | 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
* Add Translations and AllTranslations to NodeBjørn Erik Pedersen2016-09-06
| | | | | | This commit also consolidates URLs on Node vs Page, so now .Permalink should be interoperable. Note that this implementations should be fairly short-livded, waiting for #2297, but the API should be stable.
* Introduce HugoSites typeBjørn Erik Pedersen2016-09-06
| | | | | | | | | | And a Hugo global variable which contains the site under build. This is really needed to get some level of control of the "multiple languages" in play. There are still work related to this scattered around, but that will come. With this commit, the multilingual feature is starting to work.
* Add Translations and AllTranslations methods to PageBjørn Erik Pedersen2016-09-06
| | | | Will revisit Node later.
* Add proper Language and Languages typesBjørn Erik Pedersen2016-09-06
|
* Add multilingual support in HugoAlexandre Bourget2016-09-06
| | | | | | | | | | | | | | | | | | | | | | | | | Implements: * support to render: * content/post/whatever.en.md to /en/2015/12/22/whatever/index.html * content/post/whatever.fr.md to /fr/2015/12/22/whatever/index.html * gets enabled when `Multilingual:` is specified in config. * support having language switchers in templates, that know where the translated page is (with .Page.Translations) (when you're on /en/about/, you can have a "Francais" link pointing to /fr/a-propos/) * all translations are in the `.Page.Translations` map, including the current one. * easily tweak themes to support Multilingual mode * renders in a single swift, no need for two config files. Adds a couple of variables useful for multilingual sites Adds documentation (content/multilingual.md) Added language prefixing for all URL generation/permalinking see in the code base. Implements i18n. Leverages the great github.com/nicksnyder/go-i18n lib.. thanks Nick. * Adds "i18n" and "T" template functions..
* hugolib: Use named keys in composite literalsCameron Moore2016-08-19
| | | Make `go vet` great again
* hugolib: Support an expiration dateHanchen Wang2016-06-14
|
* Add some schemaless BaseURL testsBjørn Erik Pedersen2016-04-17
| | | | See #2085
* Fix broken testsBjørn Erik Pedersen2016-04-12
|
* Revert "Use Node.ID for anchor ID"Bjørn Erik Pedersen2016-04-12
| | | | This reverts commit cd558958a0c0ecd06f7560a38e27334fe983e0de.
* Use Node.ID for anchor IDBjørn Erik Pedersen2016-04-11
| | | | Fixes #2057
* Make Hugo build without MercurialBjørn Erik Pedersen2016-04-08
| | | | | | | By creating a fork of the Bitbucket inflect repo. It hasn't changed since 2013, so it must be considered pretty stable. Fixes #2062
* hugolib: Un-export internal Site-methodsBjørn Erik Pedersen2016-04-08
| | | | | | | These are obviously internal and for the most part undocumented, creating lots of GoLint warnings. See #1160 See #2014
* Document and clean SourceRelativeLinksEval codeSven Dowideit2016-04-07
|
* hugolib: Camelcase ALL_CAPS vars and const in testsBjørn Erik Pedersen2016-04-07
| | | | See #2014
* Add readFile template funcBjørn Erik Pedersen2016-03-31
| | | | | | | | | | This also includes a refactor of the hugofs package and its usage. The motivation for that is: The Afero filesystems are brilliant. Hugo's way of adding a dozen of global variables for the different filesystems was a mistake. In readFile (and also in some other places in Hugo today) we need a way to restrict the access inside the working dir. We could use ioutil.ReadFile and implement the path checking, checking the base path and the dots ("..") etc. But it is obviously better to use an Afero BasePathFs combined witha ReadOnlyFs. We could create a use-once-filesystem and handle the initialization ourselves, but since this is also useful to others and the initialization depends on some other global state (which would mean to create a new file system on every invocation), we might as well do it properly and encapsulate the predefined set of filesystems. This change also leads the way, if needed, to encapsulate the file systems in a struct, making it possible to have several file system sets in action at once (parallel multilanguage site building? With Moore's law and all...) Fixes #1551
* hugolib: Even more Golint fixesBjørn Erik Pedersen2016-03-24
|
* hugolib: Remove unused codeBjørn Erik Pedersen2016-03-14
|
* Create template clone for late template executionBjørn Erik Pedersen2016-03-09
| | | | | | Fixing some breaking blogs on Go 1.6 Fixes #1879
* Simplify the IsHome test casesBjørn Erik Pedersen2016-03-06
|
* Unexport the target handlersBjørn Erik Pedersen2016-03-05
| | | | These are of no interest outside the package.
* Allow URL with extension in frontmatterBjørn Erik Pedersen2016-03-05
| | | | Fixes #1923
* Add test for Hugo hanging up with empty contentTatsushi Demachi2016-02-08
| | | | This adds a test for the issue #1797 and its fix in 68e2e63.
* Add some trailing newline shortcode testsBjørn Erik Pedersen2016-01-04
| | | | See #1753
* Source file based relative linkingSven Dowideit2016-01-01
| | | | | | ala GitHub repository markdown for both md files and non-md files Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
* Write a simplistic test for site.refLinkSven Dowideit2016-01-01
| | | | Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
* Fix failing template related tests in Go 1.6Bjørn Erik Pedersen2015-12-18
| | | | Fixes #1470
* Fix data race in non-renderable pagesBjørn Erik Pedersen2015-12-18
| | | | Fixes #1601
* Add copyright header to that source files that don’t have one.Anthony Fok2015-12-10
| | | | See #1646
* Complete the Url-to-URL transition in testsAnthony Fok2015-09-13
| | | | See #959
* Strip trailing whitespace in codeAnthony Fok2015-08-04
|
* 404 is homelessBjørn Erik Pedersen2015-06-28
| | | | Fixes #1235
* Remove superfluous p-tags around shortcodesBjørn Erik Pedersen2015-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | This commit replaces the regexp driven `replaceShortcodeTokens` with a handwritten one. It wasnt't possible to handle the p-tags case without breaking performance. This fix actually improves in that area: ``` benchmark old ns/op new ns/op delta BenchmarkParsePage 142738 142667 -0.05% BenchmarkReplaceShortcodeTokens 665590 575645 -13.51% BenchmarkShortcodeLexer 176038 181074 +2.86% benchmark old allocs new allocs delta BenchmarkParsePage 87 87 +0.00% BenchmarkReplaceShortcodeTokens 9631 9424 -2.15% BenchmarkShortcodeLexer 274 274 +0.00% benchmark old bytes new bytes delta BenchmarkParsePage 141830 141830 +0.00% BenchmarkReplaceShortcodeTokens 52275 35219 -32.63% BenchmarkShortcodeLexer 30177 30178 +0.00% ``` Fixes #1148
* Revert "refactor and clean up site tests"Bjørn Erik Pedersen2015-06-21
| | | | This reverts commit 99e250917ddc351d45adfeb81057ea3607d1b148.
* Revert "Move matchRender to test helpers file"Bjørn Erik Pedersen2015-06-21
| | | | This reverts commit 32d91d616e99cd05b59644e292b29be415d5054f.
* Revert "Add tests for homepage content support"Bjørn Erik Pedersen2015-06-21
| | | | This reverts commit 24351c58bedea72e4e113e2d2e5753a32ce2a0e3.
* Add tests for homepage content supportspf132015-06-17
|
* Move matchRender to test helpers filespf132015-06-17
|
* refactor and clean up site testsspf132015-06-17
|
* Support `Fish and Chips` sectionbep2015-05-28
| | | | | | | | | | | | | | | 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
* Add IsHomebep2015-05-28
| | | | | | 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.
* Stop Viper from leaking across many of the tests (now tests pass regardless ↵spf132015-05-20
| | | | of order tested)
* Add Page tests with UTF8 pathsTakuya Wakisaka2015-05-17
| | | | See #988
* Pull Data Files tests into its own filebep2015-03-19
|
* Use ReaderToString in site testsbep2015-03-17
| | | | Since a string is what's really needed.
* Fix crossrefs on Windowsbep2015-03-17
| | | | | | Have to convert path slashes to file path slashes before the URL path is compared to a file path. Fixes #957
* Correct initialisms as suggested by golintAnthony Fok2015-03-11
| | | | | | | | | | | | | | | | | | | 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.
* Fix UglyUrls on Windowsbep2015-03-07
| | | | Fixes #958