4 files changed +7
-24
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,12 @@ Features
6
6
7
7
* Support for Markdown Meta extension for Pelican
8
8
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)
10
15
11
16
New in v7.8.6
12
17
=============
Original file line number Diff line number Diff line change @@ -321,18 +321,6 @@ The exact format is described in the `markdown metadata extension docs <https://
321
321
slug: how-to-make-money
322
322
date: 2012-09-15 19:52:05 UTC
323
323
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
-
336
324
Basic
337
325
`````
338
326
Original file line number Diff line number Diff line change @@ -2823,7 +2823,7 @@ def guess_locale_from_lang_posix(lang):
2823
2823
# only that type is accepted by the locale module
2824
2824
locale_n = str ('.' .join (locale .getdefaultlocale ()))
2825
2825
except (ValueError , TypeError ):
2826
- pass
2826
+ locale_n = str ()
2827
2827
# Use guess only if it’s the same language
2828
2828
if not locale_n .startswith (lang .lower ()):
2829
2829
locale_n = str ()
Original file line number Diff line number Diff line change @@ -1053,16 +1053,6 @@ def _get_metadata_from_file(meta_data):
1053
1053
meta = toml .load ('\n ' .join (meta_data [1 :idx ]))
1054
1054
return meta
1055
1055
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
-
1066
1056
# First, get metadata from the beginning of the file,
1067
1057
# up to first empty line
1068
1058
0 commit comments