Commit 85989ffd authored by Roel Janssen's avatar Roel Janssen

Add a theme and its static resources.

* haunt.scm: Add page structure code
* images-ousrces/background.xcf: New file.
* images-ousrces/inria.xcf: New file.
* images-ousrces/mdc.xcf: New file.
* images-ousrces/umcutrecht.xcf: New file.
* static/css/main.css: New file.
* static/fonts/FiraMono-Regular.ttf: New file.
* static/fonts/OFL.txt: New file.
* static/fonts/Roboto-Bold.ttf: New file.
* static/fonts/Roboto-Light.ttf: New file.
* static/fonts/Roboto-LightItalic.ttf: New file.
* static/images/background.png: New file.
* static/images/favicon.png: New file.
* static/images/feed.png: New file.
* static/images/h-separator-darker.png: New file.
* static/images/inria.png: New file.
* static/images/logo.png: New file.
* static/images/mdc.png: New file.
* static/images/umcutrecht.png: New file.
parent 39a56287
......@@ -9,6 +9,7 @@
(use-modules (haunt site)
(haunt reader)
(haunt reader commonmark)
(haunt post)
(haunt page)
(haunt html)
(haunt utils)
......@@ -17,8 +18,105 @@
(haunt builder atom)
(ice-9 match)
(srfi srfi-1)
(srfi srfi-19)
(guix-hpc))
(define (base-url location)
(string-append "" location))
(define (image-url location)
(string-append "/static/images" location))
(define (css-url location)
(string-append "/static/css" location))
(define (post-url post site)
"Return the URL of POST, a Haunt blog post, for SITE."
(base-url (string-append "" (site-post-slug site post) ".html")))
(define (base-layout body)
`((doctype "html")
(html (@ (lang "en"))
(head
(meta (@ (http-equiv "Content-Type") (content "text/html; charset=utf-8")))
(link (@ (rel "icon")
(type "image/x-icon")
(href ,(image-url "/favicon.png"))))
(link (@ (rel "stylesheet")
(href ,(css-url "/main.css"))
(type "text/css")
(media "screen")))
(title "GuixHPC"))
(body
(div (@ (id "header"))
(div (@ (id "header-inner")
(class "width-control"))
(img (@ (class "logo")
(src ,(image-url "/logo.png"))))))
(div (@ (id "menubar")
(class "width-control"))
(ul
(li (a (@ (href "#")) "What"))
(li (a (@ (href "#")) "Who"))
(li (a (@ (href "#")) "Where"))
(li (a (@ (href ,(base-url "/news/feed.xml")))
(img (@ (alt "Atom feed")
(src ,(image-url "/feed.png"))))))))
(div (@ (id "content")
(class "width-control"))
(div (@ (id "content-inner"))
(article ,body)))
(div (@ (id "collaboration"))
(div (@ (id "collaboration-inner")
(class "width-control"))
(p "GuixHPC is a collaboration between:")
(div (@ (class "members"))
(ul
(li (img (@ (alt "MDC")
(src ,(image-url "/mdc.png")))))
(li (img (@ (alt "Inria")
(src ,(image-url "/inria.png")))))
(li (img (@ (alt "UMC Utrecht")
(src ,(image-url "/umcutrecht.png")))))))))
(div (@ (id "footer-box")
(class "width-control"))
(p "Made with " (span (@ (class "metta")) "♥") " by humans and "
"powered by " (a (@ (href "https://www.gnu.org/software/guile"))
"GNU Guile") "."))))))
(define* (post->sxml post #:key post-uri)
"Return the SXML for POST."
`(div (@ (class "post"))
(h2 (@ (class "title"))
,(if post-uri
`(a (@ (href ,post-uri))
,(post-ref post 'title))
(post-ref post 'title)))
(div (@ (class "post-about"))
,(post-ref post 'author)
" — " ,(date->string (post-date post) "~B ~e, ~Y"))
(hr)
(div (@ (class "post-body"))
,(post-sxml post))))
(define (page->sxml site title posts prefix)
"Return the SXML for the news page of SITE, containing POSTS."
`((div (@ (class "header"))
(div (@ (class "post-list"))
,@(map (lambda (post)
(post->sxml post #:post-uri (post-url post site)))
posts)))))
(define %hpc-haunt-theme
;; Theme for the rendering of the news pages.
(theme #:name "GuixHPC"
#:layout (lambda (site title body)
(base-layout body))
#:post-template post->sxml
#:collection-template page->sxml))
(define %local-test?
;; True when we're testing locally, as opposed to producing things to
;; install to gnu.org.
......@@ -27,8 +125,7 @@
(when %local-test?
;; The URLs produced in these pages are only meant for local consumption.
(format #t "~%Producing Web pages for local tests *only*!~%~%")
(current-url-root ""))
(format #t "~%Producing Web pages for local tests *only*!~%~%"))
(site #:title
"Guix HPC — Reproducible software deployment for high-performance computing"
......@@ -38,16 +135,14 @@
(email . "guix-devel@gnu.org"))
#:readers (list commonmark-reader)
#:builders
(cons* (blog ;; #:theme %news-haunt-theme
;; #:prefix "news"
)
(cons* (blog #:theme %hpc-haunt-theme)
;; Apparently the <link> tags of Atom entries must be absolute URLs,
;; hence this #:blog-prefix.
(atom-feed #:file-name "news/feed.xml"
#:blog-prefix "https://hpc.guixsd.org")
;; (static-directory "static")
(static-directory "static")
(map (lambda (page)
(lambda (site posts)
......
@font-face {
font-family: 'Roboto';
src: url('/static/fonts/Roboto-Light.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'Roboto-Italic';
src: url('/static/fonts/Roboto-LightItalic.ttf') format('truetype');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'Roboto-Bold';
src: url('/static/fonts/Roboto-Bold.ttf') format('truetype');
font-weight: normal;
font-style: bold;
}
@font-face {
font-family: 'FiraMono';
src: url('/static/fonts/FiraMono-Regular.ttf') format('truetype');
font-weight: normal;
font-style: bold;
}
/*#ffbf2d*/
body,html {
background-image: url('/static/images/background.png');
background-repeat: repeat-x;
background-color: #eeeeee;
width: 100%;
height: 100%;
line-height: 1.4em;
padding: 0pt;
margin: 0pt;
font-size: 11pt;
font-family: 'Roboto', sans-serif;
}
code {
font-family: 'FiraMono', monospace;
}
.width-control {
max-width: 1000px;
width: 90%;
}
#header {
background: #333333;
height: 90px;
width: 100%;
border-bottom: solid 3pt #666666;
}
#header .logo {
padding: 10px;
float: left;
}
#header .members {
float: right;
}
#menubar {
margin: auto;
padding: 0px;
clear: both;
}
#header-inner {
margin: auto;
padding: 0px;
}
#collaboration {
border-top: solid 3pt #aaaaaa;
border-bottom: solid 3pt #aaaaaa;
background: #bbbbbb;
width: 100%;
bottom: 0px;
}
#collaboration-inner { margin: auto auto 25px auto; }
#collaboration .members { text-align: center; }
#collaboration p { padding: 0px 10px 0px 10px; }
#collaboration .members ul { display: inline-block; padding: 0pt; margin: 0pt; }
#collaboration .members li { display: inline-block; padding: 0px 10px; 0px 0px; }
.post {
background: #eeeeee;
padding: 10px;
-webkit-border-radius: 4pt;
-moz-border-radius: 4pt;
border-radius: 4pt;
margin-bottom: 25px;
border: solid 2px #aaaaaa;
}
hr {
height: 3px;
background: url('/static/images/h-separator-darker.png');
background-repeat: no-repeat;
background-position: center;
width: 100%;
border: none;
}
.post h2 { padding: 0pt; margin: 0pt; }
#menubar ul { display: inline-block; padding: 0pt; margin: 0pt; }
#menubar li {
display: inline-block;
/* background: #dddddd; */
color: #000000;
height: 24pt;
line-height: 24pt;
list-style-type: none;
margin: 0pt;
margin: 0pt 10pt 0pt 0pt;
/* padding: 3pt 5pt 3pt 5pt; */
/* -webkit-border-radius: 0pt 0pt 4pt 4pt; */
/* -moz-border-radius: 0pt 0pt 4pt 4pt; */
/* border-radius: 0pt 0pt 4pt 4pt; */
text-transform: uppercase;
text-decoration: none;
font-size: small;
}
#menubar li img {
vertical-align: middle;
}
#menubar ul:first-child {
padding-left: 10px;
}
#content {
margin: auto;
padding: 0px;
}
#content-inner {
padding: 10px;
}
#footer-box {
width: 100%;
margin: auto;
text-align: center;
color: #333333;
}
h1 {
margin: 0pt;
padding: 0pt;
}
a { color: #000000; outline : none; }
a:visited { color: #000000; }
a img { outline : none; }
img { border: none; }
#footer-box a { color: #333333; }
#footer-box a:visited { color: #333333; }
Copyright (c) 2010, Matt McInerney (matt@pixelspread.com),
Copyright (c) 2011, Pablo Impallari (www.impallari.com|impallari@gmail.com),
Copyright (c) 2011, Rodrigo Fuenzalida (www.rfuenzalida.com|hello@rfuenzalida.com), with Reserved Font Name Raleway
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment