summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFélix Sipma <felix.sipma@no-log.org>2014-12-16 19:28:36 +0100
committerFélix Sipma <felix.sipma@no-log.org>2014-12-16 19:28:36 +0100
commitfe1aa3d58694412de6a8598c6d88a6d5f6f6e038 (patch)
tree66e2fdb4f766459d22f3052632cf7fbfeefe000f
parenta7944991ac38ba635ea4984aa2a18efa2c7990ba (diff)
add site
-rw-r--r--certs.markdown18
-rw-r--r--contacts.markdown9
-rw-r--r--css/gueux.css87
-rw-r--r--images/cacaprout-small.pngbin0 -> 2203 bytes
-rw-r--r--index.markdown12
-rw-r--r--site.hs79
-rw-r--r--templates/cert-list.html8
-rw-r--r--templates/certs.html3
-rw-r--r--templates/default.html35
9 files changed, 251 insertions, 0 deletions
diff --git a/certs.markdown b/certs.markdown
new file mode 100644
index 0000000..2c45721
--- /dev/null
+++ b/certs.markdown
@@ -0,0 +1,18 @@
+**Les certificats sont signés par [CAcert.org](http://www.cacert.org).**
+
+**Si votre navigateur affiche une erreur du style "Certificat invalide" quand
+vous vous connectez à un site web hébergé par gueux.org, essayez d'importer
+[les certificats racines de CAcert.org](http://www.cacert.org/index.php?id=3).**
+
+**Procédure:**
+
+- Aller sur
+[la page web contenant les certificats racines de CAcert.org](http://www.cacert.org/index.php?id=3)
+- Importer les certificats "Class 1 PKI Key" et "Class 3 PKI Key" en cliquant
+sur les liens correspondant à votre navigateur (en règle générale les liens
+[Root Certificate (PEM Format)](http://www.cacert.org/certs/root.crt) et
+[Intermediate Certificate (PEM Format)](http://www.cacert.org/certs/class3.crt))
+et accepter l'importation dans le navigateur en prenant soin de vérifier les
+signatures SHA512.
+
+**Liste des certificats Gueux.org:**
diff --git a/contacts.markdown b/contacts.markdown
new file mode 100644
index 0000000..4383f6d
--- /dev/null
+++ b/contacts.markdown
@@ -0,0 +1,9 @@
+---
+title: Contact
+---
+
+Pour t'inscrire sur Gueux.org, Cacaproutmail et cie. contacte l'admin:
+[admin_at_gueux.org](mailto:admin_at_gueux.org).
+
+Pour t'inscrire sur une liste de diffusion Gueux, va sur
+[lists.gueux.org](http://lists.gueux.org)
diff --git a/css/gueux.css b/css/gueux.css
new file mode 100644
index 0000000..6d6e8b2
--- /dev/null
+++ b/css/gueux.css
@@ -0,0 +1,87 @@
+.w3c-valid {
+ border: 0;
+ width: 88px;
+ height: 31px;
+}
+
+.logo {
+ border: 0;
+}
+
+a {
+ text-decoration: none;
+}
+a:hover {
+ text-decoration: underline;
+}
+
+p.indent {margin-left:40px}
+
+ul {
+ list-style: square;
+}
+
+ul#menu li.active {
+ font-weight: bold;
+}
+
+body {
+ font-family: inconsolata, courier, monospace, sans-serif;
+ line-height: 140%;
+ font-size: 90%;
+}
+
+#banner {
+ border: 0;
+ height: 100px;
+ width: 100%;
+}
+
+#banner .logobox {
+ margin-top: 10px;
+ margin-left: 40px;
+ width: 15%;
+ float: left;
+ text-align: left;
+}
+
+#banner .title {
+ position: relative;
+ width: 80%;
+ top: 30px;
+ float: right;
+ text-align: left;
+}
+
+#main{
+ width: 100%;
+}
+
+#main .menu {
+ width: 15%;
+ float: left;
+}
+
+#main .content {
+ width: 80%;
+ float: right;
+}
+
+
+#footer {
+ height: 100px;
+ top: 30px;
+ width: 100%;
+}
+
+#footer .left {
+ width: 20%;
+ float: left;
+ text-align: left;
+}
+
+#footer .right {
+ width: 60%;
+ float: right;
+ text-align: right;
+}
diff --git a/images/cacaprout-small.png b/images/cacaprout-small.png
new file mode 100644
index 0000000..cc8c687
--- /dev/null
+++ b/images/cacaprout-small.png
Binary files differ
diff --git a/index.markdown b/index.markdown
new file mode 100644
index 0000000..51e673f
--- /dev/null
+++ b/index.markdown
@@ -0,0 +1,12 @@
+---
+title: Accueil
+---
+
+**Gueux.org, une organisation de gueux!**
+
+![cacaprout](/images/cacaprout-small.png)\
+
+Gueux.org héberge actuellement:
+
+- [Lucane magazine!](http://lucane.gueux.org)
+- [Le site de l'association "L'Inventif Atelier"!](http://linventifatelier.gueux.org)
diff --git a/site.hs b/site.hs
new file mode 100644
index 0000000..9647e23
--- /dev/null
+++ b/site.hs
@@ -0,0 +1,79 @@
+--------------------------------------------------------------------------------
+{-# LANGUAGE OverloadedStrings #-}
+import Data.Monoid (mappend, mconcat)
+import Hakyll
+import qualified Crypto.Hash.SHA512 as SHA512
+import qualified Crypto.Hash.MD5 as MD5
+import qualified Data.ByteString as Strict
+import qualified Data.ByteString.Lazy as Lazy
+import Text.Printf (printf)
+
+
+--------------------------------------------------------------------------------
+main :: IO ()
+main = hakyll $ do
+ match "images/*" $ do
+ route idRoute
+ compile copyFileCompiler
+
+ match "css/*" $ do
+ route idRoute
+ compile compressCssCompiler
+
+ match (fromList ["contacts.markdown"]) $ do
+ route $ setExtension "html"
+ compile $ pandocCompiler
+ >>= loadAndApplyTemplate "templates/default.html" defaultContext
+ >>= relativizeUrls
+
+ match "certs/*" $ do
+ route idRoute
+ compile copyFileCompiler
+
+ match "certs.markdown" $ do
+ route $ setExtension "html"
+ compile $ do
+ certs <- loadAll "certs/*.pem"
+ let certsCtx =
+ listField "certs" certCtx (return certs) `mappend`
+ constField "title" "Certificats" `mappend`
+ defaultContext
+
+ pandocCompiler
+ >>= loadAndApplyTemplate "templates/certs.html" certsCtx
+ >>= loadAndApplyTemplate "templates/default.html" certsCtx
+ >>= relativizeUrls
+
+ match "index.markdown" $ do
+ route $ setExtension "html"
+ compile $ do
+ let indexCtx =
+ constField "title" "Accueil" `mappend`
+ defaultContext
+
+ pandocCompiler
+ >>= loadAndApplyTemplate "templates/default.html" indexCtx
+ >>= relativizeUrls
+
+ match "templates/*" $ compile templateCompiler
+
+
+--------------------------------------------------------------------------------
+postCtx :: Context String
+postCtx =
+ dateField "date" "%B %e, %Y" `mappend`
+ defaultContext
+
+certCtx :: Context CopyFile
+certCtx = mconcat
+ [ urlField "url"
+ , titleField "title"
+ , field "sha512" $ \(item) -> do
+ sha512 <- unsafeCompiler $ fmap SHA512.hashlazy $ Lazy.readFile (filepath $ itemBody item)
+ return $ toHex sha512
+ ]
+ where
+ filepath (CopyFile f) = f
+
+toHex :: Strict.ByteString -> String
+toHex bytes = Strict.unpack bytes >>= printf "%02x"
diff --git a/templates/cert-list.html b/templates/cert-list.html
new file mode 100644
index 0000000..911f060
--- /dev/null
+++ b/templates/cert-list.html
@@ -0,0 +1,8 @@
+<ul>
+ $for(certs)$
+ <li>
+ <p><a href="$url$">Certificat: $title$</a></p>
+ <p>SHA512: $sha512$</p>
+ </li>
+ $endfor$
+</ul>
diff --git a/templates/certs.html b/templates/certs.html
new file mode 100644
index 0000000..7c7ff43
--- /dev/null
+++ b/templates/certs.html
@@ -0,0 +1,3 @@
+$body$
+
+$partial("templates/cert-list.html")$
diff --git a/templates/default.html b/templates/default.html
new file mode 100644
index 0000000..8c26e8e
--- /dev/null
+++ b/templates/default.html
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>Gueux.org - $title$</title>
+ <link rel="stylesheet" type="text/css" href="/css/gueux.css" />
+ </head>
+ <body>
+ <div id="header">
+ <div id="logo">
+ <a href="/">Gueux.org</a>
+ </div>
+ <div id="navigation">
+ <a href="/">Accueil</a>
+ <a href="https://webmail.gueux.org">CacaproutMail</a>
+ <a href="https://lists.gueux.org">Listes de diffusion</a>
+ <a href="https://gitweb.gueux.org">Gitweb</a>
+ <a href="contacts.html">Contacts</a>
+ <a href="certs.html">Certificats</a>
+ </div>
+ </div>
+
+ <div id="content">
+ <h1>Gueux.org - $title$</h1>
+
+ $body$
+ </div>
+ <div id="footer">
+ “<i>J'ai pété.</i>” — Un gueux.
+ </div>
+ </body>
+</html>
+<!-- &copy; Copyright 2009 by <a href="http://gueux.org/">Félix Sipma</a>. -->