Skip to content

Commit 08bc2be

Browse files
authoredMay 29, 2017
Merge branch 'master' into md-metadata
2 parents 08da62f + 2623322 commit 08bc2be

File tree

4 files changed

+7
-24
lines changed

4 files changed

+7
-24
lines changed
 

‎CHANGES.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,12 @@ Features
66

77
* Support for Markdown Meta extension for Pelican
88
compatibility (Issue #1923)
9-
* Support for JSON, YAML and TOML metadata (Issue #2801)
9+
* Support for YAML and TOML metadata (Issue #2801)
10+
11+
Bugfixes
12+
--------
13+
14+
* Fix unbound variable error in locale guessing (Issue #2806)
1015

1116
New in v7.8.6
1217
=============

‎docs/manual.txt

-12
Original file line numberDiff line numberDiff line change
@@ -321,18 +321,6 @@ The exact format is described in the `markdown metadata extension docs <https://
321321
slug: how-to-make-money
322322
date: 2012-09-15 19:52:05 UTC
323323

324-
JSON metadata is wrapped in braces and the usual JSON syntax applies. Be careful not to leave any
325-
braces alone in a line other than the last one:
326-
327-
.. code:: json
328-
329-
{
330-
title: "How to make money"
331-
slug: "how-to-make-money"
332-
date: "2012-09-15 19:52:05 UTC"
333-
}
334-
335-
336324
Basic
337325
`````
338326

‎nikola/nikola.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2823,7 +2823,7 @@ def guess_locale_from_lang_posix(lang):
28232823
# only that type is accepted by the locale module
28242824
locale_n = str('.'.join(locale.getdefaultlocale()))
28252825
except (ValueError, TypeError):
2826-
pass
2826+
locale_n = str()
28272827
# Use guess only if it’s the same language
28282828
if not locale_n.startswith(lang.lower()):
28292829
locale_n = str()

‎nikola/post.py

-10
Original file line numberDiff line numberDiff line change
@@ -1053,16 +1053,6 @@ def _get_metadata_from_file(meta_data):
10531053
meta = toml.load('\n'.join(meta_data[1:idx]))
10541054
return meta
10551055

1056-
# If 1st line is '{', then it's JSON metadata
1057-
if meta_data[0] == '{':
1058-
idx = meta_data.index('}', 1)
1059-
meta = json.loads('\n'.join(meta_data[1:idx]))
1060-
# We expect empty metadata to be '', not None
1061-
for k in meta:
1062-
if meta[k] is None:
1063-
meta[k] = ''
1064-
return meta
1065-
10661056
# First, get metadata from the beginning of the file,
10671057
# up to first empty line
10681058

0 commit comments

Comments
 (0)
Failed to load comments.