Skip to content

Commit d3bac48

Browse files
committed
feat: Add about page to example
This is done by calling our parse-org function. Turns out sci doesn't like slurp, so I'll need to figure out how to support it or workaround it. This example just parses a hard-coded org file as a string.
1 parent 9b283aa commit d3bac48

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

example/site.clj

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
(def site-name "My amazing website")
22

3+
(def about-page-org-string
4+
"
5+
#+TITLE: Sur Moi
6+
#+TAGS: foo bar baz
7+
8+
* This is an H1, right?
9+
10+
This is some content under an h1, this is some content under an h1 This is some
11+
content under an h1, this is some content under an h1 This is some content under
12+
13+
** This is an H2, right?
14+
*** What about formatting?
15+
16+
A list?
17+
18+
- *BOLD*
19+
- /Italic/
20+
- ~fixed-width~
21+
")
22+
323
(def-asset global-style
424
{:path "/css/global.css"
525
:type :css
@@ -13,7 +33,15 @@
1333
(stylesheet global-style)]
1434
[:body content]])
1535

36+
(def-asset about-page
37+
{:path "/about.html"
38+
:type :html
39+
:data (page "Sur Moi" (-> about-page-org-string
40+
;; TODO Can't slurp a file with sci, what do?
41+
(clj-org.org/parse-org)
42+
(:content)))})
43+
1644
(def-asset home-page
1745
{:path "/index.html"
1846
:type :html
19-
:data (page "Hello world" [:p "This is magic"])})
47+
:data (page "Hello world" [:a {:href "/about.html"} "This is a blog link."])})

0 commit comments

Comments
 (0)