]> git.ameliathe1st.gay Git - site-web.git/commitdiff
Au final, changeons complètement: vive bash !
authorAmélia Coutard-Sander <git@ameliathe1st.gay>
Sat, 21 Jun 2025 01:57:48 +0000 (03:57 +0200)
committerAmélia Coutard-Sander <git@ameliathe1st.gay>
Sat, 21 Jun 2025 01:57:48 +0000 (03:57 +0200)
19 files changed:
.gitignore
Makefile [new file with mode: 0644]
docs/AmyMono-Regular-FontForge.sfd.metadata [deleted file]
docs/AmyMono-Regular.otf.metadata [deleted file]
docs/Little Nightmares II - Étude For A Minor.pdf.metadata [deleted file]
docs/Little-Nightmares-II-Étude-For-A-Minor.pdf [moved from docs/Little Nightmares II - Étude For A Minor.pdf with 100% similarity]
docs/Ma'oz Tzur.ly.metadata [deleted file]
docs/Ma-oz-Tzur.ly [moved from docs/Ma'oz Tzur.ly with 100% similarity]
docs/MoringMark - Triangle Glyph.pdf [deleted file]
docs/MoringMark - Triangle Glyph.pdf.metadata [deleted file]
docs/The Owl House - Outro Theme.pdf.metadata [deleted file]
docs/The-Owl-House-Outro-Theme.pdf [moved from docs/The Owl House - Outro Theme.pdf with 100% similarity]
docs/meta.rec [new file with mode: 0644]
esh.sh [new file with mode: 0755]
html/atom.xml [deleted file]
html/atom.xml.esh [new file with mode: 0644]
html/index.html.esh [moved from html/index.html with 94% similarity]
html/style.css.esh [moved from html/style.css with 100% similarity]
main.hs [deleted file]

index 8a8c3a3f9cf0fbfce222146cbb31c2e9f0fd6fae..1fcb1529f8e5e43037c4710ce09da0becd28823a 100644 (file)
@@ -1,6 +1 @@
-# Haskell:
 out
-# Hakyll:
-_cache
-_site
-/*.pdf
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..57f6ec4
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,20 @@
+.PHONY: build clean
+
+HTML=$(patsubst html/%.esh,out/%,$(shell find html -name '*.esh'))
+DOCS=$(patsubst %,out/docs/%,$(shell recsel -P file docs/meta.rec))
+
+build: $(HTML) $(DOCS)
+clean:
+       rm -rf out
+
+out/docs/%: docs/%
+       mkdir -p "$(@D)"
+       cp "$<" "$@"
+out/docs/%.pdf: docs/%.ly
+       mkdir -p "$(@D)"
+       lilypond -o "$(@D)" "$<"
+
+out/%: html/%.esh
+       mkdir -p "$(@D)"
+       sh esh.sh < "$<" > "$@"
+
diff --git a/docs/AmyMono-Regular-FontForge.sfd.metadata b/docs/AmyMono-Regular-FontForge.sfd.metadata
deleted file mode 100644 (file)
index 19c7a12..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-title: AmyMono Regular (Source FontForge)
-tags: police
-date: 2023-11-20
-description: La source (pour le logiciel fontforge) de la police de caractères monospace que j'ai faite.
diff --git a/docs/AmyMono-Regular.otf.metadata b/docs/AmyMono-Regular.otf.metadata
deleted file mode 100644 (file)
index c452d0d..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-title: AmyMono Regular (Fichier OTF)
-tags: police
-date: 2023-11-20
-description: La police de caractères monospace que j'ai faite.
diff --git a/docs/Little Nightmares II - Étude For A Minor.pdf.metadata b/docs/Little Nightmares II - Étude For A Minor.pdf.metadata
deleted file mode 100644 (file)
index 3b8c594..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-title: Little Nightmares II - Étude For A Minor
-tags: musique, partition, Little Nightmares
-date: 2023-07-21
-description: Un arrangement pour piano de la musique "Étude For A Minor", de la bande originale de Little Nightmares II.
diff --git a/docs/Ma'oz Tzur.ly.metadata b/docs/Ma'oz Tzur.ly.metadata
deleted file mode 100644 (file)
index a028037..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-title: Ma'oz Tzur
-tags: musique, partition, Judaïsme
-date: 2024-06-16
-description: Une partition pour accordéon de mon arrangement de Ma'oz Tzur.
similarity index 100%
rename from docs/Ma'oz Tzur.ly
rename to docs/Ma-oz-Tzur.ly
diff --git a/docs/MoringMark - Triangle Glyph.pdf b/docs/MoringMark - Triangle Glyph.pdf
deleted file mode 100644 (file)
index 2fbb3b3..0000000
Binary files a/docs/MoringMark - Triangle Glyph.pdf and /dev/null differ
diff --git a/docs/MoringMark - Triangle Glyph.pdf.metadata b/docs/MoringMark - Triangle Glyph.pdf.metadata
deleted file mode 100644 (file)
index 63bcd4d..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-title: MoringMark - Triangle Glyph
-tags: storyboard, The Owl House
-date: 2022-01-10
-description: Un storyboard que j'ai fait pour mon adaptation en stop-motion d'un comic de MoringMark.
diff --git a/docs/The Owl House - Outro Theme.pdf.metadata b/docs/The Owl House - Outro Theme.pdf.metadata
deleted file mode 100644 (file)
index dbfa47f..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-title: The Owl House - Outro Theme
-tags: musique, partition, The Owl House
-date: 2023-06-14
-description: Un arrangement pour piano de la musique de générique de fin d'épisode de The Owl House.
diff --git a/docs/meta.rec b/docs/meta.rec
new file mode 100644 (file)
index 0000000..4cb9920
--- /dev/null
@@ -0,0 +1,22 @@
+%rec: Doc
+%mandatory: file title date
+
+file: AmyMono-Regular-FontForge.sfd
+title: AmyMono Regular (Source FontForge)
+date: 2023-11-20
+
+file: AmyMono-Regular.otf
+title: AmyMono Regular (Fichier OTF)
+date: 2023-11-20
+
+file: Little-Nightmares-II-Étude-For-A-Minor.pdf
+title: Little Nightmares II - Étude For A Minor
+date: 2023-07-21
+
+file: Ma-oz-Tzur.pdf
+title: Ma'oz Tzur
+date: 2024-06-16
+
+file: The-Owl-House-Outro-Theme.pdf
+title: The Owl House - Outro Theme
+date: 2023-06-14
diff --git a/esh.sh b/esh.sh
new file mode 100755 (executable)
index 0000000..81922a2
--- /dev/null
+++ b/esh.sh
@@ -0,0 +1,6 @@
+while read -r line; do
+       case "$line" in
+       "#"*) echo "$(echo "$line" | sed "s/#//")";;
+       *) echo "echo '$(echo "$line" | sed "s/'/''/g")'";;
+       esac
+done | sh
diff --git a/html/atom.xml b/html/atom.xml
deleted file mode 100644 (file)
index 6f5e960..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<feed xmlns="http://www.w3.org/2005/Atom">
-
-       <id>https://ameliathe1st.gay/</id>
-       <title>AméliaThe1st</title>
-       <link rel="self" href="https://ameliathe1st.gay/atom.xml"/>
-       <updated>$datetime$</updated>
-       <author>
-               <name>Amélia Coutard</name>
-               <email>contact@ameliathe1st.gay</email>
-               <uri>https://ameliathe1st.gay</uri>
-       </author>
-
-       $for(docs)$
-       <entry>
-               <title>$title$</title>
-               <link rel="alternate" href="https://ameliathe1st.gay$url$"/>
-               <id>https://ameliathe1st.gay$url$</id>
-               <updated>$datetime$</updated>
-               <summary>$description$</summary>
-       </entry>
-       $endfor$
-
-</feed>
diff --git a/html/atom.xml.esh b/html/atom.xml.esh
new file mode 100644 (file)
index 0000000..72afa50
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+
+       <id>https://ameliathe1st.gay/</id>
+       <title>AméliaThe1st</title>
+       <link rel="self" href="https://ameliathe1st.gay/atom.xml"/>
+       # echo "<updated>$(recsel -P date docs/meta.rec -S date | tail -n 1)T00:00:00Z</updated>"
+       <author>
+               <name>Amélia Coutard</name>
+               <email>contact@ameliathe1st.gay</email>
+               <uri>https://ameliathe1st.gay</uri>
+       </author>
+
+       # recsel -P file docs/meta.rec -C -S date | tail -n 10 | while read -r file; do
+       <entry>
+               # echo "<title>$(recsel -e "file = \"$file\"" -P title docs/meta.rec)</title>"
+               # echo "<link rel=\"alternate\" href=\"https://ameliathe1st.gay/docs/$(printf '%s' "$file" | jq -Rr @uri)\"/>"
+               # echo "<id>https://ameliathe1st.gay/docs/$(printf '%s' "$file" | jq -Rr @uri)</id>"
+               # echo "<updated>$(recsel -e "file = \"$file\"" -P date docs/meta.rec)T00:00:00Z</updated>"
+       </entry>
+       # done
+
+</feed>
similarity index 94%
rename from html/index.html
rename to html/index.html.esh
index 1214549521afbae105431ff8268a8aa85e3760d4..0ec13cde67e42bb662ffe2cf303164d43288d2fe 100644 (file)
@@ -9,9 +9,9 @@
 <body>
        <h3> Mes dernières publications: </h3>
        <ul>
-               $for(docs)$
-               <li> <a href="$url$">$title$</a> ($tags$) </li>
-               $endfor$
+               # recsel -P file docs/meta.rec -C | while read -r file; do
+               # echo "<li> <a href=\"/docs/$file\">$(recsel -e "file = \"$file\"" -P title docs/meta.rec)</a> </li>"
+               # done
        </ul>
        <h3> Des liens: </h3>
        <ul>
similarity index 100%
rename from html/style.css
rename to html/style.css.esh
diff --git a/main.hs b/main.hs
deleted file mode 100644 (file)
index db04329..0000000
--- a/main.hs
+++ /dev/null
@@ -1,67 +0,0 @@
--- Copyright 2023 Amélia COUTARD.
---
--- This file from this website is free software: you can redistribute it
--- and/or modify it under the terms of the GNU Affero General Public License as published by the Free
--- Software Foundation, either version 3 of the License, or (at your option) any later version.
---
--- This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even
--- the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General
--- Public License for more details.
---
--- You should have received a copy of the GNU Affero General Public License along with this program. If
--- not, see <https://www.gnu.org/licenses/>.
-
-{-# LANGUAGE OverloadedStrings #-}
-import Data.ByteString.Lazy.UTF8 (ByteString, fromString)
-import Data.Monoid ((<>))
-import Data.Time.Format (formatTime, defaultTimeLocale)
-import Hakyll
-import Hakyll.Process
-
-mapHead :: (a -> a) -> [a] -> [a]
-mapHead _ [] = []
-mapHead f (h:t) = f h:t
-
-split :: Eq a => a -> [a] -> [[a]]
-split _ [] = [[]]
-split v (h:t) | v == h = []:split v t
-split v (h:t) = mapHead (h:) (split v t)
-
-main :: IO ()
-main = hakyll $ do
-       match "COPYING-*" $ do
-               route idRoute
-               compile copyFileCompiler
-       match "html/style.css" $ do
-               route $ gsubRoute "html/" (const "")
-               compile copyFileCompiler
-
-       match ( "docs/*.pdf" .||. "docs/*.sfd" .||. "docs/*.otf" ) $ do
-               route idRoute
-               compile getResourceLBS
-
-       match "docs/*.ly" $ do
-               route $ setExtension "pdf"
-               compile $ execCompilerWith (execName "lilypond") [HakFilePath] (COutFile (RelativePath (newExtension "pdf" . last . split '/')))
-
-       match "html/atom.xml" $ do
-               route $ gsubRoute "html/" (const "")
-               compile $ do
-                       docs <- fmap (take 10) . recentFirst =<< loadAll ("docs/*" .&&. complement "**.metadata")
-                       let docsContext = listField "docs" docContext (return docs)
-                               <> field "datetime" (const $ fmap (formatTime defaultTimeLocale "%FT%T%QZ") $ getItemUTC defaultTimeLocale $ itemIdentifier $ head docs)
-                               <> defaultContext
-                       getResourceBody
-                               >>= applyAsTemplate docsContext
-
-       match "html/index.html" $ do
-               route $ gsubRoute "html/" (const "")
-               compile $ do
-                       docs <- recentFirst =<< loadAll ("docs/*" .&&. complement "**.metadata")
-                       let docsContext = listField "docs" docContext (return docs) <> defaultContext
-                       getResourceBody
-                               >>= applyAsTemplate docsContext
-                               >>= relativizeUrls
-
-docContext :: Context ByteString
-docContext = urlField "url" <> dateField "datetime" "%FT%TZ" <> metadataField