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
Mason Loring Bliss
cl-site
Commits
7eb5cde0
Commit
7eb5cde0
authored
Oct 14, 2018
by
Mariano Montone
Browse files
Merge branch 'master' into 'master'
Fix newsbox rendering in home page See merge request
clo/cl-site!50
parents
2a84e2ed
df2ff8ba
Changes
1
Hide whitespace changes
Inline
Side-by-side
process.lisp
View file @
7eb5cde0
...
...
@@ -33,6 +33,14 @@
;; process-pages : Copies/renders pages - called last
(
defun
render-template
(
template
&optional
context
output-stream
)
(
let
((
mustache:*load-path*
(
cons
*PAGES-DIR*
mustache:*load-path*
))
(
mustache:*default-pathname-type*
"html"
))
(
mustache:render
template
context
output-stream
)))
(
defun
render-template*
(
template
&optional
context
)
(
with-output-to-string
(
output-stream
)
(
render-template
template
context
output-stream
)))
(
defun
render-page
(
page
template-path
)
(
let
((
page-path
(
make-path
*PAGES-DIR*
page
t
))
...
...
@@ -44,14 +52,15 @@
(
content-text
(
format
nil
"~{~A~%~}"
content
))
(
parsed-header
(
yaml:parse
header-text
))
(
page-context
(
when
parsed-header
(
loop
for
k
being
each
hash-key
of
parsed-header
using
(
hash-value
v
)
collect
(
cons
k
v
)))))
(
when
parsed-header
(
loop
for
k
being
each
hash-key
of
parsed-header
using
(
hash-value
v
)
collect
(
cons
k
v
)))))
(
with-open-file
(
output-stream
output-path
:direction
:output
:if-exists
:supersede
)
(
mustache:render
template-path
(
append
(
acons
:page-content
content-text
page-context
)
*GLOBAL-CONTEXT*
)
:direction
:output
:if-exists
:supersede
)
(
render-template
template-path
(
append
(
acons
:page-content
(
render-template*
content-text
)
page-context
)
*GLOBAL-CONTEXT*
)
output-stream
))))))
(
defun
process-pages
(
pages
)
...
...
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