Unverified Commit 820c86ab authored by Philip Kaludercic's avatar Philip Kaludercic 🌝
Browse files

initial commit

parents
update.sh
site
\ No newline at end of file
faui2k17 generator repo
=======================
(use-modules (haunt post)
(haunt page)
(haunt site)
(haunt asset)
(haunt html)
(haunt builder blog)
(haunt builder atom)
(haunt builder assets)
(haunt reader commonmark)
(local micronews paged-blog)
(local theme)
(local common))
(define* (static-page name title sxml #:key (theme local-site-theme))
(lambda (site posts)
(list
(make-page (string-append name ".html")
((theme-layout theme) site title sxml)
sxml->html))))
(define %meta-page (primitive-load "pages/meta.sxml"))
(define %irc-page (primitive-load "pages/irc.sxml"))
(define %whatsapp-page (primitive-load "pages/whatsapp.sxml"))
(site #:title "#faui2k17"
#:domain "faui2k17.de"
#:readers (list commonmark-reader)
#:builders (list (paged-blog #:theme local-site-theme
#:prefix "post")
(atom-feed)
(atom-feeds-by-tag)
(static-page "meta" "Meta"
%meta-page)
(static-page "irc" "IRC"
%irc-page)
(static-page "whatsapp" "WhatsApp Links"
%whatsapp-page)
(static-directory "static" "static")))
(define-module (local common)
#:export (link ulist)
#:replace (link))
(define (ulist . items)
`(ul ,(map (lambda (item) (list 'li item))
items)))
(define (link name uri)
`(a (@ (href ,uri)) ,name))
(define-module (local micronews paged-blog)
#:use-module (srfi srfi-1)
#:use-module (ice-9 receive)
#:use-module (haunt builder blog)
#:use-module (haunt page)
#:use-module (haunt site)
#:use-module (haunt post)
#:use-module (haunt html)
#:export (paged-blog))
(define* (paged-blog #:key theme prefix (per-page 3))
"Return a builder that creates a blog with PER-PAGE posts per page
listing.
See (haunt builder blog)'s blog for more details."
(define (shorter-than lst n)
(cond ((null? lst) (positive? n))
((zero? n) (null? lst))
(else (shorter-than (cdr lst) (1- n)))))
(define (group-by lst n)
(if (shorter-than lst n)
(list lst)
(receive (head rest) (split-at lst n)
(cons head (group-by rest n)))))
(lambda (site posts)
(let* ((sorted (posts/reverse-chronological posts))
(grouped (group-by posts per-page))
(last-group-nr (length grouped)))
(define (create-index-page group i)
(let ((title (format #f "faui2k17 - Page ~d" i)))
(make-page
;; file name
(if (= i 1)
"index.html"
(format #f "page-~d.html" i))
;; content
((theme-layout theme) site title
((theme-collection-template theme)
site title group prefix i (= i last-group-nr)))
;; function
sxml->html)))
(append
;; index pages
(map create-index-page grouped (map 1+ (iota (length grouped))))
;; blog pages
((blog #:theme theme #:prefix prefix
#:collections '())
site posts)))))
(add-to-load-path "..")
(define-module (local theme)
#:use-module (ice-9 format)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-19)
#:use-module (haunt builder blog)
#:use-module (haunt post)
#:use-module (haunt site)
#:use-module (local common)
#:export (local-site-theme))
(define (intersperse lst x)
(append (apply append (map (lambda (item) (list item x))
(drop-right lst 1)))
(last-pair lst)))
(intersperse '(1 2 3 4 5 6) -1)
(define* (make-post-generator #:key site prefix)
(lambda (post)
`(article
,(post-sxml post)
(nav (time ,(date->string (post-date post)
"Beigetragen am ~d ~h. ~Y"))
(span "Tags: "
,(intersperse
(map (lambda (tag)
(link tag (format #f "/feeds/tags/~a.xml" tag)))
(or (post-ref post 'tags) '()))
", "))
,@(if (and site prefix)
`(" "
,(link "Permalink"
(format #f "/~a/~a.html"
prefix (site-post-slug site post))))
'(""))))))
(define local-site-theme
(theme
#:name "local"
#:layout
(lambda (site title body)
`((doctype "html")
(head
(meta (@ (charset "utf-8")))
(meta (@ (name "referrer") (content "none")))
(meta (@ (name "viewport") (content "width=device-width")))
(title ,title)
(link (@ (rel "stylesheet") (href "/static/style.css"))))
(body
(header
(nav ,@(list (link '(code "#faui2k17") "/")
(link "IRC" "/irc.html")
(link "WhatsApp" "/whatsapp.html")
(link "Beitragen" "/meta.html")
(link "Atom Feed" "/feed.xml"))))
,body)))
#:post-template (make-post-generator)
#:collection-template
(lambda (site title posts prefix number last?)
(list
(map (make-post-generator #:site site
#:prefix prefix)
posts)
`(footer
,(let ((prev (link "←" (format #f "/page-~d.html" (1- number))))
(next (link "→" (format #f "/page-~d.html" (1+ number))))
(name (format #f "Page ~d" number)))
(cond ((and last? (= number 1))
(list name))
(last?
(list prev " " name))
((= number 1)
(list name " " prev))
(else
(list prev " " name " " next)))))))))
`(article
(p "IRC Channel des Jahrgangs: "
,(link '(code "#faui2k17") "irc://irc.fau.de:6667/faui2k17"))
(p "Für die die noch nie IRC verwendet haben, kann einem der "
,(link '(em "IRC-Guide") "https://fsi.cs.fau.de/dw/kontakt/irc")
" von der FSI helfen die Basics zu verstehen.")
(p "Auch möglich: Verbinden via "
,(link "Matrix" "https://matrix.to/#/#_ircnet_#faui2k17:irc.snt.utwente.nl")))
`(article
(p "Auf dieser Seite sind Kurznachrichten und andere "
"Informationen (hauptsächlich) für Studenten der "
,(link "FAU Erlangen" "https://www.fau.de/")
" im Studiengang "
,(link "Informatik" "https://www.cs.fau.de/")
".")
(p "Alle Inhalte werden von einem statischem Webseiten "
"Generator verwaltet, und jeder ist eingeladen mit "
"beizutragen. Besucht hierzu das FAU GitLab Repo "
,(link '(code "faui2k17/posts") "https://gitlab.cs.fau.de/faui2k17/posts")
", auf welches mit SSO (IdM-Kennung) zugegriffen "
"werden kann.")
(p "Fragen/Vorschläge technischer oder rechtlicher Art bitte an "
"den derzeitigen "
,(link "Webmaster" "https://wwwcip.informatik.uni-erlangen.de/~oj14ozun/")
" schicken."))
`(article
(p "Diese Seite enthält direkte "
,(link '(em "Invite Links")
"https://faq.whatsapp.com/en/wp/23704967?lang=de#invite")
" zu WhatsApp Gruppen welche vom Semester 2017/18 erstellt wurden.")
(h1 "Allgemeine Gruppen")
,(ulist
(link '(em "Erstis Gruppe")
"https://chat.whatsapp.com/Le3bBFeddlM3UD6XUduudm"))
(h1 "Vorlesungen aus dem 4. Semester")
,(ulist
(link "Rechnerkommunikation"
"https://chat.whatsapp.com/KkIfQkNspYsDGc1e2D5xaM")
(link "Theorie der Programmierung"
"https://chat.whatsapp.com/F9oXhsXeaLwJjSYkuIYqbO")
(link "Algorithmik Kontinuierlicher Systeme"
"https://chat.whatsapp.com/KqvTD8lXAuA0qnLHx208bK")
(link "Mathe C4"
"https://chat.whatsapp.com/4eofzccqOfd51ky7Q0bgD1"))
(h1 "Vorlesungen aus dem 3. Semester")
,(ulist
(link "Berechenbarkeit formeller Systeme"
"https://chat.whatsapp.com/7cTwkQ8dVqF4RSl8QMq0ru")
(link "Software Entwickelung"
"https://chat.whatsapp.com/ATOD2sUNAWP2CoukTlo4J2")
(link "Grundlagen der Logik in der Informatik"
"https://chat.whatsapp.com/0ofifeh7DVQ4mobOTmHod4")
(link "Systemprogrammierung 2"
"https://chat.whatsapp.com/IavyuLwBNeIJR4EHay8JKk")
'(span (em "Mathe C3")
" existiert nicht mehr, wurde zu "
(em "Mathe C4")))
(h1 "Vorlesungen aus dem 2. Semester")
,(ulist
(link "Parallele und Funktionale Programmierung"
"https://chat.whatsapp.com/8GCn4fTWZ0b24aJCOLqnbP")
(link "Grundlagen der Rechnerarchitektur"
"https://chat.whatsapp.com/G8wa1sbPw5hAyKB7FqaiP4")
(link "Grundlagen der Schaltungstechnik"
"https://chat.whatsapp.com/CLFxwY0QTItGlGhD7gXGlP")
'(span (em "Systemprogrammierung 1")
" existiert nicht mehr, wurde zu "
(em "Systemprogrammierung 2"))
'(span (em "Mathe C2")
" existiert nicht mehr, wurde zu "
(em "Mathe C4")))
(h1 "Vorlesungen aus dem 1. Semester")
,(ulist
(link "Konzeptionelle Modellierung"
"https://chat.whatsapp.com/1vgtbFsvEPL8VQhwxS7wgh")
(link "Grundlagen der Technischen Informatik"
"https://chat.whatsapp.com/2gGMa0rLJFz4UoUrQbWpRp")
(link "Algorithmen und Datenstrukturen"
"https://chat.whatsapp.com/DKtSVJ0cGJW7WllVXkpYOt")
'(span (em "Mathe C1")
" existiert nicht mehr, wurde zu "
(em "Mathe C4"))))
Supports Markdown
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