implement autotopia subsite infrastructure

This commit is contained in:
Astro 2019-02-27 23:49:28 +01:00
parent fe3480debf
commit cb6b10ea46
5 changed files with 177 additions and 1 deletions

View File

@ -37,6 +37,7 @@ DESTDIR?=www-export
STYLE=xsl/xhtml5.xsl
DS_STYLE=xsl/datenspuren/xhtml5.xsl
DS_YEAR=2018
AUTOTOPIA_STYLE=xsl/autotopia/xhtml5.xsl
# Document-Type-Definition:
DTD:=dtd/c3d2web.dtd
# XML-Katalog (Pfad zu den DTDs) - wird benötigt vom Validator
@ -55,7 +56,7 @@ DS_SCHEDULE=$(patsubst content/static/datenspuren/$(DS_YEAR)/fahrplan/schedule/%
DATESTAMP=build/.stamp-$(shell date +%Y-%m-%d)
# Dateinamen der zu erzeugenden html-Dateien:
CONTENT=$(PAGES) $(NEWS_PAGES) $(DS_PAGES) $(DS_FEEDS) $(NEWSFILES) build/calendar.html build/datenspuren/$(DS_YEAR)/pois.json
CONTENT=$(PAGES) $(NEWS_PAGES) $(DS_PAGES) $(DS_FEEDS) $(AUTOTOPIA_PAGES) $(NEWSFILES) build/calendar.html build/datenspuren/$(DS_YEAR)/pois.json
# 'normale' Seiten:
PAGES:=$(patsubst content/pages/%.xml, build/%.html, $(wildcard content/pages/*.xml))
@ -84,6 +85,8 @@ DS_FEEDS:= \
build/datenspuren/2013/mitschnitte-rss.xml \
build/datenspuren/2014/mitschnitte-rss.xml
AUTOTOPIA_PAGES:=$(patsubst content/autotopia/%.xml, build/autotopia/%.html, $(wildcard content/autotopia/*.xml))
# Quellen
NEWSITEMS:=$(wildcard content/news/*.xml)
#CLEAN=$(CONTENT) $(NEWSFILES) $(WWW_CCC_DE_UPDATES) $(CALENDAR_SUMMARY) $(DS_PAGES) $(DS_FEEDS)
@ -121,6 +124,7 @@ export: www
$(DATESTAMP):
mkdir -p build
mkdir -p build/datenspuren/$(DS_YEAR)/
mkdir -p build/autotopia/
$(RM) $(wildcard build/.stamp-*)
touch $@
@ -353,6 +357,10 @@ build/datenspuren/$(DS_YEAR)/pois.json:
wget -O $@ --post-data="data=[out:json];($(foreach a, 'amenity'='restaurant' 'amenity'='fast_food' 'amenity'='cafe' 'amenity'='ice_cream' 'amenity'='bakery' 'shop'='convenience' 'shop'='supermarket' 'shop'='tobacco' 'amenity'='pub' 'amenity'='biergarten' 'amenity'='drinking_water', $(foreach t, node way relation, $t(51.06,13.70,51.10,13.74)[${a}];)));out center qt;" http://overpass-api.de/api/interpreter
build/autotopia/%html : STYLE=$(AUTOTOPIA_STYLE)
build/autotopia/%.html: content/autotopia/%.xml $(AUTOTOPIA_STYLE) news.xml
$(call xml_process)
xhtml5-validate: $(patsubst build/%.html, build/%.html.xhtml5-validate, $(CONTENT))
build/%.html.xhtml5-validate: build/%.html
./scripts/validate_xhtml5.sh $<

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE page SYSTEM "http://www.c3d2.de/dtd/c3d2web.dtd">
<page pagetitle="Start" title="Autotopia">
<p>
…eine Veranstaltungsreihe.
</p>
<h2>News</h2>
<news-list prefix="autotopia-" details="all"/>
</page>

View File

@ -0,0 +1,34 @@
body {
background-color: white;
color: #111;
margin: 0;
padding: 0;
}
.wrapper {
margin: 0.5em auto;
max-width: 60em;
min-height: 560px;
background: right top no-repeat url('autotopia.png');
/* make a "containing block" */
position: relative;
}
nav ul, nav ul li {
list-style-type: none;
margin: 0;
padding: 0;
}
nav ul li a {
display: inline-block;
width: 0;
height: 0;
overflow: hidden;
padding: 30px 40px 0 0;
text-decoration: none;
}
nav .index {
position: absolute;
right: 375px;
top: 110px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

121
xsl/autotopia/xhtml5.xsl Normal file
View File

@ -0,0 +1,121 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
exclude-result-prefixes="xsl date dc itunes">
<xsl:include href="../common.xsl" />
<xsl:output method="xml"
version="1.0"
encoding="utf-8"
indent="yes"/>
<xsl:strip-space elements="p ul td"/>
<xsl:template match="/page">
<xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html&gt;
</xsl:text>
<xsl:variable name="title">
<xsl:choose>
<xsl:when test="/page/@pagetitle">
<xsl:value-of select="/page/@pagetitle"/>
</xsl:when>
<xsl:when test="/page/@title">
<xsl:value-of select="/page/@title"/>
</xsl:when>
<xsl:otherwise>
<xsl:comment><xsl:text> missing title </xsl:text></xsl:comment>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<html lang="de" xml:lang="de" dir="ltr">
<xsl:call-template name="htmlhead">
<xsl:with-param name="title" select="$title"/>
</xsl:call-template>
<body>
<div class="wrapper">
<nav>
<ul>
<li class="index">
<a title="Start" href="index.html">Start</a>
</li>
<!-- <li> -->
<!-- <a href="about.html">Über</a> -->
<!-- </li> -->
<!-- <li> -->
<!-- <a href="cfp.html">CfP</a> -->
<!-- </li> -->
<!-- <li> -->
<!-- <a href="fahrplan.html">Programm</a> -->
<!-- </li> -->
</ul>
</nav>
<article>
<xsl:apply-templates/>
</article>
</div>
</body>
</html>
</xsl:template>
<xsl:template name="htmlhead">
<xsl:param name="title"/>
<head>
<meta charset="utf-8" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<meta name="description" content="Veranstaltungsreihe die sich mit gesellschaftlichen Auswirkungen von Automatiserung beschäftigt" />
<meta name="keywords" content="automatisierung" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<meta name="robots" content="index,follow" />
<meta name="language" content="German" />
<link rel="stylesheet" type="text/css" href="autotopia.css" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
<!--link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="news-rss.xml" />
<link rel="alternate" type="application/atom+xml" title="Atom 1.0" href="news-atom.xml" /-->
<title>
<xsl:text>Autotopia — </xsl:text>
<xsl:value-of select="$title" />
</title>
</head>
</xsl:template>
<xsl:template match="news-list">
<xsl:variable name="prefix" select="@prefix"/>
<xsl:variable name="details" select="@details"/>
<xsl:for-each select="document('../../news.xml')/page/news/newsfile">
<xsl:sort select="date:seconds(document(concat('../../', .))/item/@date)" data-type="number" order="descending" />
<xsl:variable name="newsfile" select="."/>
<xsl:for-each select="document(concat('../../', $newsfile))/item">
<xsl:if test="((string-length($prefix) = 0) or starts-with($newsfile, concat('content/news/', $prefix))) and (($details != 'resources-only') or (count(resource) &gt; 0))">
<h3 class="summary">
<date>
<xsl:call-template name="get-short-datestring">
<xsl:with-param name="date" select="@date"/>
</xsl:call-template>
</date>
<a href="https://www.c3d2.de/{substring-before(substring-after($newsfile, 'content/'), '.xml')}.html" class="url">
<xsl:value-of select="@title"/>
</a>
</h3>
<!-- Diese Elemente entsprechen Block.class aus xsd/c3d2web.xsd -->
<!--xsl:apply-templates select=".//*[name() = 'dl' or name() = 'p' or name() = 'ul' or name() = 'ol' or name() = 'pre']"/-->
<xsl:apply-templates/>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
<xsl:template match="item/image">
<!-- Nix Bilder in den Autotopia-News -->
</xsl:template>
</xsl:stylesheet>