Skip to content

Commit

Permalink
Close to completion
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasdille committed Feb 25, 2024
1 parent 5195593 commit f22add1
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 12 deletions.
8 changes: 4 additions & 4 deletions 2024-03-06_heise-devsec-Dependency-Updates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ slides:
summary:
- icon: link
text: Ops and Devs require many dependencies
- icons: lock-keyhole
- icon: lock-keyhole
text: Dependencies introduce (additional) security issues
- icons: arrows-rotate
- icon: arrows-rotate
text: Automated updates help stay on top
- icons: crosshairs
- icon: crosshairs
text: Automerging takes the load off dev and ops...
- icons: magnifying-glass-chart
- icon: magnifying-glass-chart
text: ...but requires thorough testing

events:
Expand Down
37 changes: 31 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ clean-all:
echo "Generating $$(basename $@)"; \
include $*

%.html: template.html %.yaml
SOURCES=$(shell find . -maxdepth 1 -name \*.yaml -printf '%P\n' | xargs -I{} basename {} .yaml)

$(addsuffix .html,$(SOURCES)):%.html: Makefile template.html %.yaml
@\
TITLE="$$(yq eval '.metadata.title' $*.yaml)"; \
SUBTITLE="$$(yq eval '.metadata.subtitle' $*.yaml)"; \
Expand All @@ -46,11 +48,34 @@ clean-all:
| xmlstarlet ed -P -N x="http://www.w3.org/1999/xhtml" -u "/x:html/x:body//x:section[@id='title']//x:a" -v "$${EVENT}" \
| xmlstarlet ed -P -N x="http://www.w3.org/1999/xhtml" -u "/x:html/x:body//x:section[@id='title']//x:a/@href" -v "$${LINK}" \
| xmlstarlet ed -P -N x="http://www.w3.org/1999/xhtml" -u "/x:html/x:body//x:section[@id='title']//x:img/@src" -v "$${LOGO}" \
| xmlstarlet ed -P -N x="http://www.w3.org/1999/xhtml" -a "/x:html/x:body//x:section[@id='title']" -t elem -n section \
| xmlstarlet ed -P -N x="http://www.w3.org/1999/xhtml" -a "/x:html/x:body//x:section[not(@id)]" -t attr -n id -v "FOO" \
| xmlstarlet ed -P -N x="http://www.w3.org/1999/xhtml" -a "/x:html/x:body//x:section[@id='FOO']" -t attr -n data-separator -v "^---$$" \
| xmlstarlet ed -P -N x="http://www.w3.org/1999/xhtml" -a "/x:html/x:body//x:section[@id='FOO']" -t attr -n data-separator-vertical -v "^--$$" \
>$@
>$@; \
yq eval '.slides[]' $*.yaml \
| while read -r FILE; do \
xmlstarlet ed --inplace -P -N x="http://www.w3.org/1999/xhtml" \
--insert '/x:html/x:body//x:section[@id="summary"]' --type elem --name section \
--append '/x:html/x:body//x:section[@id="summary"]/preceding::section[1]' --type attr --name data-markdown --value "$${FILE}" \
--append '/x:html/x:body//x:section[@id="summary"]/preceding::section[1]' --type attr --name data-separator --value "^---$$" \
--append '/x:html/x:body//x:section[@id="summary"]/preceding::section[1]' --type attr --name data-vertical-separator --value "^--$$" \
--insert '/x:html/x:body//x:section[@id="summary"]' --type text --name "" --value $$'\n' \
$@; \
done; \
xmlstarlet ed --inplace -P -N x="http://www.w3.org/1999/xhtml" \
--insert '/x:html/x:body//x:section[@id="summary"]' --type text --name "" --value $$'\n' \
$@; \
yq eval '.summary[] | "<li><span class=\"fa-li\"><i class=\"fa-duotone fa-" + .icon + "\"></i></span> " + .text + ")</li>"' $*.yaml \
| while read -r LINE; do \
xmlstarlet ed --inplace -P -N x="http://www.w3.org/1999/xhtml" \
--subnode '/x:html/x:body//x:section[@id="summary"]/x:ul[@id="bullets"]' --type text --name "" --value "$${LINE}" \
--subnode '/x:html/x:body//x:section[@id="summary"]/x:ul[@id="bullets"]' --type text --name "" --value $$'\n' \
$@; \
done; \
yq eval '.events | reverse | .[] | .date + "<a href=\"" + .homepage + "\">" + .name + "</a>: <a href=\"" + .title + "\">" + .title + "</a>"' $*.yaml \
| while read -r LINE; do \
xmlstarlet ed --inplace -P -N x="http://www.w3.org/1999/xhtml" \
--append '/x:html/x:body//x:section[@id="summary"]/x:h3[@id="events"]' --type text --name "" --value "$${LINE}" \
--append '/x:html/x:body//x:section[@id="summary"]/x:h3[@id="events"]' --type text --name "" --value $$'\n' \
$@; \
done

.PHONY:
web-$(COMMIT):
Expand Down
2 changes: 0 additions & 2 deletions template.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ <h2>Summary</h2>
<i class="fa-duotone fa-4x fa-lightbulb-on" style="float: right;"></i>

<ul id="bullets" class="fa-ul" style="line-height: 1.5em;">
<li><span class="fa-li"><i class="fa-duotone fa-link"></i></span> First item</li>
<li><span class="fa-li"><i class="fa-duotone fa-lock-keyhole"></i></span> Second item</li>
</ul>

<h3 id="events">Upcoming events</h3>
Expand Down

0 comments on commit f22add1

Please sign in to comment.