From b0111a19e6e86e275e1af0c85699b20f254c149f Mon Sep 17 00:00:00 2001
From: Robert Günzler
Date: Mon, 13 Jan 2025 13:47:36 +0100
Subject: set target=_blank on outgoing links via preproc.lua
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Robert Günzler
---
preproc.lua | 7 +++++++
site/nikko.html | 37 +++++++++++++++++++++----------------
site/pyonji.html | 24 +++++++++++++-----------
src/inc/nikko.htm | 35 ++++++++++++++++++++---------------
src/inc/pyonji.htm | 22 ++++++++++++----------
5 files changed, 73 insertions(+), 52 deletions(-)
diff --git a/preproc.lua b/preproc.lua
index 6bfa8c5..7be9a48 100644
--- a/preproc.lua
+++ b/preproc.lua
@@ -1,6 +1,13 @@
---@diagnostic disable: undefined-global
-- see https://pandoc.org/lua-filters.html
return {
+ Link = function(link)
+ -- set target="_blank" for outgoing links (open them in new tab)
+ if string.match(link.target, "gzr.im") == nil then
+ table.insert(link.attributes, { "target", "_blank" })
+ end
+ return link
+ end,
Pandoc = function(doc)
local front = {}
diff --git a/site/nikko.html b/site/nikko.html
index 7d72faa..65e4f2d 100644
--- a/site/nikko.html
+++ b/site/nikko.html
@@ -59,12 +59,14 @@ The international Drivers License, as it will turn out later, was
entirely unnecessary for me.
For my first destination I chose Nikkō, another
-common day trip destination from Tokyo that I had not done and
-conveniently located along the Tōhoku Shinkansen line. My plan was to
-take the train to Utsunomiya, rent a car from there and continue towards
-Nikkō, with the eventual goal being a hotel at the shores of Chuzenji-ko.
+href="https://en.wikipedia.org/wiki/Nikk%C5%8D"
+target="_blank">Nikkō, another common day trip destination from
+Tokyo that I had not done and conveniently located along the Tōhoku
+Shinkansen line. My plan was to take the train to Utsunomiya, rent a car
+from there and continue towards Nikkō, with the eventual goal being a
+hotel at the shores of Chuzenji-ko.
So I start the day nice and early on one of the first trains out of
Ueno terminal. It’s another grey morning in Tokyo with the weather
forecast promising sunshine for the next day at least. When I arrive in
@@ -122,8 +124,8 @@ printer.
constricting. The hotel I booked is served by a bus that runs every
hour, though only until 1800. This means I have to be careful how I
spend time around today’s destination: Tōshō-gū
-et al
+href="https://en.wikipedia.org/wiki/Shrines_and_Temples_of_Nikk%C5%8D"
+target="_blank">Tōshō-gū et al
exploring nikkō
hotel
The bus ride to the hotel is a little event in itself. From the main
@@ -173,13 +175,15 @@ sign for the Lake Chuzenji Nature Trail. There are some larger
information boards that tell the histories of a small memorial garden
and the lake house. It doesn’t take very long before I reach
Shobugahama, where I start following the path towards Ryuzu Falls.
-The waterfall is on the way to where I want to make it today, so I put
-off my plan to find a bus stop that could take me to Senjōgahara
-Marshland, and check them out first. I just follow the marked trail
-which takes me up the hill next to the falls and into a web of paths
-through a wooded area tracing the Yu river.
+href="https://en.wikipedia.org/wiki/Ry%C5%ABzu_Falls"
+target="_blank">Ryuzu Falls. The waterfall is on the way to where I
+want to make it today, so I put off my plan to find a bus stop that
+could take me to Senjōgahara Marshland, and check them out first. I
+just follow the marked trail which takes me up the hill next to the
+falls and into a web of paths through a wooded area tracing the Yu
+river.
At this point my plan has shifted to walking all the way up to the
entrance of the wetlands walking trail, exploring there and then finding
a bus stop to take me back to Nikkō. The weather is great and it
@@ -202,6 +206,7 @@ role="doc-backlink">↩︎