Split event archive to separate pages per year

This commit is contained in:
Reinhard Müller 2019-03-13 22:37:19 +01:00
parent 015c58eebe
commit e8432c4c5d
5 changed files with 154 additions and 48 deletions

47
events/Makefile Normal file
View File

@ -0,0 +1,47 @@
# -----------------------------------------------------------------------------
# Makefile for FSFE website build, preparation for events subdirectory
# -----------------------------------------------------------------------------
.PHONY: all
.SECONDEXPANSION:
# -----------------------------------------------------------------------------
# Copy event archive template to each of the years
# -----------------------------------------------------------------------------
# All years for which a subdirectory exists
ARCH_YEARS := $(sort $(wildcard [0-9][0-9][0-9][0-9]))
# No archive for the current year
ARCH_YEARS := $(filter-out $(lastword $(ARCH_YEARS)),$(ARCH_YEARS))
# ... and the year before
ARCH_YEARS := $(filter-out $(lastword $(ARCH_YEARS)),$(ARCH_YEARS))
# Languages in which the template exists
ARCH_LANGS := $(suffix $(basename $(wildcard archive-template.??.xhtml)))
# .xhtml files to generate
ARCH_XHTML := $(foreach year,$(ARCH_YEARS),$(foreach lang,$(ARCH_LANGS),$(year)/$(year)$(lang).xhtml))
all: $(ARCH_XHTML)
$(ARCH_XHTML): %.xhtml: archive-template$$(suffix $$*).xhtml
@echo "* Creating $@"
@# $(dir $@) returns YYYY/, we abuse the slash for closing the sed command
@sed 's/:YYYY:/$(dir $@)g' $< > $@
# .sources files to generate
ARCH_SOURCES := $(foreach year,$(ARCH_YEARS),$(year)/$(year).sources)
all: $(ARCH_SOURCES)
$(ARCH_SOURCES): %.sources:
@echo "* Creating $@"
@echo "events/$(dir $@)event-*:[]\nevents/$(dir $@).event-*:[]\nlocalmenuinfo:[]\n" > $@
# .xsl files to generate
ARCH_XSL := $(foreach year,$(ARCH_YEARS),$(year)/$(year).xsl)
all: $(ARCH_XSL)
$(ARCH_XSL): %.xsl: events.xsl
@echo "* Creating $@"
@sed -r 's/(import href=")/\1..\//; s/(\.\.\/about)/..\/\1/' $< > $@

View File

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<html>
<head>
<title>Event Archive for :YYYY: - FSFE</title>
</head>
<body class="article">
<p id="category"><a href="/events/events.html">Events</a></p>
<localmenu dir="/events/" set="year" id=":YYYY:" link=":YYYY:/:YYYY:.html">:YYYY:</localmenu>
<h1>Event Archive for :YYYY:</h1>
<include-events/>
</body>
<sidebar promo="none">
<h2>Follow our events</h2>
<p>
Free Software Foundation Europe participates in many Free Software
events. Official events end up on the
<a href="/events/events.html">event list</a>. To make sure to not miss
them you can follow our events via
<a href="/events/events.rss">RSS</a> or as
<a href="webcal://fsfe.org/events/events.ics">iCalendar feed</a>.
</p>
<div class="share-buttons-sidebar">
<a target="_blank" href="/events/events.rss">
<button class="share-button-sidebar share-rss">RSS Feed</button>
</a>
<a target="_blank" href="webcal://fsfe.org/events/events.ics">
<button class="share-button-sidebar share-cal">iCalendar feed</button>
</a>
</div>
</sidebar>
</html>

View File

@ -1,58 +1,73 @@
<?xml version="1.0" encoding="UTF-8" ?>
<?xml version="1.0" encoding="UTF-8"?>
<html>
<head>
<title>Events</title>
<title>Events - FSFE</title>
</head>
<body class="article" microformat="h-entry">
<h1 class="p-name">Events</h1>
<body class="article">
<h1>Events</h1>
<include-events/>
<h2><a href="2017/2017.html">Event archives</a></h2>
<p>
For older events, please see our event archives.
<a class="learn-more" href="2017/2017.html"/>
</p>
</body>
<sidebar promo="none">
<h2>Follow our events</h2>
<p>Free Software Foundation Europe participates in many Free
Software events. Official events end up on this page. To make sure to not miss them you can follow our events via <a href="/events/events.en.rss">RSS</a> or as <a href="webcal://fsfe.org/events/events.en.ics">iCalendar feed</a>.</p>
<sidebar promo="none">
<h2>Follow our events</h2>
<div class="share-buttons-sidebar">
<a target="_blank" href="events.rss">
<button class="share-button-sidebar share-rss">RSS Feed</button>
</a>
<a target="_blank" href=" ">
<button class="share-button-sidebar share-cal">iCalendar feed</button>
</a>
</div>
<p>
Free Software Foundation Europe participates in many Free Software
events. Official events end up on this page. To make sure to not miss
them you can follow our events via
<a href="events.rss">RSS</a> or as
<a href="webcal://fsfe.org/events/events.ics">iCalendar feed</a>.
</p>
<h2>Add an event</h2>
<p> If you know about a FSFE related event that is not yet
listed here or that you run on your own, you can easily add it by
using our <a href="/community/tools/eventregistration.html">event
announcement tool</a>.
<div class="share-buttons-sidebar">
<a target="_blank" href="events.rss">
<button class="share-button-sidebar share-rss">RSS Feed</button>
</a>
<a target="_blank" href="webcal://fsfe.org/events/events.ics">
<button class="share-button-sidebar share-cal">iCalendar feed</button>
</a>
</div>
<div style="margin: 0 0 2em 0;">
<a class="big-donate" href="/community/tools/eventregistration.html">Add event</a>
</div>
</p>
<h2>Code of Conduct</h2>
<p>All FSFE's events are covered by our <a href="https://fsfe.org/about/codeofconduct.html">Code of Conduct</a> that kindly asks all participants to be excellent to each other.
</p>
<h2>Self-created events</h2>
<p>Some inofficial and self-organised community events are only announced in our <a href="http://wiki.fsfe.org/Events">wiki calendar</a>. If you are interested, make sure to not miss them.
</p>
</sidebar>
<h2>Add an event</h2>
<p>
If you know about a FSFE related event that is not yet listed here or
that you run on your own, you can easily add it by using our
<a href="/community/tools/eventregistration.html">event announcement tool</a>.
<div style="margin: 0 0 2em 0;">
<a class="big-donate" href="/community/tools/eventregistration.html">Add event</a>
</div>
</p>
<h2>Code of Conduct</h2>
<p>
All FSFE's events are covered by our
<a href="/about/codeofconduct.html">Code of Conduct</a> that kindly asks
all participants to be excellent to each other.
</p>
<h2>Self-created events</h2>
<p>
Some inofficial and self-organised community events are only announced in
our <a href="http://wiki.fsfe.org/Events">wiki calendar</a>. If you are
interested, make sure to not miss them.
</p>
</sidebar>
<text id="current">Current events</text>
<text id="future">Future events</text>
<text id="past">Past events</text>
<text id="more">Read more...</text>
<text id="page">External event homepage...</text>
</html>
<!--
Local Variables: ***
mode: xml ***
End: ***
-->

View File

@ -1,2 +1,2 @@
events/*/event-*:[]
events/*/*/event-*:[]
events/$thisyear/event-*:[]
events/$lastyear/event-*:[]

View File

@ -143,12 +143,17 @@
<!-- Before the first event, include the header -->
<xsl:if test="position() = 1 and $header != ''">
<h2>
<xsl:call-template name="generate-id-attribute">
<xsl:with-param name="title" select="/buildinfo/document/text[@id = $header]" />
</xsl:call-template>
<xsl:variable name="headertext">
<xsl:value-of select="/buildinfo/document/text[@id = $header]" />
</h2>
</xsl:variable>
<xsl:if test="$headertext != ''">
<xsl:element name="h2">
<xsl:call-template name="generate-id-attribute">
<xsl:with-param name="title" select="$headertext" />
</xsl:call-template>
<xsl:value-of select="$headertext" />
</xsl:element>
</xsl:if>
</xsl:if>