Commit graph

2526 commits

Author SHA1 Message Date
Albert f0ac26c944 commands: Fix typos 2016-09-12 11:32:11 +02:00
Cameron Moore 3908489ccd tpl: Extend where to iterate over maps
Fixes #2028
2016-09-12 11:03:53 +02:00
Cameron Moore 640121423c tpl: Fix typos in tests
Closes #2370
2016-09-12 10:56:24 +02:00
Cameron Moore 46342ad5e8 hugolib: Fix typos in tests 2016-09-12 10:56:16 +02:00
Bjørn Erik Pedersen c700cdc39c Replace some leftover os.Stat with hugofs.Source 2016-09-11 20:00:38 +02:00
Bjørn Erik Pedersen ef3c4a56d8 Fix reload dir matching in theme
Fixes #2430
2016-09-11 20:00:38 +02:00
Bjørn Erik Pedersen 364e69ab7f Handle symlink change event
Hugo 0.16 announced support for symbolic links for the root folders, /content, /static etc., but this got broken pretty fast.

The main problem this commit tries to solve is the matching of file change events to "what changed".

An example:

ContentDir: /mysites/site/content where /mysites/site/content is a symlink to /mycontent

/mycontent:

/mypost1.md
/post/mypost2.md

* A change to mypost1.md (on OS X) will trigger a file change event with name "/mycontent/mypost1.md"
* A change to mypost2.md gives event with name "/mysites/site/content/mypost2.md"

The first change will not trigger a correct update of Hugo before this commit. This commit fixes this by doing a two-step check:

1. Check if "/mysites/site/content/mypost2.md" is within /mysites/site/content
2. Check if  "/mysites/site/content/mypost2.md" is within the real path that /mysites/site/content points to

Fixes #2265
Closes #2273
2016-09-11 20:00:38 +02:00
digitalcraftsman e70cf1ace4 docs: Remove JPEG as format for showcase thumbnails 2016-09-11 18:18:28 +02:00
David Yates d5379fd1fe docs: Add davidyat.es to the showcase 2016-09-11 18:11:50 +02:00
bogem 4d1cb50003 parser: Use strings.Contains instead of strings.Index
Closes #2400
2016-09-11 12:23:15 +02:00
bogem 798bf60c56 parser: Simplify err conditions 2016-09-11 12:23:09 +02:00
bogem 60baec8005 commands: Delete useless conversion 2016-09-11 12:23:09 +02:00
bogem 2294b0226d commands: Simplify err condition 2016-09-11 12:23:09 +02:00
bogem 1e18087356 commands: Delete unused newUserErrorF 2016-09-11 12:23:09 +02:00
Jelmer Tiete 5867cb5a92 Fixe target path location check in jekyll import command 2016-09-11 10:48:31 +02:00
Mathias Biilmann 7d3dfba84b Prevent panic on empty authorlist 2016-09-11 10:46:56 +02:00
Ben Campbell 3392133128 Remove redundant field in sort helper struct
The pair struct used by sortSeq() had two key fields, where only one
is really needed.
2016-09-11 10:42:50 +02:00
Bjørn Erik Pedersen 9c5f2befc0 tpl: Make it more clear on missing language string 2016-09-09 21:21:16 +02:00
Bjørn Erik Pedersen 43bf9ed38e Redirect to root when DefaultContentLanguageInSubdir = false
Fixes #2422
2016-09-09 17:42:02 +02:00
Bjørn Erik Pedersen 4df86a703a Fix paginator counter on x86-32
Atomic operations with 64 bit values must be aligned for 64-bit on x86-32.

According to the spec:

"The first word in a global variable or in an allocated struct or slice can be relied upon to be 64-bit aligned."

The above wasn't enough for the `paginationPageCount` on `SiteInfo`, maybe due to how `SiteInfo` is embedded.

This commit adds a 4 byte padding before the `uint64` that creates the correct alignment.

Fixes #2415
2016-09-09 14:31:49 +02:00
Bjørn Erik Pedersen eaf2f9bce5 Add TODO list support for Blackfriday
* Add CSS class to TODO list and list items
* Add a flag to turn task list support off

Fixes #2269
2016-09-09 13:08:20 +02:00
Bjørn Erik Pedersen 76bf2dcdd2 Fix shortcode vs pygments
This is the nth attempt to fix an issue by changing the placeholder token pattern, but
now we actually have tests for all the historic trouble cases.

Fixes #2223
2016-09-08 21:23:01 +02:00
Bjørn Erik Pedersen ccb3040ad4 Fix pagination page counter on 32 bit
Updates #2415
2016-09-08 17:18:11 +03:00
Bjørn Erik Pedersen fe0c270577 Reset the i18n func map on reload
Also improve the error message on missing resource bundles.
2016-09-08 17:18:11 +03:00
Pascal Aubort 5ef45bec63 docs: Fix typos in multilingual section 2016-09-08 15:54:26 +02:00
Bjørn Erik Pedersen 97c57fe37a Add missing read lock in getNodes 2016-09-08 16:51:32 +03:00
Bjørn Erik Pedersen a8fad86671 Bump Travis to Go 1.7.1 2016-09-08 00:37:04 +03:00
Bjørn Erik Pedersen 34fe5cd34f tpl: Fix echoParam
Fixes #2406
2016-09-07 22:03:09 +03:00
Bjørn Erik Pedersen a00edff5b1 Make it the DEV version 2016-09-06 23:20:59 +03:00
Bjørn Erik Pedersen 35d2eac490 Fix go vet 1.7 issues
Updates #2309
2016-09-06 18:32:21 +03:00
Bjørn Erik Pedersen 09ed41be71 Add a global Reset func
So we can do some benchmarking.
2016-09-06 18:32:21 +03:00
Bjørn Erik Pedersen dc3618abcd Make sure the 404 node has .Data.Pages
Updates #2309
2016-09-06 18:32:21 +03:00
Bjørn Erik Pedersen 30d65fd48d Fix site reset for benchmarks etc.
Updates #2309
2016-09-06 18:32:21 +03:00
Bjørn Erik Pedersen b3563b40a4 Fix multilingual reload when shortcode changes
This commit also refines the partial rebuild logic, to make sure we do not do more work than needed.

Updates #2309
2016-09-06 18:32:21 +03:00
Bjørn Erik Pedersen a823b1572b Set lang template globals for each site when render shortcodes
We should get rid of these globals, but that is another month.
2016-09-06 18:32:21 +03:00
Bjørn Erik Pedersen 28696b5dca Small adjustment to SiteInfo init
After a visual inspection to make (pretty) sure it is correct re multiple languages.

Updates #2309
2016-09-06 18:32:20 +03:00
Bjørn Erik Pedersen 2f7e8df5ba docs: Fix spelling: HasTranslations > IsTranslated 2016-09-06 18:32:20 +03:00
Bjørn Erik Pedersen 1bce8a854b Create a copy of the section node for RSS
So the Permalink gets correct when listing translations.

I have also checked the other relevant places to make sure we do not overwrite node values we need later.

Pointers can be tricky, but lesson learned is: A copy is cheap.

Updates #2309
2016-09-06 18:32:20 +03:00
Bjørn Erik Pedersen bbfebdea43 Fix Data in multisites
Updates #2309
2016-09-06 18:32:20 +03:00
Bjørn Erik Pedersen 93717aac5c docs: Get the variable and funcs re multilingual up-to-date 2016-09-06 18:32:20 +03:00
Bjørn Erik Pedersen 4fbce78740 Add JSON config to the multilanguage testing
Updates #2309
2016-09-06 18:32:20 +03:00
Bjørn Erik Pedersen d8a256c155 Fix YAML loading of multilingual config
And some other minor fixes from code review.

Updates #2309
2016-09-06 18:32:20 +03:00
Bjørn Erik Pedersen 446e606a09 Add data tests
Updates #2309
2016-09-06 18:32:20 +03:00
Bjørn Erik Pedersen 5b331a18d7 Add temp MULTILINGUAL version suffix to this branch
For people having trouble building this.

Now `hugo version` should print something like:

```
Hugo Static Site Generator v0.17-MULTILINGUAL BuildDate: 2016-08-10T08:20:36+02:00
```
2016-09-06 18:32:19 +03:00
Bjørn Erik Pedersen a07293cf97 Create a Node map to get proper node translations
In a multi-language setup, before this commit the Node's Translations() method
would return some "dummy nodes" that would point to the correct page (Permalink),
but would not be the same as the node it points to -- it would not have the translated
title etc.

The node creation is, however, so mingled with rendering, whihc is too early to have any global state,
so the nodes has to be split in a prepare and a render phase. This commits does that with as small
a change as possible. This implementation is a temp solution until we fix #2297.

Updates #2309
2016-09-06 18:32:19 +03:00
Bjørn Erik Pedersen d1212307f2 doc: Fix TOML vs YAML in multilang section
Updates ##2309
2016-09-06 18:32:19 +03:00
Bjørn Erik Pedersen 45c69dd168 Handle error in config loading
See #2309
2016-09-06 18:32:19 +03:00
Bjørn Erik Pedersen 7610844004 Add IsTranslated to Node and Page
Makes the templates simpler.

See #2309
2016-09-06 18:32:19 +03:00
Bjørn Erik Pedersen 8b55bfc814 Remove unused Multilingual Viper default
See #2312
2016-09-06 18:32:19 +03:00
Bjørn Erik Pedersen f1e1cdab3f Improve i18n string handling
* Fall back to default language on missing translation file
* Add a i18n-warnings build flag
* If that flag is set, print a parseable and greppable string on missing translation strings

See #2303
2016-09-06 18:32:19 +03:00