summaryrefslogtreecommitdiffstats
path: root/hugolib/site_test.go
AgeCommit message (Collapse)Author
2017-01-10 all: Refactor to nonglobal template handlingBjørn Erik Pedersen
Updates #2701
2017-01-07all: Refactor to non-global loggerBjørn Erik Pedersen
Note that this looks like overkill for just the logger, and that is correct, but this will make sense once we start with the template handling etc. Updates #2701
2016-11-22node to page: Remove NodeBjørn Erik Pedersen
And misc. TODO-fixes Updates #2297
2016-11-22node to page: Make Nodes into PagesBjørn Erik Pedersen
* `.Site.Pages` now contains all page types, including sections etc. * `.Data.Pages` will also contain "node type" pages where relevant. Updates #2297
2016-11-22node to page: Handle aliases, 404, robots.txt, sitemapBjørn Erik Pedersen
Updates #2297
2016-11-22node to page: Basic outlineBjørn Erik Pedersen
Updates #2297
2016-10-28Fix RSS Title regressionBjørn Erik Pedersen
And add tests to make sure it doesn't happen again. Fixes #2645
2016-10-25Add missing template error loggingBjørn Erik Pedersen
2016-10-24Remove now superfluous lowercasingBjørn Erik Pedersen
See #2615 See #1129
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-16Fix case issue Viper vs Blackfriday configBjørn Erik Pedersen
There are still work to be done in the case department, but that will have to be another day. Fixes #2581 See https://github.com/spf13/viper/issues/261
2016-09-14Lazy calculate WordCount, ReadingTime and FuzzyWordCountBjørn Erik Pedersen
This avoids having to execute these expensive operations for sites not using these values. This commit sums up a set of wordcounting and autosummary related performance improvements. The effect of these kind of depends on what features your site use, but a benchmark from 4 Hugo sites in the wild shows promise: ``` benchmark old ns/op new ns/op delta BenchmarkHugo-4 21293005843 20032857342 -5.92% benchmark old allocs new allocs delta BenchmarkHugo-4 65290922 65186032 -0.16% benchmark old bytes new bytes delta BenchmarkHugo-4 9771213416 9681866464 -0.91% ``` Closes #2378
2016-09-06Render main content language in root by defaultBjørn Erik Pedersen
Fixes #2312
2016-09-06Multilingual TODO-fixes, take 1Bjørn Erik Pedersen
See #2309
2016-09-06Improve language handling in URLsBjørn Erik Pedersen
The current "rendering language" is needed outside of Site. This commit moves the Language type to the helpers package, and then used to get correct correct language configuration in the markdownify template func. This commit also adds two new template funcs: relLangURL and absLangURL. See #2309
2016-09-06Render the shortcodes as late as possibleBjørn Erik Pedersen
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
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
2016-09-06Add Translations and AllTranslations to NodeBjørn Erik Pedersen
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.
2016-09-06Introduce HugoSites typeBjørn Erik Pedersen
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.
2016-09-06Add Translations and AllTranslations methods to PageBjørn Erik Pedersen
Will revisit Node later.
2016-09-06Add proper Language and Languages typesBjørn Erik Pedersen
2016-09-06Add multilingual support in HugoAlexandre Bourget
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..
2016-08-19hugolib: Use named keys in composite literalsCameron Moore
Make `go vet` great again
2016-06-14hugolib: Support an expiration dateHanchen Wang
2016-04-17Add some schemaless BaseURL testsBjørn Erik Pedersen
See #2085
2016-04-12Fix broken testsBjørn Erik Pedersen
2016-04-12Revert "Use Node.ID for anchor ID"Bjørn Erik Pedersen
This reverts commit cd558958a0c0ecd06f7560a38e27334fe983e0de.
2016-04-11Use Node.ID for anchor IDBjørn Erik Pedersen
Fixes #2057
2016-04-08Make Hugo build without MercurialBjørn Erik Pedersen
By creating a fork of the Bitbucket inflect repo. It hasn't changed since 2013, so it must be considered pretty stable. Fixes #2062
2016-04-08hugolib: Un-export internal Site-methodsBjørn Erik Pedersen
These are obviously internal and for the most part undocumented, creating lots of GoLint warnings. See #1160 See #2014
2016-04-07Document and clean SourceRelativeLinksEval codeSven Dowideit
2016-04-07hugolib: Camelcase ALL_CAPS vars and const in testsBjørn Erik Pedersen
See #2014
2016-03-31Add readFile template funcBjørn Erik Pedersen
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
2016-03-24hugolib: Even more Golint fixesBjørn Erik Pedersen
2016-03-14hugolib: Remove unused codeBjørn Erik Pedersen
2016-03-09Create template clone for late template executionBjørn Erik Pedersen
Fixing some breaking blogs on Go 1.6 Fixes #1879
2016-03-06Simplify the IsHome test casesBjørn Erik Pedersen
2016-03-05Unexport the target handlersBjørn Erik Pedersen
These are of no interest outside the package.
2016-03-05Allow URL with extension in frontmatterBjørn Erik Pedersen
Fixes #1923
2016-02-08Add test for Hugo hanging up with empty contentTatsushi Demachi
This adds a test for the issue #1797 and its fix in 68e2e63.
2016-01-04Add some trailing newline shortcode testsBjørn Erik Pedersen
See #1753
2016-01-01Source file based relative linkingSven Dowideit
ala GitHub repository markdown for both md files and non-md files Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2016-01-01Write a simplistic test for site.refLinkSven Dowideit
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-12-18Fix failing template related tests in Go 1.6Bjørn Erik Pedersen
Fixes #1470
2015-12-18Fix data race in non-renderable pagesBjørn Erik Pedersen
Fixes #1601
2015-12-10Add copyright header to that source files that don’t have one.Anthony Fok
See #1646
2015-09-13Complete the Url-to-URL transition in testsAnthony Fok
See #959
2015-08-04Strip trailing whitespace in codeAnthony Fok
2015-06-28404 is homelessBjørn Erik Pedersen
Fixes #1235
2015-06-21Remove superfluous p-tags around shortcodesBjørn Erik Pedersen
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