summaryrefslogtreecommitdiffstats
path: root/hugolib/rss_test.go
AgeCommit message (Collapse)Author
2017-06-13all: Update import paths to gohugoio/hugoBjørn Erik Pedersen
2017-02-18hugolib: More test helper cleanupBjørn Erik Pedersen
2017-02-17hugolib: Test helper cleanupBjørn Erik Pedersen
2017-02-17hugolib: Make RSS item limit configurableCameron Moore
Add a new rssLimit site configuration option with default of 15. Prior to this fix, you could create your own RSS feed to override the default limit of 15, but we still had a hardcoded limit of 50 items set in `hugolib.renderRSS()`. With this option in place, the `range first 15 .Data.Pages` logic is no longer hardcoded into the embedded RSS template. Because the size of the slice passed to the template is now limited to rssLimit instead of 50, this commit is a breaking change for sites with a custom RSS template that expects more than 15 items. Fixes #3035
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
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-10-28Fix RSS Title regressionBjørn Erik Pedersen
And add tests to make sure it doesn't happen again. Fixes #2645
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-14Rewrite TestRSSOutput to use AferoBjørn Erik Pedersen
When we have a virtual filesystem, we might as well test as close to the iron as possible.
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-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-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 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-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-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: Apply Golint rules to rss_test.goBjø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
2015-12-10Add copyright header to that source files that don’t have one.Anthony Fok
See #1646
2015-05-20Stop Viper from leaking across many of the tests (now tests pass regardless ↵spf13
of order tested)
2015-05-08Make RSS output test more realisticbep
By setting a non-default RSS uri config value.
2015-05-07Add RSSUri to specify the name of the RSS fileDana H. P'Simer
2014-11-17Various fixes in RSS feed generationKartik Singhal
- Prevent `.xml` generation for root section - Remove redundant check for DisableRSS - Fix permalinks for rel="alternate" - Rename generated xml file to <type>/index.xml - Add required description element in default template - Make default RSS template validate on w3c (timezone format is still an issue) Conflicts: hugolib/site.go
2014-11-04Updating tests to use new Targets & Writers and switch to using ↵spf13
Afero.MemMapFs for more accurate tests.
2014-04-07Fixing all tests to pass with new Viper Configspf13
2014-03-01Fixing issues go vet reports.Mike Keesey
2013-12-16GofmtCaleb Spare
Command: `gofmt -l -s -w .`
2013-11-05Adding RSS test case.Noah Campbell
Checks to make sure the xml document starts with <?xml. Previously, the html translate package would write additional details into the document that caused it to fail.