]> git.f4mnq.fr Git - site-web-pro.git/commitdiff
OCaml très basique pour le site
authorAmélia Coutard-Sander <git@f4mnq.fr>
Sun, 15 Feb 2026 01:01:18 +0000 (02:01 +0100)
committerAmélia Coutard-Sander <git@f4mnq.fr>
Sun, 15 Feb 2026 01:01:18 +0000 (02:01 +0100)
.gitignore [new file with mode: 0644]
.ocamlformat [new file with mode: 0644]
dune-project [new file with mode: 0644]
f4mnq/dune [new file with mode: 0644]
f4mnq/index.ml [moved from f4mnq/index.html with 60% similarity]
f4mnq/style.css [deleted file]
f4mnq/style.ml [new file with mode: 0644]
guix/site-web-pro.scm
mpring/dune [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..e35d885
--- /dev/null
@@ -0,0 +1 @@
+_build
diff --git a/.ocamlformat b/.ocamlformat
new file mode 100644 (file)
index 0000000..a7d9f56
--- /dev/null
@@ -0,0 +1,41 @@
+assignment-operator = end-line
+break-before-in = fit-or-vertical
+break-cases = fit-or-vertical
+break-collection-expressions = fit-or-vertical
+break-fun-decl = fit-or-vertical
+break-fun-sig = fit-or-vertical
+break-infix = fit-or-vertical
+break-separators = after
+break-string-literals = auto
+break-struct = force
+cases-exp-indent = 8
+cases-matching-exp-indent = normal
+doc-comments = before
+dock-collection-brackets
+exp-grouping = preserve
+extension-indent = 8
+field-space = tight-decl
+function-indent = 8
+function-indent-nested = auto
+if-then-else = keyword-first
+indent-after-in = 0
+indicate-nested-or-patterns = space
+infix-precedence = indent
+let-and = sparse
+let-binding-indent = 8
+let-binding-spacing = compact
+let-module = sparse
+line-endings = lf
+margin = 120
+match-indent = 0
+match-indent-nested = never
+module-item-spacing = sparse
+nested-match = wrap
+parens-tuple = always
+parens-tuple-patterns = multi-line-only
+sequence-style = terminator
+single-case = compact
+space-around-arrays=false
+space-around-lists=false
+space-around-records
+type-decl-indent = 8
diff --git a/dune-project b/dune-project
new file mode 100644 (file)
index 0000000..e77f33f
--- /dev/null
@@ -0,0 +1,20 @@
+(lang dune 3.19)
+
+(name site-web-pro)
+
+(generate_opam_files false)
+
+(source (uri https://git.f4mnq.fr/site-web-pro.git))
+
+(authors "Amélia COUTARD-SANDER <contact@f4mnq.fr>")
+
+(maintainers "Amélia COUTARD-SANDER <contact@f4mnq.fr>")
+
+(license AGPL-3.0-or-later)
+
+(package
+ (name site-web-pro)
+ (synopsis "Site web professionnel")
+ (description "Le site web professionnel d'Amélia COUTARD-SANDER, écrit en OCaml")
+ (depends ocaml)
+ (tags ("site web" "ocaml")))
diff --git a/f4mnq/dune b/f4mnq/dune
new file mode 100644 (file)
index 0000000..4d37451
--- /dev/null
@@ -0,0 +1,22 @@
+(executables
+ (public_names index style))
+
+(install
+ (files
+  (index.html as f4mnq/index.html)
+  (style.css as f4mnq/style.css)
+  (glob_files
+   (mpring/* with_prefix f4mnq/mpring)))
+ (section share))
+
+(rule
+ (action
+  (with-stdout-to
+   "index.html"
+   (run index))))
+
+(rule
+ (action
+  (with-stdout-to
+   "style.css"
+   (run style))))
similarity index 60%
rename from f4mnq/index.html
rename to f4mnq/index.ml
index 7b63a1584aec0c687a9bc3c69a9859b771791b69..f2dd5f0e5dabbde2a887ffc65497cffe692fee58 100644 (file)
@@ -1,4 +1,22 @@
-<!DOCTYPE html>
+(* f4mnq.fr
+ * Copyright 2026 Amélia COUTARD-SANDER <https://www.f4mnq.fr>.
+
+ * 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 website 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 website.  If not, see <https://www.gnu.org/licenses/>.
+ *)
+
+Printf.printf "%s"
+  {|<!DOCTYPE html>
 <html>
 <head>
        <meta charset="UTF-8" />
@@ -28,3 +46,4 @@ Son contenu est sous la licence CC BY-SA 4.0, ou une version ultérieure
 <iframe id="mpring" src="https://mpring.f4mnq.fr/ring.html" title="Webring amical" width=200px height=80px></iframe>
 </body>
 </html>
+|}
diff --git a/f4mnq/style.css b/f4mnq/style.css
deleted file mode 100644 (file)
index 47b678b..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-@media (prefers-color-scheme: light) {
-body {
-       background-color: #ffc;
-       color: #000;
-}
-a {
-       color: #099;
-}
-a:visited {
-       color: #c3c;
-}
-}
-@media (prefers-color-scheme: dark) {
-body {
-       background-color: #003;
-       color: #fff;
-}
-a {
-       color: #ff9;
-}
-a:visited {
-       color: #f99;
-}
-}
-
-#content {
-       min-height: calc(100vh - 200px);
-}
-
-#mpring {
-       margin-left: calc(50% - 100px);
-       border: 0;
-}
diff --git a/f4mnq/style.ml b/f4mnq/style.ml
new file mode 100644 (file)
index 0000000..2c79b04
--- /dev/null
@@ -0,0 +1,52 @@
+(* f4mnq.fr
+ * Copyright 2026 Amélia COUTARD-SANDER <https://www.f4mnq.fr>.
+
+ * 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 website 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 website.  If not, see <https://www.gnu.org/licenses/>.
+ *)
+
+Printf.printf "%s"
+  {|@media (prefers-color-scheme: light) {
+body {
+       background-color: #ffc;
+       color: #000;
+}
+a {
+       color: #099;
+}
+a:visited {
+       color: #c3c;
+}
+}
+@media (prefers-color-scheme: dark) {
+body {
+       background-color: #003;
+       color: #fff;
+}
+a {
+       color: #ff9;
+}
+a:visited {
+       color: #f99;
+}
+}
+
+#content {
+       min-height: calc(100vh - 200px);
+}
+
+#mpring {
+       margin-left: calc(50% - 100px);
+       border: 0;
+}
+|}
index 6374f3c7304a6ad1c734dad212fec48eb9ac4ad3..03f34a091a25c99286b7a4cf32d010029bde9f32 100644 (file)
@@ -14,7 +14,7 @@
 ; along with this website If not, see <https://www.gnu.org/licenses/>.
 
 (define-module (site-web-pro)
-       #:use-module (guix build-system copy)
+       #:use-module (guix build-system dune)
        #:use-module (guix gexp)
        #:use-module (guix git-download)
        #:use-module ((guix licenses) #:prefix license:)
        (name "site-web-pro")
        (version "1.0-git")
        (source (local-file (dirname (dirname (current-filename))) "site-web-pro-checkout" #:recursive? #t #:select? vcs-file?))
-       (build-system copy-build-system)
-       (arguments (list #:install-plan ''(
-               ("f4mnq/" "share/f4mnq")
-               ("mpring/" "share/mpring"))))
+       (build-system dune-build-system)
        (synopsis "Mon site web professionel")
-       (description "Mon site web professionel, statique.")
+       (description "Mon site web professionel, statique, écrit en OCaml.")
        (home-page "https://www.f4mnq.fr")
        (license (list license:agpl3+ license:cc-by-sa4.0))))
diff --git a/mpring/dune b/mpring/dune
new file mode 100644 (file)
index 0000000..964811d
--- /dev/null
@@ -0,0 +1,5 @@
+(install
+ (files
+  (glob_files
+   (*.{html,css,png} with_prefix mpring)))
+ (section share))