From 0316b1e2e1137f260d16d3afd73bbaf681d9a24f Mon Sep 17 00:00:00 2001 From: Dorian Date: Mon, 18 Apr 2022 19:11:02 +0200 Subject: [PATCH] finish README.md and syn.sh to be ready for upload --- .gitignore | 3 +- README.md | 67 ++++++++++++++++++++++++---------- content/calendar/calendar.yaml | 7 ---- requierement.txt | 4 ++ sync.sh | 6 +++ theme/static/css/header.css | 9 ++--- theme/static/css/main.css | 27 +++++++------- theme/templates/index.html | 10 ++--- 8 files changed, 81 insertions(+), 52 deletions(-) create mode 100644 requierement.txt create mode 100644 sync.sh diff --git a/.gitignore b/.gitignore index d820931..bfc8b3a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ output/* -venv/ \ No newline at end of file +venv/ +.env \ No newline at end of file diff --git a/README.md b/README.md index 6d6fd12..910c179 100644 --- a/README.md +++ b/README.md @@ -3,50 +3,79 @@ ## Editing content -The content files are in the `content/` directory. +The content files are in the `content/` directory, in the form of `markdown` files, in different languages. -`markdown` file exists in different languages, they're in `content/projects` (the texts presentation of the different projects) or `content/pages` (mainly the index, which is the intro + bio before the calendar). +The `content/calendar` directory contains one `yaml` file with the currently planned _walks_, see next session on how to edit. + +The `content/projects` directory contains the texts presentation of the different projects. + +The `content/pages` directory contains the other website pages: the index/bio/intro, the gallery (empty because there is no text). Images can be dropped in the `content/gallery` folder, name as no importance, a plugin is going to resize them and sort them by hours of the day they were taken (using their metadata). ## Adding walk entries -The moonwalk calendar is a `.yaml` file, in `content/calendar/`. +The moonwalk calendar is a `yaml` file, in `content/calendar/`. To add a new entry: 1. open the website in a browser and go to the calendar to see what are the next New/Full moon dates -2. either copy the date by hand (with `-` between 2-digit numbers) or click on the date box on the calendar webpage (it will automatically copy it) -3. add a new entry in the `.yaml` by pasting the date (at one more indentation level than the `calendar:` key) -4. fill the other field like so: - +2. either copy the date by hand (with `-` between 2-digit numbers) or click anything on the related date box on the calendar webpage (it will automatically copy the data) +3. add a new entry in the `yaml` file by pasting the date (at one more indentation level than the `calendar:` key) +4. fill with the other fields like so: ```yaml -calendar: - - #Full moon walk on the 18.03.22 - 18-03-22: - start_time: "18:00" + calendar: + + #New Moon walk on the 30.04.22 + 30-04-22: + event_type: + en: "Walk" + fr: "Ballade" + nl: "Wandelen" + es: "Paseos" + start_time: "20:00" start_location: "Drève du comte" start_location_link: "https://www.openstreetmap.org/way/14502214#map=17/50.79518/4.40096" + ``` -Everytime the webpage load it will first get the New/Full moon dates from the API, then see if any entries in the calendar matches one of those date and if it does, add the corresponding informations. +Everytime the webpage load it will first get the New/Full moon dates from the API, then see if any entries in the calendar matches one of those date and if it does, add the corresponding informations to it. ## Regenerate the website after editing content -Init steps +### Init steps + 1. clone the repository -2. install pelican +2. install requirements `pip install -r requirements.txt` +3. create a file with name `.env` in the root folder containing the `ftp` logs, like this +```bash +$HOST = "" +$USERNAME = "" +$PASSWORD = "" +``` + +### For every updates of the website -On every updates 1. make your edits to the `content/` folder 2. `add`, `commit` and `push` your changes to the directory 3. open a terminal in the root folder of this project and launch the `pelican` command to regenerate -4. copy the new files generated in the `output/` folder to the server +4. launch `sync.sh` + +If a change don't appear immediatly it's possible you have to hard refresh using `ctrl`+`shift`+`r`. -if a change don't appear immediatly it's possible you have to hard refresh (using `ctrl`+`shift`+`r`). \ No newline at end of file + +* we could do an automatic newsletter or RSS flux ? + +* testing other region in calendar: + # -- test for california + # latitude: 36.7783 + # longitude: -119.4179 + # timezone: "America/Los_Angeles" + # https://www.timeanddate.com/moon/phases/usa/california-city + # it works !! + + --> \ No newline at end of file diff --git a/content/calendar/calendar.yaml b/content/calendar/calendar.yaml index a9152a9..07f9ec9 100644 --- a/content/calendar/calendar.yaml +++ b/content/calendar/calendar.yaml @@ -6,13 +6,6 @@ longitude: 4.40250 timezone: "Europe/Brussels" - # -- test for california - # latitude: 36.7783 - # longitude: -119.4179 - # timezone: "America/Los_Angeles" - # https://www.timeanddate.com/moon/phases/usa/california-city - # it works !! - calendar: #New Moon walk on the 30.04.22 diff --git a/requierement.txt b/requierement.txt new file mode 100644 index 0000000..96bfac7 --- /dev/null +++ b/requierement.txt @@ -0,0 +1,4 @@ +pelican +markdown +pyyaml +pelican-image-process \ No newline at end of file diff --git a/sync.sh b/sync.sh new file mode 100644 index 0000000..3707d2d --- /dev/null +++ b/sync.sh @@ -0,0 +1,6 @@ +if [ ! -f .env ] +then + export $(cat .env | xargs) +fi + +lftp -e "open $HOST; user $USERNAME $PASSWORD; mirror -Rnev --ignore-time --parallel=10 ./output /www/moonwalks.be/ ;" \ No newline at end of file diff --git a/theme/static/css/header.css b/theme/static/css/header.css index b170a9f..5533656 100644 --- a/theme/static/css/header.css +++ b/theme/static/css/header.css @@ -31,8 +31,7 @@ nav.lang-menu ul{ line-height: var(--lh); /* theme 2 */ - /* background: var(--clr-soft); - color: var(--clr-text); */ + /* background: var(--clr-soft); */ } nav.lang-menu a{ color: rgba(255,255,255,0.5); @@ -71,6 +70,8 @@ nav.nav-menu{ border-bottom: var(--border); border-color: var(--clr-header); box-sizing: border-box; + + color: var(--clr-header); } ul.nav-menu__pages{ @@ -133,10 +134,6 @@ ul.nav-menu__pages li.active a{ nav.nav-menu li.active{ background: white; } -.night nav.nav-menu li.active{ - background: white; - color: var(--clr-back); -} /* order */ diff --git a/theme/static/css/main.css b/theme/static/css/main.css index aa3230e..23c546d 100644 --- a/theme/static/css/main.css +++ b/theme/static/css/main.css @@ -27,17 +27,19 @@ body{ line-height: var(--lh); /* slitghly brown forest light, low contrast */ - --clr-text: hsl(62, 6%, 24%); + --clr-text: hsl(62, 6%, 18%); --clr-soft-text: rgba(0,0,0,0.25); --clr-header: black; --clr-soft: hsl(54, 40%, 82%); - /* hsl(34, 44%, 69%) */ - --clr-back: hsl(82, 24%, 84%); + /* --clr-back: hsl(82, 24%, 84%); */ + --clr-back: hsl(92, 24%, 84%); /* a bit more solarized */ - --clr-soft: hsl(48, 46%, 82%); - --clr-back: hsl(72, 32%, 84%); + /* --clr-soft: hsl(48, 46%, 82%); */ + /* --clr-back: hsl(72, 32%, 84%); */ + + --clr-soft: hsl(48, 46%, 84%); background: var(--clr-back); color: var(--clr-text); @@ -55,8 +57,8 @@ body.night{ --clr-header: black; /* night -- grey purple */ - --clr-soft: hsl(290, 10%, 38%); - --clr-back: hsl(252, 30%, 16%); + /* --clr-soft: hsl(290, 10%, 38%); */ + --clr-back: hsl(252, 30%, 18%); } @@ -220,9 +222,9 @@ section.data-section::after{ .bio-box{ margin-top: calc(var(--lh) * 1); - display: grid; + /* display: grid; grid-template-columns: calc(var(--lh) * 4) 1fr; - gap: calc(var(--lh) * 0.5); + gap: calc(var(--lh) * 0.5); */ } /* svg */ @@ -266,7 +268,7 @@ dialog.footer{ border: var(--border); border-color: var(--clr-header); padding: var(--lh); - color: currentColor; + color: var(--clr-header); } dialog.footer .close-footer{ @@ -296,15 +298,12 @@ dialog.footer::backdrop{ background: black; opacity: 0.25; } -.night dialog.footer::backdrop{ - background: black; - opacity: 0.25; -} @media only screen and (max-width: 920px) { dialog.footer{ padding: var(--lh) calc(var(--lh) / 2); margin: auto calc(var(--lh) / 2); + max-width: none; } } diff --git a/theme/templates/index.html b/theme/templates/index.html index dd3aa2a..cb893fd 100644 --- a/theme/templates/index.html +++ b/theme/templates/index.html @@ -20,13 +20,13 @@
-
+ {#
{% include 'inline-svg/bouleau.svg' %} -
+
#} -
- {{ page.sections["bio"] }} -
+ {#
+
#} + {{ page.sections["bio"] }}