From 2babefddb5b38b7a2d65c528c246a2e6705660a4 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 19 Jun 2022 21:53:30 +0200 Subject: convert meta and tag directives to TOML frontmatter command: ``` find * -type f -name '*.md' -execdir perl -MTOML::Tiny=to_toml -C63 -gni -E '%x=();s/\[\[!meta\s+(title|date)="?([^\]"]+?)\s*"?\s*\]\]\s*\n*/$x{$1}=$2;""/eg; s/\[\[!meta\s+stylesheet="?edu"?\s+rel="?stylesheet"?\s*\]\]\n*/$x{taxonomies}{categories}=["education"];""/e; s/\[\[!tag((?:\s+[^\]\s]+)+)\s*\]\]\n*/push @{$x{taxonomies}{tags}}, $1=~m{\S+}g;""/eg; s/\[\[!meta\s+(?:author|name)="?([^\]"]+?)\s*"?\s*\]\]\s*\n*/$x{extra}{author}=$1;""/eg; say "+++"; say to_toml({%x}); say "+++"; say $_' '{}' + ``` --- test/broer/index.md | 4 ++++ test/city-kvarter/index.md | 4 ++++ test/index.md | 4 ++++ test/obro-kvarter/index.md | 4 ++++ test/offentlighedsloven-tur/index.md | 4 ++++ test/offentlighedsloven/index.md | 6 ++++-- test/osterbro-attraktion-tur/index.md | 5 ++++- test/osterbro-attraktion/index.md | 17 +++++++++++++---- test/ostervold-tur/index.md | 4 ++++ test/tordenskjold/index.md | 6 ++++-- 10 files changed, 49 insertions(+), 9 deletions(-) (limited to 'test') diff --git a/test/broer/index.md b/test/broer/index.md index e9881049..0d5a7e82 100644 --- a/test/broer/index.md +++ b/test/broer/index.md @@ -1,3 +1,6 @@ ++++ + ++++ # Brokvartererne [[!template stamen=toner-lite id=map bounds-nw="55.70845,12.53386" bounds-se="55.66239,12.59703"]] + diff --git a/test/city-kvarter/index.md b/test/city-kvarter/index.md index df68fd6d..073fa67b 100644 --- a/test/city-kvarter/index.md +++ b/test/city-kvarter/index.md @@ -1,3 +1,6 @@ ++++ + ++++ # City [[!template id=map bounds-nw="55.69225, 12.56166" bounds-se="55.66819, 12.60321"]] + diff --git a/test/index.md b/test/index.md index f035566e..8e763b64 100644 --- a/test/index.md +++ b/test/index.md @@ -1,3 +1,6 @@ ++++ + ++++ [[!meta stylesheet=front rel=stylesheet]] {{ columns(content=""" @@ -6,3 +9,4 @@ [[!inline pages="( tagged(forside) or tagged(test) ) and tagged(bottom) and !tagged(top)" sort=mtime]] """]] + diff --git a/test/obro-kvarter/index.md b/test/obro-kvarter/index.md index 3a1565bd..df2c49e3 100644 --- a/test/obro-kvarter/index.md +++ b/test/obro-kvarter/index.md @@ -1,3 +1,6 @@ ++++ + ++++ # Ture på Østerbro [[!template id=map bounds-nw="55.71657, 12.5572" bounds-se="55.68813, 12.59737"]] @@ -36,3 +39,4 @@ polygon.bindPopup("Østerbros AttraktionerØsterbros Attraktioner
Gå til turbeskrivelsen"); + diff --git a/test/offentlighedsloven-tur/index.md b/test/offentlighedsloven-tur/index.md index ba1f4d77..6f251d6e 100644 --- a/test/offentlighedsloven-tur/index.md +++ b/test/offentlighedsloven-tur/index.md @@ -1,2 +1,6 @@ ++++ + ++++ # [Ud af Østervold|ostervold] [[!template id=map bounds-nw="55.69539, 12.55926" bounds-se="55.6679, 12.59789"]] + diff --git a/test/offentlighedsloven/index.md b/test/offentlighedsloven/index.md index cdab15c3..52ffb311 100644 --- a/test/offentlighedsloven/index.md +++ b/test/offentlighedsloven/index.md @@ -1,5 +1,6 @@ -[[!meta title="Offentlig/ Hemmelig vandring på Slotsholmen"]] - ++++ +title="Offentlig/ Hemmelig vandring på Slotsholmen" ++++ [[!if test="included()" then=""" {{ img(path="offentlighedsloven/horsesass.jpg" size="200x" link="offentlighedsloven") }} @@ -64,3 +65,4 @@ Du kan bidrage til en musikvideo om Loven - "De Mørke Fyrsters Spil". Er du på Facebook, får du opdageringer ved at [melde dig ind her](https://www.facebook.com/NejTakTilDenNyeOffentlighedslov?fref=ts) """]] + diff --git a/test/osterbro-attraktion-tur/index.md b/test/osterbro-attraktion-tur/index.md index 4dcae232..d49302e7 100644 --- a/test/osterbro-attraktion-tur/index.md +++ b/test/osterbro-attraktion-tur/index.md @@ -1,7 +1,10 @@ -[[!meta title="Østerbros attraktioner"]] ++++ +title="Østerbros attraktioner" ++++ # [[Østerbros attraktioner|/osterbro-attraktion]] [[!template id=map bounds-nw="55.709, 12.56261" bounds-se="55.6965, 12.5911"]] + diff --git a/test/osterbro-attraktion/index.md b/test/osterbro-attraktion/index.md index 78204a21..53e9f93f 100644 --- a/test/osterbro-attraktion/index.md +++ b/test/osterbro-attraktion/index.md @@ -1,7 +1,17 @@ ++++ +title="Østerbros Attraktioner" + +[taxonomies] +tags=[ + "ture", + "standard", + "trianglen", + "parken", + "Brumleby", +] ++++ [[!meta stylesheet=test rel=stylesheet]] -[[!meta title="Østerbros Attraktioner"]] - [[!if test="included()" then=""" {{ img(path="osterbro-attraktion/triangelbar.jpg" size="x200") }} @@ -49,5 +59,4 @@ tillokkende del af København. """]] -[[!tag ture standard ]] -[[!tag trianglen parken Brumleby ]] \ No newline at end of file + diff --git a/test/ostervold-tur/index.md b/test/ostervold-tur/index.md index 76dbdb1a..d9946cff 100644 --- a/test/ostervold-tur/index.md +++ b/test/ostervold-tur/index.md @@ -1,3 +1,7 @@ ++++ + ++++ # [[Ud af Østervold|ostervold]] [[!template stamen=toner-lite id=map bounds-nw="55.70845,12.53386" bounds-se="55.66239,12.59703"]] + diff --git a/test/tordenskjold/index.md b/test/tordenskjold/index.md index b609e84c..335418c8 100644 --- a/test/tordenskjold/index.md +++ b/test/tordenskjold/index.md @@ -1,5 +1,6 @@ -[[!meta title="Tordenskjold i København. Byvandring anno 1720."]] - ++++ +title="Tordenskjold i København. Byvandring anno 1720." ++++ [[!if test="included()" then=""" I februar 2016 rider Tordenskjold over lærredet i en barok road movie om venskab og skæbne. Mens han farer vild på landevejen, tager Vejviseren dig en tur i søheltens kølvand langs byens kajer i år 1720 og derefter. @@ -83,3 +84,4 @@ Den nye film spinder sin egen ende over Tordenskjolds død, og holder unge Lehn """]] + -- cgit v1.2.3