bavbavhaus: implement verso and recto iframes
parent
d886f42ffc
commit
e341eb6bbc
|
@ -1,4 +1,3 @@
|
|||
*.bak
|
||||
public_html/*.html
|
||||
public_html/*.html.part
|
||||
public_html/*.d
|
||||
/public_html/*.html
|
||||
!/public_html/index.html
|
||||
|
|
25
Makefile
25
Makefile
|
@ -2,36 +2,21 @@
|
|||
|
||||
notes := $(wildcard *.md)
|
||||
pages := $(patsubst %.md,public_html/%.html,$(notes))
|
||||
parts := $(patsubst %.md,public_html/%.html.part,$(notes))
|
||||
preqs := $(patsubst %.md,public_html/%.html.d,$(notes))
|
||||
static := public_html/index.html
|
||||
|
||||
all: $(pages)
|
||||
|
||||
PANDOCFLAGS := --data-dir pandoc
|
||||
BAVBAVHAUSFLAGS = $(PANDOCFLAGS) -M slug=$*
|
||||
BAVBAVHAUSFLAGS:= --data-dir pandoc -d bavbavhaus.net.yaml
|
||||
|
||||
public_html/%.html: %.md
|
||||
pandoc $(BAVBAVHAUSFLAGS) -d bavbavhaus.net.yaml $< | sed 's/↩︎/[\⁠\<\⁠-\⁠]/g' > $@
|
||||
pandoc $(BAVBAVHAUSFLAGS) -o $@ $<
|
||||
|
||||
$(pages): pandoc/templates/bavbavhaus.net.html5
|
||||
|
||||
public_html/%.html.part: %.md
|
||||
pandoc $(BAVBAVHAUSFLAGS) -d bavbavhaus.net.part.yaml --id-prefix $* -o $@ $<
|
||||
|
||||
$(parts): pandoc/templates/bavbavhaus.net.part.html5
|
||||
|
||||
public_html/%.html.d: %.md
|
||||
pandoc lua dependencies.lua $< > $@
|
||||
|
||||
include $(preqs)
|
||||
|
||||
clean: oldpages := $(filter-out $(pages),$(wildcard public_html/*.html))
|
||||
clean: oldparts := $(filter-out $(parts),$(wildcard public_html/*.html.part))
|
||||
clean: oldpreqs := $(filter-out $(preqs),$(wildcard public_html/*.html.d))
|
||||
clean: oldpages := $(filter-out $(static) $(pages),$(wildcard public_html/*.html))
|
||||
clean:
|
||||
$(if $(oldpages),$(RM) $(filter-out $(pages),$(wildcard public_html/*.html)))
|
||||
$(if $(oldparts),$(RM) $(filter-out $(parts),$(wildcard public_html/*.html.part)))
|
||||
$(if $(oldpreqs),$(RM) $(filter-out $(preqs),$(wildcard public_html/*.html.d)))
|
||||
$(if $(oldpages),$(RM) $(oldpages))
|
||||
|
||||
.PHONY: all clean
|
||||
|
||||
|
|
25
index.md
25
index.md
|
@ -1,25 +0,0 @@
|
|||
---
|
||||
title: "bavbavhaus.net"
|
||||
index: true
|
||||
...
|
||||
|
||||
> Odkrivanje zatona arhitektov kot aktivnih ideologov, spoznanje o ogromnih tehnoloških zmožnostih racionalizacije mesta in ozemlja skupaj z vsakodnevnimi ugotovitvami o njihovi brezkoristnosti ter zastaranje specifičnih metod projektiranja, še preden so njihove hipoteze lahko preverjene v realnosti, za arhitekte tvorijo tesnobno vzdušje, ki na obzorju ponuja vpogled na zelo konkretno ozadje, zastrašujoče kot največje zlo ... [@tafuri1969peruna, 77]
|
||||
|
||||
*bavbavhaus.net* je poskus hekanja prokrastinacije in sploščitve nekaterih idej o ["sanjskem datotečnem formatu"](neusmerjeno_pisanje.md) v enostaven sistem povezanih in vzporednih zapiskov okoli teme [arhitekturnega dela in kapitalističnega razvoja](arhitekturno_delo_in_kapitalisticni_razvoj.md).
|
||||
|
||||
---
|
||||
lang: sl
|
||||
references:
|
||||
- type: article-journal
|
||||
id: tafuri1969peruna
|
||||
author:
|
||||
- family: Tafuri
|
||||
given: Manfredo
|
||||
title: "Per una critica dell'ideologia archittetonica"
|
||||
title-short: "Per una critica dell'ideologia archittetonica"
|
||||
container-title: "Contropiano: materiali marxisti"
|
||||
issue: 1
|
||||
issued: 1969
|
||||
page: 31-79
|
||||
language: it
|
||||
...
|
|
@ -1,12 +0,0 @@
|
|||
---
|
||||
from: markdown
|
||||
toc: true
|
||||
citeproc: true
|
||||
csl: chicago-fullnote-sl
|
||||
template: bavbavhaus.net.part.html5
|
||||
to: html5
|
||||
filters:
|
||||
- localize_quotes.lua
|
||||
- resolve_internal_links.part.lua
|
||||
- link_headings.lua
|
||||
...
|
|
@ -7,7 +7,6 @@ template: bavbavhaus.net.html5
|
|||
to: html5
|
||||
filters:
|
||||
- localize_quotes.lua
|
||||
- collect_internal_linked.lua
|
||||
- resolve_internal_links.lua
|
||||
- link_headings.lua
|
||||
...
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
SCRIPT_NAME = "collect_internal_linked.lua"
|
||||
os.setlocale("C")
|
||||
|
||||
local RawBlock = pandoc.RawBlock
|
||||
local parts = pandoc.MetaList({})
|
||||
|
||||
local visited = {}
|
||||
|
||||
return {
|
||||
{ Link = function(link)
|
||||
-- early return for external links
|
||||
if link.target:find("^https?%:%/%/") then return end
|
||||
if link.target:find("^mailto%:") then return end
|
||||
|
||||
local fp, anchor = link.target:match("^(.+%.md)#?(.*)$")
|
||||
|
||||
-- early return for non markdown files
|
||||
if not fp then return end
|
||||
|
||||
-- early return for visited
|
||||
if visited[fp] then return end
|
||||
visited[fp] = true
|
||||
|
||||
local f = io.open(fp)
|
||||
-- early return for broken internal links
|
||||
if f == nil then return link.content else f:close() end -- @todo maybe log broken internal links
|
||||
|
||||
local part_fp = fp:gsub("^(.+)%.md$", "public_html/%1.html.part")
|
||||
local f = assert(io.open(part_fp), "\n" ..
|
||||
"[ERROR] could not open " .. part_fp .. " for reading.")
|
||||
local rawblock = RawBlock(FORMAT, f:read("a")); f:close()
|
||||
parts:insert(rawblock)
|
||||
end },
|
||||
{ Meta = function (meta)
|
||||
meta["parts"] = parts
|
||||
return meta
|
||||
end }
|
||||
}
|
|
@ -6,7 +6,7 @@ local Inlines = pandoc.Inlines
|
|||
return {
|
||||
{ Link = function(l)
|
||||
-- early return for external links
|
||||
if l.target:find("^https?%:%/%/") then return end
|
||||
if l.target:find("^https?%:%/%/") then return end -- @todo resolve external links
|
||||
if l.target:find("^mailto%:") then return end
|
||||
|
||||
local fp, slug, anchor = l.target:match("^((.+)%.md)#?(.*)$")
|
||||
|
@ -17,7 +17,8 @@ return {
|
|||
-- early return for broken internal links
|
||||
if f == nil then return l.content else f:close() end -- @todo maybe log broken internal links
|
||||
|
||||
l.target = ("#%s%s"):format(slug, anchor)
|
||||
l.target = ("%s.html#%s"):format(slug, anchor)
|
||||
l.attributes.target = "internal"
|
||||
|
||||
return l
|
||||
end }
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
SCRIPT_NAME = "resolve_internal_links.lua"
|
||||
os.setlocale("C")
|
||||
|
||||
local Inlines = pandoc.Inlines
|
||||
|
||||
local page_slug
|
||||
|
||||
return {
|
||||
{ Meta = function(meta)
|
||||
page_slug = meta["slug"]
|
||||
end },
|
||||
{ Link = function(l)
|
||||
-- early return for external links
|
||||
if l.target:find("^https?%:%/%/") then return end
|
||||
if l.target:find("^mailto%:") then return end
|
||||
|
||||
local fp, slug, anchor = l.target:match("^((.+)%.md)#?(.*)$")
|
||||
-- early return for non markdown files
|
||||
if not fp then return end
|
||||
|
||||
local f = io.open(fp)
|
||||
-- early return for broken internal links
|
||||
if f == nil then return l.content else f:close() end -- @todo maybe log broken internal links
|
||||
|
||||
l.target = ("%s.html#%s%s"):format(page_slug, slug, anchor)
|
||||
|
||||
return l
|
||||
end }
|
||||
}
|
|
@ -15,15 +15,14 @@ $else$
|
|||
<meta name="description" content="bavbavhaus.net" />
|
||||
$endif$
|
||||
<title>$pagetitle$, bavbavhaus.net</title>
|
||||
<link rel="icon" href="favicon.svg" />
|
||||
<link rel="stylesheet" media="screen" href="css/style.css" />
|
||||
<link rel="stylesheet" media="print" href="css/print.css" />
|
||||
<script src="js/resolve_internal_links.js"></script>
|
||||
</head>
|
||||
<body$if(slug)$ id="$slug$"$endif$>
|
||||
<body$if(sourcefile)$ id="$sourcefile$"$endif$>
|
||||
<main>
|
||||
<article id="verso" class="post">
|
||||
<article class="post">
|
||||
<header>
|
||||
<h1>$if(index)$$else$<a href="index.html">bavbavhaus.net</a>/$endif$<a href="$slug$.html">$pagetitle$</a></h1>
|
||||
<h1>$pagetitle$</h1>
|
||||
</header>
|
||||
<div class="content">
|
||||
$if(description)$
|
||||
|
@ -47,12 +46,6 @@ $abstract$
|
|||
$endif$
|
||||
$body$
|
||||
</article>
|
||||
<article id="recto">
|
||||
$for(parts)$
|
||||
$it$
|
||||
$endfor$
|
||||
</div>
|
||||
</article>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
<article$if(slug)$ id="$slug$"$endif$ class="post tail">
|
||||
<header>
|
||||
<h1><a href="$slug$.html">$pagetitle$</a></h1>
|
||||
</header>
|
||||
<div class="content">
|
||||
$if(description)$
|
||||
<div class="description">
|
||||
$description$
|
||||
</div>
|
||||
$endif$
|
||||
$if(toc)$
|
||||
<nav>
|
||||
$if(toc-title)$
|
||||
<h2>$toc-title$</h2>
|
||||
$endif$
|
||||
$table-of-contents$
|
||||
</nav>
|
||||
$endif$
|
||||
$if(abstract)$
|
||||
<div class="abstract">
|
||||
<h2 class="abstract-title">$abstract-title$</h2>
|
||||
$abstract$
|
||||
</div>
|
||||
$endif$
|
||||
$body$
|
||||
</div>
|
||||
</article>
|
|
@ -0,0 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html
|
||||
xmlns="http://www.w3.org/1999/xhtml"
|
||||
lang="sl"
|
||||
xml:lang="sl"
|
||||
>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport"
|
||||
content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<meta name="description" content="bavbavhaus.net" />
|
||||
<title>bavbavhaus.net</title>
|
||||
<link rel="icon" href="favicon.svg" />
|
||||
<link rel="stylesheet" media="screen" href="css/style.css" />
|
||||
<link rel="stylesheet" media="screen" href="css/index.css" />
|
||||
</head>
|
||||
<body id="index">
|
||||
<main>
|
||||
<iframe name="verso" src="intro.html"></iframe>
|
||||
<iframe name="recto"></iframe>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,6 @@
|
|||
document.addEventListener("click", e => {
|
||||
const anchor = e.target.closest("a[target=\"internal\"");
|
||||
if (anchor && window.name != "") {
|
||||
anchor.target = window.name === "verso" ? "recto" : "verso";
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue