mirror of
https://git.bolliret.ch/pcs/pcs-website
synced 2026-01-18 11:51:37 +01:00
Updated some comments and documentation
This commit is contained in:
parent
0906ac9557
commit
fec3a02700
3 changed files with 6 additions and 31 deletions
|
|
@ -30,20 +30,13 @@ echo "<h3>Unser nächster Anlass: </h3><br/>"
|
||||||
# As whole day events have a starting time of exactly 00:00 we consider this starting time equivalent to a whole day event.
|
# As whole day events have a starting time of exactly 00:00 we consider this starting time equivalent to a whole day event.
|
||||||
# Yes, that' means we can't have all those midnight parties as those turn into whole day events.
|
# Yes, that' means we can't have all those midnight parties as those turn into whole day events.
|
||||||
# Once we have this all collected we print that into the markdown representation of a list item with a sublist for the subsequent fields
|
# Once we have this all collected we print that into the markdown representation of a list item with a sublist for the subsequent fields
|
||||||
# We wrap each string into a div as Summaries like "40. Appenzeller Luftpistolenmeisterschaft 2025" would be rendered int a numbered list representation in markdown
|
# But! Beware: we are for one not printing the newlines (except for one at the end of each event) and for the other our lines start with a YYYYMMDD representation of the date
|
||||||
# turning it into "1. Appenzeller Luftpistolenmeisterschaft 2025" which gives it a completely different meaning
|
|
||||||
# But! Beware: we are for one not printing the newlines (except for one at the end of eac event) and for the other our lines start with a YYYYMMDD representation of the date
|
|
||||||
# So we have for each event a line starting with YYYYMMDD followed by the markdown representation of a list item containing a sublist with all fields terminated with a newline
|
# So we have for each event a line starting with YYYYMMDD followed by the markdown representation of a list item containing a sublist with all fields terminated with a newline
|
||||||
# Thats the first awk command
|
# Thats the first awk command
|
||||||
# Second awk command filters all lines which are in the past (yes, most probably this could have been done in the first awk call as well)
|
# Second awk command filters all lines which are in the past (yes, most probably this could have been done in the first awk call as well)
|
||||||
# Now we sort those remaining lines as they come in absolute random order (that's the reason for having an event squeezed on one line, and starting the line with YYYYMMDD representation of te event date)
|
# Now we sort those remaining lines as they come in absolute random order (that's the reason for having an event squeezed on one line, and starting the line with YYYYMMDD representation of te event date)
|
||||||
# Now we no longer need the leading timestamp so we cut it off
|
# Now we no longer need the leading timestamp so we cut it off
|
||||||
# Last thing to do is to expand the list items into separate lines so they are actually markdown
|
# As we only want the next event (which is the one on top of our now sorted list) we just grab the first line
|
||||||
# I chose a very simple approach: As each field is wrapped in a div I just use closing div tag as indication (this breaks if a calendar-entry contains HTML with a div element)
|
|
||||||
# Additionally after the closing tag I add an additional .
|
|
||||||
# This is due to a limitation of the list rendered which does not render the sub-list if the last sub-list item terminates with a closing div tag
|
|
||||||
# and finally I trim excessive linefeeds (aboave approach leads to double linefeeds after an event as the event was already a seperate line and adding linefeeds adds then one too much)
|
|
||||||
|
|
||||||
echo "$ICS_DATA" | awk 'BEGIN{FS=":"}
|
echo "$ICS_DATA" | awk 'BEGIN{FS=":"}
|
||||||
/^DTSTART/{dtstart=$2}
|
/^DTSTART/{dtstart=$2}
|
||||||
/^SUMMARY/{summary=$2}
|
/^SUMMARY/{summary=$2}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ echo ""
|
||||||
# Once we have this all collected we print that into the markdown representation of a list item with a sublist for the subsequent fields
|
# Once we have this all collected we print that into the markdown representation of a list item with a sublist for the subsequent fields
|
||||||
# We wrap each string into a div as Summaries like "40. Appenzeller Luftpistolenmeisterschaft 2025" would be rendered int a numbered list representation in markdown
|
# We wrap each string into a div as Summaries like "40. Appenzeller Luftpistolenmeisterschaft 2025" would be rendered int a numbered list representation in markdown
|
||||||
# turning it into "1. Appenzeller Luftpistolenmeisterschaft 2025" which gives it a completely different meaning
|
# turning it into "1. Appenzeller Luftpistolenmeisterschaft 2025" which gives it a completely different meaning
|
||||||
# But! Beware: we are for one not printing the newlines (except for one at the end of eac event) and for the other our lines start with a YYYYMMDD representation of the date
|
# But! Beware: we are for one not printing the newlines (except for one at the end of each event) and for the other our lines start with a YYYYMMDD representation of the date
|
||||||
# So we have for each event a line starting with YYYYMMDD followed by the markdown representation of a list item containing a sublist with all fields terminated with a newline
|
# So we have for each event a line starting with YYYYMMDD followed by the markdown representation of a list item containing a sublist with all fields terminated with a newline
|
||||||
# Thats the first awk command
|
# Thats the first awk command
|
||||||
# Second awk command filters all lines which are in the past (yes, most probably this could have been done in the first awk call as well)
|
# Second awk command filters all lines which are in the past (yes, most probably this could have been done in the first awk call as well)
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,9 @@ New Lektor Approach:
|
||||||
thats all!
|
thats all!
|
||||||
|
|
||||||
|
|
||||||
To update "Termine" page run:
|
To update "Home" and Termine" pages run the following commands (or just restart the docker container as it does this automatically at start):
|
||||||
|
|
||||||
|
docker run -v ${PWD}/lektor/lektordata:/opt/lektor lektorcontainer /bin/bash -c "/opt/lektor/scripts/calendar-fetcher-main.sh 'https://backoffice.pc-stammertal.ch/remote.php/dav/public-calendars/RqLX5wj25aY6cpnP?export' > /opt/lektor/project/content/contents.lr"
|
||||||
docker run -v ${PWD}/lektor/lektordata:/opt/lektor lektorcontainer /bin/bash -c "/opt/lektor/scripts/calendar-fetcher.sh 'https://backoffice.pc-stammertal.ch/remote.php/dav/public-calendars/RqLX5wj25aY6cpnP?export' > /opt/lektor/project/content/termine/contents.lr"
|
docker run -v ${PWD}/lektor/lektordata:/opt/lektor lektorcontainer /bin/bash -c "/opt/lektor/scripts/calendar-fetcher.sh 'https://backoffice.pc-stammertal.ch/remote.php/dav/public-calendars/RqLX5wj25aY6cpnP?export' > /opt/lektor/project/content/termine/contents.lr"
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -30,26 +31,7 @@ New Lektor Approach:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
If you would like to start from scratch you would delete all contents in lektordata/project and run
|
If you would like to start from scratch you would delete all contents in lektordata/project and run the following command (but that will interfere with the scripts run by entrypoint.sh!)
|
||||||
|
|
||||||
docker run -it -v ${PWD}/lektor/lektordata:/opt/lektor lektorcontainer lektor quickstart
|
docker run -it -v ${PWD}/lektor/lektordata:/opt/lektor lektorcontainer lektor quickstart
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Old Hugo Approach:
|
|
||||||
|
|
||||||
hugo new site pcs --format yaml
|
|
||||||
cd pcs
|
|
||||||
git init
|
|
||||||
hugo mod init pcsmod
|
|
||||||
hugo mod get github.com/imfing/hextra
|
|
||||||
|
|
||||||
add the following to hugo.yaml:
|
|
||||||
module:
|
|
||||||
imports:
|
|
||||||
- path: github.com/imfing/hextra
|
|
||||||
|
|
||||||
hugo new content/_index.md
|
|
||||||
hugo new content/docs/_index.md
|
|
||||||
hugo server --buildDrafts --disableFastRender
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue