Commit graph

2603 commits

Author SHA1 Message Date
Mitchell Cohen
56afd943a8 docs: Add multilingual alias example 2016-09-17 11:23:47 +02:00
Bjørn Erik Pedersen
51c9bfbc9e Remove Authors.Sort
We may add it again in the future, but let us try to keep the API as small as possible for now.

See #1850
2016-09-17 00:50:11 +02:00
Derek Perkins
cf978c0649 Add First Class Author Support
Closes #1850
2016-09-17 00:49:24 +02:00
Daniel Holbach
44bf76d0f2 Add snapcraft.yaml file 2016-09-16 10:08:10 -06:00
digitalcraftsman
742911146a docs: Clarify difference between slug and url 2016-09-16 17:38:08 +02:00
digitalcraftsman
e80453a991 tpl: Add EnableMissingTranslationPlaceholders option
Fixes #2451
2016-09-16 17:20:29 +02:00
digitalcraftsman
0dd57b907b docs: List i18n folder in source organization 2016-09-16 17:13:59 +02:00
digitalcraftsman
bca567faea docs: Clarify usecase of data files
Fixes #1769
2016-09-16 17:05:38 +02:00
digitalcraftsman
0c49370ca0 docs: Fix example of displaying taxonomies
Fixes #2216
2016-09-16 16:43:50 +02:00
digitalcraftsman
3410007dca docs: List multilingual tpl vars and show menu creation
Fixes #2436
2016-09-16 15:37:12 +02:00
digitalcraftsman
9dab62c559 docs: List config options for multilingual feature 2016-09-16 14:36:54 +02:00
Jacob Walker
4e16a6d4fd docs: Fix markdown in content/extras/scratch.md 2016-09-15 11:35:39 -05:00
Frank Taillandier
cdf1edd549 docs: Fix French translation in multilingual.md 2016-09-15 15:25:31 +02:00
Mark D. Blackwell
0d1e96701f docs: Improve Traversing Local Files 2016-09-15 15:15:04 +02:00
Bjørn Erik Pedersen
b86a605bfb Make paginate settings configurable per language
Fixes #2449
2016-09-15 09:32:52 +02:00
Bjørn Erik Pedersen
bbb11a4a0f Do not add lang prefix in URL when set in frontmatter
Fixes #2450
2016-09-14 18:51:34 +02:00
Bjørn Erik Pedersen
dd45e6d7e5 Lazy calculate WordCount, ReadingTime and FuzzyWordCount
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-14 10:57:39 +02:00
Bjørn Erik Pedersen
4abaec5c04 Improve TotalWords counter func
It is obviously more efficient when we do not care about the actual words.

```
BenchmarkTotalWords-4            100000         18795 ns/op           0 B/op           0 allocs/op
BenchmarkTotalWordsOld-4          30000         46751 ns/op        6400 B/op           1 allocs/op
```
2016-09-14 10:50:56 +02:00
Bjørn Erik Pedersen
bcd434794a Avoid splitting words for summary
For people using autogenerated summaries, this is one of the hot spots in the memory department.

We don't need to split al the content into words to do proper summary truncation.

This is obviously more effective:

```
BenchmarkTestTruncateWordsToWholeSentence-4            300000          4720 ns/op           0 B/op           0 allocs/op
BenchmarkTestTruncateWordsToWholeSentenceOld-4         100000         17699 ns/op        3072 B/op           3 allocs/op
```
2016-09-14 10:50:55 +02:00
Bjørn Erik Pedersen
74ffb45fbe helpers: Improve the language prefix logic
See #2444
2016-09-13 23:44:16 +02:00
Bjørn Erik Pedersen
f53145b274 helpers: Avoid adding language prefix if already present
Fixes #2444
2016-09-13 21:37:27 +02:00
Bjørn Erik Pedersen
8d040c966f commands: Improve error messages in convert
See #2440
2016-09-13 19:11:59 +02:00
Bjørn Erik Pedersen
a04abf0dda tpl: Make the *langURL funcs tace interface{}
Fixes #2447
2016-09-13 17:07:52 +02:00
Bjørn Erik Pedersen
7615ef0c28 commands: Report errors in convert
Fixes #2440
2016-09-13 10:49:51 +02:00
Bjørn Erik Pedersen
be09781af1 Fix broken convert command
Fixes #2437
2016-09-13 09:59:18 +02:00
Bjørn Erik Pedersen
69a97823c4 Add Language.LanguageName
Fixes #2435
2016-09-12 20:59:03 +02:00
Bjørn Erik Pedersen
a7dc3c082e Support site menu per language
Fixes #2434
2016-09-12 20:59:03 +02:00
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