Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
clo
cl-site
Commits
8ef92206
Commit
8ef92206
authored
Apr 24, 2017
by
Cheshire Yang
Browse files
Merge branch 'fix-pathnames' into 'master'
Fix pathnames to use the asd defintion as the root See merge request !1
parents
5c3d2896
d6f23fb6
Changes
1
Hide whitespace changes
Inline
Side-by-side
main.lisp
View file @
8ef92206
;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
(
in-package
:cl-site
)
(
require
:asdf
)
;; Locations for various files
(
defparameter
*PAGES-DIR*
"content/"
)
(
defparameter
*LAYOUT-DIR*
"layout/templates/"
)
(
defparameter
*OUTPUT-DIR*
"output/"
)
(
defparameter
*PAGES-DIR*
(
asdf:system-relative-pathname
:cl-site
"content/"
)
)
(
defparameter
*LAYOUT-DIR*
(
asdf:system-relative-pathname
:cl-site
"layout/templates/"
)
)
(
defparameter
*OUTPUT-DIR*
(
asdf:system-relative-pathname
:cl-site
"output/"
)
)
(
defparameter
*PRIVATE-KEYS*
'
(
:slug
:content
))
(
defparameter
*PAGES*
...
...
@@ -18,8 +19,11 @@
(
defun
make-path
(
prefix
page
)
(
pathname
(
concatenate
'string
prefix
(
cdr
(
assoc
:content
page
)))))
(
let
((
path
(
cdr
(
assoc
:content
page
))))
(
if
(
pathnamep
prefix
)
(
merge-pathnames
path
prefix
)
(
pathname
(
concatenate
'string
prefix
path
)))))
(
defun
file-to-string
(
filepath
)
(
with-open-file
(
stream
filepath
)
...
...
@@ -40,7 +44,6 @@
(
mustache:render
template-path
page-context
output-stream
))))
(
defun
make-site
()
(
let
((
template-path
(
pathname
(
concatenate
'string
*LAYOUT-DIR*
*DEFAULT-PAGE-TEMPLATE*
))))
(
loop
for
page
in
*PAGES*
do
(
render-page
page
template-path
))))
(
let
((
template-path
(
pathname
(
merge-pathnames
*LAYOUT-DIR*
*DEFAULT-PAGE-TEMPLATE*
))))
(
loop
for
page
in
*PAGES*
do
(
render-page
page
template-path
))))
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment