From c880c87bf1621b00a0adea65f3b02ac15c042b27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20B=C3=B6sch-Plepelits?= Date: Sun, 17 Sep 2017 21:56:53 +0200 Subject: [PATCH] New Special/Wikipedia category --- index.json | 13 +++++++++++++ wikipedia.json | 14 ++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 wikipedia.json diff --git a/index.json b/index.json index 60206a8f..b3db8b27 100644 --- a/index.json +++ b/index.json @@ -250,6 +250,19 @@ }, { "id": "places_geo" + }, + { + "name": { + "en": "Special", + "de": "Spezial" + }, + "id": "special", + "type": "index", + "subCategories": [ + { + "id": "wikipedia" + } + ] } ] } diff --git a/wikipedia.json b/wikipedia.json new file mode 100644 index 00000000..5e9db830 --- /dev/null +++ b/wikipedia.json @@ -0,0 +1,14 @@ +{ + "type": "overpass", + "name": { + "en": "Wikipedia" + }, + "query": { + "14": "(\nnode[~\"wikipedia\"~\".\"];\nway[~\"wikipedia\"~\".\"];\nrelation[~\"wikipedia\"~\".\"];\n)" + }, + "feature": { + "pre": "{% set errors = [] %}\n{% for k, v in tags %}\n\n{% if k|matches(\"^wikipedia:\") %}\n {% set errors = errors|merge([\"Uses wikipedia and old-style \" ~ k ~ \" tag\"]) %}\n{% elseif k|matches(\"^wikipedia:\") %}\n {% set errors = errors|merge([\"Uses old-style \" ~ k ~ \" tag\"]) %}\n{% endif %}\n\n{% if k|matches(\":?wikipedia$\") and not v|matches(\"^[a-z-]+:\") %}\n {% set errors = errors|merge([\"Tag \" ~ k ~ \" does not contain language information: \" ~ v ]) %}\n{% endif %}\n\n{% endfor %}", + "description": "{% if errors|length %}\n{{ errors|length }} {{ trans('error', errors|length) }}\n{% endif %}", + "body": "{% if errors|length %}\n{{ trans('error', errors|length) }}:\n{% endif %}" + } +}