mirror of
https://git.bolliret.ch/pcs/pcs-website
synced 2026-01-18 16:51:36 +01:00
Getting the script executable within docker and making create the whole Termine page
This commit is contained in:
parent
9f0da84596
commit
b9b3f15249
4 changed files with 15 additions and 4 deletions
|
|
@ -1,9 +1,10 @@
|
||||||
FROM debian:latest
|
FROM debian:latest
|
||||||
|
|
||||||
RUN apt update
|
RUN apt update
|
||||||
RUN apt install -y python3-pip python3-venv pipx
|
RUN apt install -y python3-pip python3-venv pipx curl locales
|
||||||
RUN pipx install lektor
|
RUN pipx install lektor
|
||||||
RUN mkdir -p /opt/lektor/project && mkdir -p /opt/lektor/output
|
RUN mkdir -p /opt/lektor/project && mkdir -p /opt/lektor/output
|
||||||
|
RUN sed -i '/de_DE.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
|
||||||
|
|
||||||
WORKDIR /opt/lektor/project
|
WORKDIR /opt/lektor/project
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,4 +18,3 @@ body:
|
||||||
| So. 28. September 2025 | Schwaderlohschiessen | | Ermantingn\n |
|
| So. 28. September 2025 | Schwaderlohschiessen | | Ermantingn\n |
|
||||||
| Do. 23. August 2029 | Bezirkssommerschiessen | 18:00 | Unterstammheim |
|
| Do. 23. August 2029 | Bezirkssommerschiessen | 18:00 | Unterstammheim |
|
||||||
| Do. 30. August 2029 | Bezirkssommerschiessen | 18:00 | Unterstammheim |
|
| Do. 30. August 2029 | Bezirkssommerschiessen | 18:00 | Unterstammheim |
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,12 @@ ICS_DATA=$(curl -s "$ICS_URL")
|
||||||
|
|
||||||
TODAY=$(date +%Y%m%d)
|
TODAY=$(date +%Y%m%d)
|
||||||
|
|
||||||
|
echo "_model: page"
|
||||||
|
echo "---"
|
||||||
|
echo "title: Termine"
|
||||||
|
echo "---"
|
||||||
|
echo "body:"
|
||||||
|
echo ""
|
||||||
echo "| **Datum** | **Anlass** | **Zeit** | **Ort** |"
|
echo "| **Datum** | **Anlass** | **Zeit** | **Ort** |"
|
||||||
echo "|-------|--------|------|-----|"
|
echo "|-------|--------|------|-----|"
|
||||||
|
|
||||||
|
|
@ -30,11 +36,11 @@ echo "$ICS_DATA" | awk 'BEGIN{FS=":"}
|
||||||
if (location == "") location = "Kein Ort"
|
if (location == "") location = "Kein Ort"
|
||||||
|
|
||||||
date_str = substr(dtstart, 1, 4) "-" substr(dtstart, 5, 2) "-" substr(dtstart, 7, 2)
|
date_str = substr(dtstart, 1, 4) "-" substr(dtstart, 5, 2) "-" substr(dtstart, 7, 2)
|
||||||
cmd = "LC_TIME=de_DE.UTF-8 date -j -f \"%Y-%m-%d\" \"" date_str "\" +%a"
|
cmd = "LC_ALL=de_DE.UTF-8 date -d \"" date_str "\" +%a"
|
||||||
cmd | getline weekday
|
cmd | getline weekday
|
||||||
close(cmd)
|
close(cmd)
|
||||||
|
|
||||||
cmd = "LC_TIME=de_DE.UTF-8 date -j -f \"%Y-%m-%d\" \"" date_str "\" +%B"
|
cmd = "LC_ALL=de_DE.UTF-8 date -d \"" date_str "\" +%B"
|
||||||
cmd | getline month
|
cmd | getline month
|
||||||
close(cmd)
|
close(cmd)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,11 @@ New Lektor Approach:
|
||||||
thats all!
|
thats all!
|
||||||
|
|
||||||
|
|
||||||
|
To update "Termine" page run:
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
|
|
||||||
building the website for deployment is:
|
building the website for deployment is:
|
||||||
|
|
||||||
docker run -it -v ${PWD}/lektor/lektordata:/opt/lektor -p 5000:5000 lektorcontainer lektor build -O /opt/lektor/output
|
docker run -it -v ${PWD}/lektor/lektordata:/opt/lektor -p 5000:5000 lektorcontainer lektor build -O /opt/lektor/output
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue