Commit dbbb740a authored by Erik Huelsmann's avatar Erik Huelsmann

(re)Move handling of styles

Note that there was only one style and a lot of
infrastructure to deal with that single style.
Another argument against this code is the fact
that it's completely dependent on the definition
of global variables.
parent 407092f7
......@@ -12,13 +12,6 @@
(defparameter *DEFAULT-PAGE-TEMPLATE* "layout_2018.html"
"Default template to use unless another is explicitly specified.")
;; @TO-DO: replace this with better css preprocessing.
(defparameter *STYLES-DIR* (asdf:system-relative-pathname :cl-site "layout/css/")
"Pathname for location and list of styles.")
(defparameter *STYLES*
(list "layout_2018.css")
"A list of strings representing relative filenames.")
;; General static files - images etc
(defparameter *STATIC-DIR* (asdf:system-relative-pathname :cl-site "content/static/")
"Pathname for location of static files.")
......
......@@ -9,10 +9,7 @@
<link rel="stylesheet" href="/static/css/bootstrap.simplex.min.css">
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,700" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<link href="/layout_2018.css" rel="stylesheet" type="text/css">
{{#styles}}
<link href="{{location}}" rel="stylesheet" type="text/css">
{{/styles}}
<link href="/static/css/layout_2018.css" rel="stylesheet" type="text/css">
</head>
<body>
<nav id="navbar" class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top cl-navbar">
......
......@@ -5,5 +5,4 @@
(let ((*output-dir* (or output-dir *output-dir*)))
(format t "Generating site in ~A.~%" *output-dir*)
(process-static)
(process-styles *styles*)
(process-pages *pages*)))
;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
(in-package :cl-site)
;; Copies/renders stylesheets + adds to global context
(defun process-styles (styles)
(let
((styles-list (mapcar
(lambda (s) (progn
(uiop:copy-file (make-path *STYLES-DIR* s)
(make-path *OUTPUT-DIR* s))
(cons :location s)))
styles)))
(push (cons :styles styles-list) *GLOBAL-CONTEXT*)))
;; Copies/renders static assets (imgs, etc)
(defun process-static ()
(let ((destination-root (merge-pathnames #P"static/" *output-dir*))
......
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