From aacaeab2faf08b1fe7b5aa92c6ce29ad0bf834de Mon Sep 17 00:00:00 2001
From: =?utf8?q?Am=C3=A9lia=20P=2E=20H=2E=20Coutard?= <amy@ameliathe1st.gay>
Date: Sun, 16 Jun 2024 02:07:48 +0200
Subject: [PATCH] =?utf8?q?Ajout=20de=20la=20structure=20n=C3=A9cessaire=20?=
 =?utf8?q?pour=20lilypond=20+=20mon=20arrangement=20de=20Ma'oz=20Tzur.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit

---
 docs/Ma'oz Tzur.ly | 56 ++++++++++++++++++++++++++++++++++++++++++++++
 lilypond-unix.sh   |  5 +++++
 main.hs            | 12 ++++++----
 3 files changed, 69 insertions(+), 4 deletions(-)
 create mode 100644 docs/Ma'oz Tzur.ly
 create mode 100755 lilypond-unix.sh

diff --git a/docs/Ma'oz Tzur.ly b/docs/Ma'oz Tzur.ly
new file mode 100644
index 0000000..d5ac0fb
--- /dev/null
+++ b/docs/Ma'oz Tzur.ly	
@@ -0,0 +1,56 @@
+---
+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.
+---
+\version "2.24.1"
+\header {
+  title = "Ma'oz Tzur"
+  arranger = "Amélia Coutard - https://www.ameliathe1st.gay"
+  instrument = "Accordéon"
+  copyright = "Domaine Public"
+}
+
+\markup \vspace #4
+
+<<
+	\new ChordNames { \chordmode {
+		c2. f4 c4 g4 c4. c4. d2.:m g2 c2
+		c2. f4 c4 g4 c4. c4. d2.:m g2 c2
+
+		c2 f1 c2 c2 f2 a2:maj7 d2:m
+		c1 d1:m c2 f2 g2 c2
+		c1 d1:m c2 f2 g2 c2
+	} }
+	\new Staff { \relative {
+		\override VerticalAxisGroup.nonstaff-relatedstaff-spacing.padding = #100
+		\clef treble
+		\time 4/4
+		c''4 g c f e d c4. g'8 g4 a d, e8 f e4 d c2 \break
+		c4 g c f e d c4. g'8 g4 a d, e8 f e4 d c2 \break
+
+		g4. g8 a4 b4 c2 g2 c4 b4 a4 g4 g8 f8 e8 f8 d2 \break
+		e4. f8 g4 g4 d4. e8 f2 e4 c4 a'4 g8 f8 e4 f4 g2 \break
+		e4. f8 g4 g4 d4. e8 f2 e4 c4 a'4 g8 f8 e4 d4 c2 \break
+	} }
+	\addlyrics {
+		Ma' -- oz Tzur Ye -- shu' -- a -- ti, le -- kha na' -- eh le -- sha -- be' -- _ ah.
+		Ti -- kon beit te -- fi -- la -- ti, ve -- sham to -- da ne -- za -- be' -- _ ah.
+
+		Le'et ta -- khin mat -- be' -- ah mi -- tzar ha -- mna -- be' -- _ _ _ ah.
+		Az eg -- mor be -- shir mi -- zmor ha -- nu -- kat ha -- mi -- zbe' -- _ ah.
+		Az eg -- mor be -- shir mi -- zmor ha -- nu -- kat ha -- mi -- zbe' -- _ ah.
+	}
+>>
+
+\paper {
+	system-system-spacing =
+		#'((basic-distance . 16)
+		   (minimum-distance . 8)
+		   (padding . 1)
+		   (stretchability . 60))
+}
+\layout {
+	indent = 0.0
+}
diff --git a/lilypond-unix.sh b/lilypond-unix.sh
new file mode 100755
index 0000000..2a2c609
--- /dev/null
+++ b/lilypond-unix.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+F=$(mktemp 'tmp.XXXXXXXXXX')
+lilypond -o "$F" -
+cat "$F".pdf
+rm "$F" "$F".pdf
diff --git a/main.hs b/main.hs
index 9334772..9d7bc8e 100644
--- a/main.hs
+++ b/main.hs
@@ -12,10 +12,10 @@
 -- 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
 
 main :: IO ()
 main = hakyll $ do
@@ -26,9 +26,13 @@ main = hakyll $ do
 		route $ gsubRoute "html/" (const "")
 		compile copyFileCompiler
 
-	match ("docs/*" .&&. complement "**.metadata") $ do
+	match ( "docs/*.pdf" .||. "docs/*.sfd" .||. "docs/*.otf" ) $ do
 		route idRoute
-		compile copyFileCompiler
+		compile getResourceLBS
+
+	match "docs/*.ly" $ do
+		route $ setExtension "pdf"
+		compile $ getResourceBody >>= withItemBody (unixFilterLBS "./lilypond-unix.sh" [] . fromString)
 
 	match "html/atom.xml" $ do
 		route $ gsubRoute "html/" (const "")
@@ -49,5 +53,5 @@ main = hakyll $ do
 				>>= applyAsTemplate docsContext
 				>>= relativizeUrls
 
-docContext :: Context CopyFile
+docContext :: Context ByteString
 docContext = urlField "url" <> dateField "datetime" "%FT%TZ" <> metadataField
-- 
2.46.0