diff --git a/data/address_formats.toml b/data/address_formats.toml
new file mode 100644
index 00000000..0d2beb4d
--- /dev/null
+++ b/data/address_formats.toml
@@ -0,0 +1,6 @@
+# Address formats.
+en-us = {order = ['street', 'city', 'region', 'postcode'], delimiters = [', ', ', ', ' ', '']}
+en-gb = {order = ['street', 'city', 'region', 'postcode'], delimiters = [', ', ', ', ', ', '']}
+de = {order = ['street', 'postcode', 'city'], delimiters = ['
', ' ', '']}
+fr-fr = {order = ['street', 'postcode', 'city'], delimiters = ['
', ' ', '']}
+zh = {order = ['postcode', 'region', 'city', 'street'], delimiters = [' ', ' ', ' ', '']}
diff --git a/exampleSite/config/_default/params.toml b/exampleSite/config/_default/params.toml
index 436a911f..c4d50e69 100644
--- a/exampleSite/config/_default/params.toml
+++ b/exampleSite/config/_default/params.toml
@@ -139,7 +139,7 @@ date_format = "Jan 2, 2006"
# Examples: "3:04 pm" or "15:04"
time_format = "3:04 PM"
-# Address format (choose from the [address_formats] list below or add you own to the list).
+# Address format (en-us, en-gb, de, fr-fr, zh).
address_format = "en-us"
############################
@@ -186,14 +186,6 @@ plugins_js = []
# Choose a shape for avatar images. Options: circle, square.
shape = "circle"
-# Available address formats.
-[address_formats]
- en-us = {order = ['street', 'city', 'region', 'postcode'], delimiters = [', ', ', ', ' ', '']}
- en-gb = {order = ['street', 'city', 'region', 'postcode'], delimiters = [', ', ', ', ', ', '']}
- de = {order = ['street', 'postcode', 'city'], delimiters = ['
', ' ', '']}
- fr-fr = {order = ['street', 'postcode', 'city'], delimiters = ['
', ' ', '']}
- zh = {order = ['postcode', 'region', 'city', 'street'], delimiters = [' ', ' ', ' ', '']}
-
# Configuration of publication pages.
[publications]
# Date format (refer to https://sourcethemes.com/academic/docs/customization/#date-format )
diff --git a/layouts/partials/functions/get_address.html b/layouts/partials/functions/get_address.html
index 02eec101..084e1284 100644
--- a/layouts/partials/functions/get_address.html
+++ b/layouts/partials/functions/get_address.html
@@ -1,13 +1,15 @@
{{/* Function to return a formatted address given a semantic address. */}}
{{/* Check for valid site config. */}}
-{{ if not site.Params.address_format }}{{errorf "Address format missing from `params.toml`!"}}{{end}}
-{{ if not site.Params.address_formats }}{{errorf "Address formats missing from `params.toml`!"}}{{end}}
+{{ if not site.Data.address_formats }}{{errorf "Address formats missing from `data/address_formats.toml`!"}}{{end}}
{{ $page := . }}
{{ $address := .address }}
{{ $format_name := $page.Params.address_format | default site.Params.address_format | default "en-us" }}
-{{ $format := index site.Params.address_formats $format_name }}
+
+{{ if not (isset site.Data.address_formats $format_name) }}{{ errorf "Address format `%s` missing from `data/address_formats.toml`!" $format_name }}{{end}}
+
+{{ $format := index site.Data.address_formats $format_name }}
{{ $address_display := slice }}
{{ range $k, $v := $format.order }}