Add files via upload

main
Cristian Cezar Moisés 2024-02-13 01:42:33 +00:00 committed by GitHub
parent 38bc1c2329
commit c586769ac4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
26 changed files with 461 additions and 0 deletions

35
css/default.css Normal file
View File

@ -0,0 +1,35 @@
html, body {
font-size: 16px;
font-family: monospace;
background: #000000;
color: #00FF66;
line-height: 1.25;
}
a {
color: #ACFFBD;
text-decoration: none;
font-weight: bold;
}
a:hover {
text-decoration: underline;
}
header {
text-align: center;
}
footer {
text-align: center;
}
#code {
background: #1c1c1c;
color: #FF8C00;
}
#block {
margin: auto;
max-width: 640px;
}

106
haunt.scm Normal file
View File

@ -0,0 +1,106 @@
;;; -*- coding: utf-8 -*-
;;;
;;; This program is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
;;; published by the Free Software Foundation; either version 3 of the
;;; License, or (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;;; General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program. If not, see
;;; <http://www.gnu.org/licenses/>.
(use-modules (haunt builder blog)
(haunt builder assets)
(haunt post)
(haunt site)
(haunt config)
(useful))
;; Static "Home"
(define home-page
(static-page
"Home"
"index.html"
`(,(centered-image "images/mainframe_256x256.gif"))))
;; Static "About" page
(define about-page
(static-page
"About"
"about.html"
`((h1 "About")
(p "This is the personal website of Cristian Cezar Moisés."
" I am a student. (Pronouns: "
(i "he, him, his")
").")
,(centered-image "images/profile.png")
(p "Learning about cybersec,infosec and hacking."
"Information Security Graduate"
,(link* "Ftec"
"https://www.ftec.com.br/")
". My research focused on the "
"Linux Servers Security."
"I'm a free software enthusiast.")
(br)
(p " I like code and i like to mix many projects like threejs + react "
"Check my awesome interactive portfolio "
,(link* "here"
"https://live-one.vercel.app")
". Outside of work, I'm a computerphile — "
"I enjoy learning about and using programming languages "
".This "
"site was written in the LISP dialect Scheme (GNU Guile, version "
,(version)
") and built with the Haunt library (version "
,%haunt-version
") on "
,(strftime "%c" (localtime (current-time)))
". The source code can be found on "
,(link* "GitHub"
"https://github.com/cristiancmoises/hauntweb")
". Check my YouTube channel "
,(link* "SecurityOps" "https://youtube.com/@securityops")
"."))))
(define not-found
(static-page
"404"
"404.html"
`((h1 "404 Page Not Found")
(p "Unfortunately the page you've tried to access doesn't exist!")
(br)
(h2 "Return "
,(link* "Home"
"https://cristiancmoises.github.io")
"?"))))
;; Collection of miscellaneous posts
(define %misc
`(("Recent Posts" "misc.html" ,misc-posts)))
;; Collection of research-related posts
(define %research
`(("Published Work" "research.html" ,research-posts)))
;; Build site
(site #:title
"C.C.M. Homepage"
#:domain
"cristiancmoises.github.io"
#:default-metadata
'((author . "Cristian Cezar Moisés"))
#:readers
(list commonmark-reader*)
#:builders
(list (blog #:theme default-theme #:collections %misc)
(blog #:theme default-theme #:collections %research)
home-page
about-page
not-found
(static-directory "css")
(static-directory "images")))

BIN
images/galaxy_256x256.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

BIN
images/github_profile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

BIN
images/logo_256x256.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

BIN
images/profile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

BIN
images/using_RFE.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

15
posts/fasteros.md Normal file
View File

@ -0,0 +1,15 @@
title: Faster⚡OS
date: 2024-02-12 19:00
tags: research
summary: My Web Operating System
---
Web Operating System
---
### Free.
A web operating system for you!
### Easy.
Just click [here](https://fasteros.vercel.app) and visit now.
### Nice.
All files are running on your local computer. Convert, play music, and more with this.

16
posts/guix.md Normal file
View File

@ -0,0 +1,16 @@
title: Ok. That's All
date: 2024-02-12 19:00
tags: misc
summary: Guix - The best!
---
Why Guix?..."
---
### Liberating.
Guix is a distribution of the GNU operating system developed by the GNU Project—which respects the freedom of computer users.
### Dependable.
Guix supports transactional upgrades and roll-backs, unprivileged package management, and more. When used as a standalone distribution, Guix supports declarative system configuration for transparent and reproducible operating systems.
### Hackable.
It provides Guile Scheme APIs, including high-level embedded domain-specific languages (EDSLs) to define packages and whole-system configurations.

1
site/404.html Normal file
View File

@ -0,0 +1 @@
<!DOCTYPE html><head><meta charset="utf-8" /><meta name="description" content="C.C.M. personal website" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>404 — C.C.M. Homepage</title><link rel="stylesheet" href="/css/default.css" /></head><body><header><div id="block"><p>+&gt;---------------------------&lt;+</p><p>[<a href="/about.html">About</a>]--[<a href="/research.html">Research</a>]--[<a href="/misc.html">Miscellany</a>]</p><p>+&gt;---------------------------&lt;+</p><br /></div></header><div id="block"><h1>404 Page Not Found</h1><p>Unfortunately the page you've tried to access doesn't exist!</p><br /><h2>Return [<a href="https://cristiancmoises.github.io">Home</a>]?</h2></div><footer><div id="block"><br /><p>+&gt;---------------------------&lt;+</p><div>[<a href="https://github.com/cristiancmoises">GitHub</a>]--[<a href="https://www.linkedin.com/in/cristiancezarmoises">LinkedIn</a>]</div><div>[<a href="https://orcid.org/0000-0001-9533-4916">ORCID</a>]--[<a href="https://arxiv.org/search/?">ArXiv</a>]--[<a href="https://youtube.com/@securityops">Youtube</a>]</div><p>© 2024 Cristian Cezar Moises</p><p>[<a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>]</p><p>Built with [<a href="http://haunt.dthompson.us">Haunt</a>] in [<a href="https://www.gnu.org/software/guile/guile.html">Scheme</a>]</p><p>+&gt;---------------------------&lt;+</p></div></footer></body>

1
site/about.html Normal file
View File

@ -0,0 +1 @@
<!DOCTYPE html><head><meta charset="utf-8" /><meta name="description" content="C.C.M. personal website" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>About — C.C.M. Homepage</title><link rel="stylesheet" href="/css/default.css" /></head><body><header><div id="block"><p>+&gt;---------------------------&lt;+</p><p>[<a href="/about.html">About</a>]--[<a href="/research.html">Research</a>]--[<a href="/misc.html">Miscellany</a>]</p><p>+&gt;---------------------------&lt;+</p><br /></div></header><div id="block"><h1>About</h1><p>This is the personal website of Cristian Cezar Moisés. I am a student. (Pronouns: <i>he, him, his</i>).</p><div style="text-align: center"><img src="images/profile.png" /></div><p>Learning about cybersec,infosec and hacking.Information Security Graduate[<a href="https://www.ftec.com.br/">Ftec</a>]. My research focused on the Linux Servers Security.I'm a free software enthusiast.</p><br /><p> I like code and i like to mix many projects like threejs + react Check my awesome interactive portfolio [<a href="https://live-one.vercel.app">here</a>]. Outside of work, I'm a computerphile — I enjoy learning about and using programming languages .This site was written in the LISP dialect Scheme (GNU Guile, version 3.0.9) and built with the Haunt library (version 0.2.6) on Mon 12 Feb 2024 10:40:07 PM -03. The source code can be found on [<a href="https://github.com/cristiancmoises/hauntweb">GitHub</a>]. Check my YouTube channel [<a href="https://youtube.com/@securityops">SecurityOps</a>].</p></div><footer><div id="block"><br /><p>+&gt;---------------------------&lt;+</p><div>[<a href="https://github.com/cristiancmoises">GitHub</a>]--[<a href="https://www.linkedin.com/in/cristiancezarmoises">LinkedIn</a>]</div><div>[<a href="https://orcid.org/0000-0001-9533-4916">ORCID</a>]--[<a href="https://arxiv.org/search/?">ArXiv</a>]--[<a href="https://youtube.com/@securityops">Youtube</a>]</div><p>© 2024 Cristian Cezar Moises</p><p>[<a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>]</p><p>Built with [<a href="http://haunt.dthompson.us">Haunt</a>] in [<a href="https://www.gnu.org/software/guile/guile.html">Scheme</a>]</p><p>+&gt;---------------------------&lt;+</p></div></footer></body>

35
site/css/default.css Normal file
View File

@ -0,0 +1,35 @@
html, body {
font-size: 16px;
font-family: monospace;
background: #000000;
color: #00FF66;
line-height: 1.25;
}
a {
color: #ACFFBD;
text-decoration: none;
font-weight: bold;
}
a:hover {
text-decoration: underline;
}
header {
text-align: center;
}
footer {
text-align: center;
}
#code {
background: #1c1c1c;
color: #FF8C00;
}
#block {
margin: auto;
max-width: 640px;
}

1
site/fasteros.html Normal file
View File

@ -0,0 +1 @@
<!DOCTYPE html><head><meta charset="utf-8" /><meta name="description" content="C.C.M. personal website" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>Faster⚡OS — C.C.M. Homepage</title><link rel="stylesheet" href="/css/default.css" /></head><body><header><div id="block"><p>+&gt;---------------------------&lt;+</p><p>[<a href="/about.html">About</a>]--[<a href="/research.html">Research</a>]--[<a href="/misc.html">Miscellany</a>]</p><p>+&gt;---------------------------&lt;+</p><br /></div></header><div id="block"><h1>Faster⚡OS</h1><div>February 12, 2024</div><div><h2>Web Operating System</h2><h3>Free.</h3><p>A web operating system for you!</p><h3>Easy.</h3><p>Just click [<a href="https://fasteros.vercel.app">here</a>] and visit now.</p><h3>Nice.</h3><p>All files are running on your local computer. Convert, play music, and more with this.</p></div></div><footer><div id="block"><br /><p>+&gt;---------------------------&lt;+</p><div>[<a href="https://github.com/cristiancmoises">GitHub</a>]--[<a href="https://www.linkedin.com/in/cristiancezarmoises">LinkedIn</a>]</div><div>[<a href="https://orcid.org/0000-0001-9533-4916">ORCID</a>]--[<a href="https://arxiv.org/search/?">ArXiv</a>]--[<a href="https://youtube.com/@securityops">Youtube</a>]</div><p>© 2024 Cristian Cezar Moises</p><p>[<a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>]</p><p>Built with [<a href="http://haunt.dthompson.us">Haunt</a>] in [<a href="https://www.gnu.org/software/guile/guile.html">Scheme</a>]</p><p>+&gt;---------------------------&lt;+</p></div></footer></body>

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 140 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

BIN
site/images/profile.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

BIN
site/images/using_RFE.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

1
site/index.html Normal file
View File

@ -0,0 +1 @@
<!DOCTYPE html><head><meta charset="utf-8" /><meta name="description" content="C.C.M. personal website" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>Home — C.C.M. Homepage</title><link rel="stylesheet" href="/css/default.css" /></head><body><header><div id="block"><p>+&gt;---------------------------&lt;+</p><p>[<a href="/about.html">About</a>]--[<a href="/research.html">Research</a>]--[<a href="/misc.html">Miscellany</a>]</p><p>+&gt;---------------------------&lt;+</p><br /></div></header><div id="block"><div style="text-align: center"><img src="images/mainframe_256x256.gif" /></div></div><footer><div id="block"><br /><p>+&gt;---------------------------&lt;+</p><div>[<a href="https://github.com/cristiancmoises">GitHub</a>]--[<a href="https://www.linkedin.com/in/cristiancezarmoises">LinkedIn</a>]</div><div>[<a href="https://orcid.org/0000-0001-9533-4916">ORCID</a>]--[<a href="https://arxiv.org/search/?">ArXiv</a>]--[<a href="https://youtube.com/@securityops">Youtube</a>]</div><p>© 2024 Cristian Cezar Moises</p><p>[<a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>]</p><p>Built with [<a href="http://haunt.dthompson.us">Haunt</a>] in [<a href="https://www.gnu.org/software/guile/guile.html">Scheme</a>]</p><p>+&gt;---------------------------&lt;+</p></div></footer></body>

1
site/misc.html Normal file
View File

@ -0,0 +1 @@
<!DOCTYPE html><head><meta charset="utf-8" /><meta name="description" content="C.C.M. personal website" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>Recent Posts — C.C.M. Homepage</title><link rel="stylesheet" href="/css/default.css" /></head><body><header><div id="block"><p>+&gt;---------------------------&lt;+</p><p>[<a href="/about.html">About</a>]--[<a href="/research.html">Research</a>]--[<a href="/misc.html">Miscellany</a>]</p><p>+&gt;---------------------------&lt;+</p><br /></div></header><div id="block"><h1>Recent Posts</h1><div><h2><a href="/ok-thats-all.html" style="text-decoration: none;">Ok. That's All</a></h2><div>February 12, 2024</div><div><h2>Why Guix?...&quot;</h2></div>[<a href="/ok-thats-all.html">read more...</a>]<br /><p style="text-align: center;">--&gt;--&lt;--</p></div></div><footer><div id="block"><br /><p>+&gt;---------------------------&lt;+</p><div>[<a href="https://github.com/cristiancmoises">GitHub</a>]--[<a href="https://www.linkedin.com/in/cristiancezarmoises">LinkedIn</a>]</div><div>[<a href="https://orcid.org/0000-0001-9533-4916">ORCID</a>]--[<a href="https://arxiv.org/search/?">ArXiv</a>]--[<a href="https://youtube.com/@securityops">Youtube</a>]</div><p>© 2024 Cristian Cezar Moises</p><p>[<a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>]</p><p>Built with [<a href="http://haunt.dthompson.us">Haunt</a>] in [<a href="https://www.gnu.org/software/guile/guile.html">Scheme</a>]</p><p>+&gt;---------------------------&lt;+</p></div></footer></body>

1
site/ok-thats-all.html Normal file
View File

@ -0,0 +1 @@
<!DOCTYPE html><head><meta charset="utf-8" /><meta name="description" content="C.C.M. personal website" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>Ok. That's All — C.C.M. Homepage</title><link rel="stylesheet" href="/css/default.css" /></head><body><header><div id="block"><p>+&gt;---------------------------&lt;+</p><p>[<a href="/about.html">About</a>]--[<a href="/research.html">Research</a>]--[<a href="/misc.html">Miscellany</a>]</p><p>+&gt;---------------------------&lt;+</p><br /></div></header><div id="block"><h1>Ok. That's All</h1><div>February 12, 2024</div><div><h2>Why Guix?...&quot;</h2><h3>Liberating.</h3><p>Guix is a distribution of the GNU operating system developed by the GNU Project—which respects the freedom of computer users.</p><h3>Dependable.</h3><p>Guix supports transactional upgrades and roll-backs, unprivileged package management, and more. When used as a standalone distribution, Guix supports declarative system configuration for transparent and reproducible operating systems.</p><h3>Hackable.</h3><p>It provides Guile Scheme APIs, including high-level embedded domain-specific languages (EDSLs) to define packages and whole-system configurations.</p></div></div><footer><div id="block"><br /><p>+&gt;---------------------------&lt;+</p><div>[<a href="https://github.com/cristiancmoises">GitHub</a>]--[<a href="https://www.linkedin.com/in/cristiancezarmoises">LinkedIn</a>]</div><div>[<a href="https://orcid.org/0000-0001-9533-4916">ORCID</a>]--[<a href="https://arxiv.org/search/?">ArXiv</a>]--[<a href="https://youtube.com/@securityops">Youtube</a>]</div><p>© 2024 Cristian Cezar Moises</p><p>[<a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>]</p><p>Built with [<a href="http://haunt.dthompson.us">Haunt</a>] in [<a href="https://www.gnu.org/software/guile/guile.html">Scheme</a>]</p><p>+&gt;---------------------------&lt;+</p></div></footer></body>

1
site/research.html Normal file
View File

@ -0,0 +1 @@
<!DOCTYPE html><head><meta charset="utf-8" /><meta name="description" content="C.C.M. personal website" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>Published Work — C.C.M. Homepage</title><link rel="stylesheet" href="/css/default.css" /></head><body><header><div id="block"><p>+&gt;---------------------------&lt;+</p><p>[<a href="/about.html">About</a>]--[<a href="/research.html">Research</a>]--[<a href="/misc.html">Miscellany</a>]</p><p>+&gt;---------------------------&lt;+</p><br /></div></header><div id="block"><h1>Published Work</h1><div><h2><a href="/fasteros.html" style="text-decoration: none;">Faster⚡OS</a></h2><div>February 12, 2024</div><div><h2>Web Operating System</h2></div>[<a href="/fasteros.html">read more...</a>]<br /><p style="text-align: center;">--&gt;--&lt;--</p></div></div><footer><div id="block"><br /><p>+&gt;---------------------------&lt;+</p><div>[<a href="https://github.com/cristiancmoises">GitHub</a>]--[<a href="https://www.linkedin.com/in/cristiancezarmoises">LinkedIn</a>]</div><div>[<a href="https://orcid.org/0000-0001-9533-4916">ORCID</a>]--[<a href="https://arxiv.org/search/?">ArXiv</a>]--[<a href="https://youtube.com/@securityops">Youtube</a>]</div><p>© 2024 Cristian Cezar Moises</p><p>[<a href="https://creativecommons.org/licenses/by-sa/4.0/">CC BY-SA 4.0</a>]</p><p>Built with [<a href="http://haunt.dthompson.us">Haunt</a>] in [<a href="https://www.gnu.org/software/guile/guile.html">Scheme</a>]</p><p>+&gt;---------------------------&lt;+</p></div></footer></body>

247
useful.scm Normal file
View File

@ -0,0 +1,247 @@
;;; -*- coding: utf-8 -*-
;;;
;;; This program is free software; you can redistribute it and/or
;;; modify it under the terms of the GNU General Public License as
;;; published by the Free Software Foundation; either version 3 of the
;;; License, or (at your option) any later version.
;;;
;;; This program is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
;;; General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with this program. If not, see
;;; <http://www.gnu.org/licenses/>.
(define-module (useful)
#:use-module (haunt html)
#:use-module (haunt reader)
#:use-module (haunt utils)
#:use-module (haunt asset)
#:use-module (haunt builder blog)
#:use-module (haunt page)
#:use-module (haunt post)
#:use-module (haunt site)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-19)
#:use-module (web uri)
#:use-module (ice-9 match)
#:use-module (sxml match)
#:use-module (sxml transform)
#:use-module (commonmark)
#:export (link*
default-theme
static-page
research-posts
misc-posts
centered-image
commonmark-reader*
date))
;;; HTML utilities ---------------------------------------------------
(define (link* name uri)
"Create a link with NAME to url URI."
`("[" (a (@ (href ,uri)) ,name) "]"))
(define (stylesheet name)
"Use the stylesheet NAME.css saved locally in css/."
`(link (@ (rel "stylesheet")
(href ,(string-append "/css/" name ".css")))))
(define (centered-image image)
"Create a centered image from source IMAGE."
`((div (@ (style "text-align: center")) (img (@ (src ,image))))))
;;; Post processing utilities ----------------------------------------
(define (date year month day)
"Create a SRFI-19 date for the given YEAR, MONTH, DAY"
(let ((tzoffset
(tm:gmtoff
(localtime (time-second (current-time))))))
(make-date 0 0 0 0 day month year tzoffset)))
(define (first-paragraph post)
"Extract the first paragraph from POST."
(let loop ((sxml (post-sxml post)) (result '()))
(match sxml
(() (reverse result))
((or (('p ...) _ ...) (paragraph _ ...))
(reverse (cons paragraph result)))
((head . tail) (loop tail (cons head result))))))
(define (contains? l m)
"Check if LIST contains MEMBER."
(if (null? l)
#f
(or (equal? (first l) m)
(contains? (drop l 1) m))))
(define (research? post)
"Check if POST has a research tag."
(contains? (post-ref post 'tags) "research"))
(define (misc? post)
"Check if POST has a misc tag."
(contains? (post-ref post 'tags) "misc"))
(define (research-posts posts)
"Returns POSTS that contain research tag in reverse chronological order."
(posts/reverse-chronological
(filter research? posts)))
(define (misc-posts posts)
"Returns POSTS that contain misc tag in reverse chronological order."
(posts/reverse-chronological
(filter misc? posts)))
;;; Links ------------------------------------------------------------
(define (github)
(link* "GitHub" "https://github.com/cristiancmoises"))
(define (linkedin)
(link* "LinkedIn" "https://www.linkedin.com/in/cristiancezarmoises"))
(define (orcid)
(link* "ORCID" "https://orcid.org/0000-0001-9533-4916"))
(define (arxiv)
(link* "ArXiv" "https://arxiv.org/search/?"))
(define (ads)
(link* "Youtube" "https://youtube.com/@securityops"))
(define (cc-by-sa)
(link* "CC BY-SA 4.0" "https://creativecommons.org/licenses/by-sa/4.0/"))
;;; Website layout ---------------------------------------------------
(define (header-box)
`(div (@ (id "block"))
(p "+>---------------------------<+")
(p ,(link* "About" "/about.html")--
,(link* "Research" "/research.html")--
,(link* "Miscellany" "/misc.html"))
(p "+>---------------------------<+")
(br)))
(define (footer-box)
`(div (@ (id "block"))
(br)
(p "+>---------------------------<+")
(div ,(github)--
,(linkedin))
(div ,(orcid)--
,(arxiv)--
,(ads))
(p "© 2024 Cristian Cezar Moises")
(p ,(cc-by-sa))
(p "Built with "
,(link* "Haunt" "http://haunt.dthompson.us")
" in "
,(link* "Scheme" "https://www.gnu.org/software/guile/guile.html"))
(p "+>---------------------------<+")))
(define default-theme
(theme #:name
"default-theme"
#:layout
(lambda (site title body)
`((doctype "html")
(head (meta (@ (charset "utf-8")))
(meta (@ (name "description")
(content "C.C.M. personal website")))
(meta (@ (name "viewport")
(content "width=device-width, initial-scale=1")))
(title ,(string-append title " — " (site-title site)))
,(stylesheet "default"))
(body (header ,(header-box))
(div (@ (id "block")) ,body)
(footer ,(footer-box)))))
#:post-template
(lambda (post)
`((h1 ,(post-ref post 'title))
(div ,(date->string (post-date post) "~B ~d, ~Y"))
(div ,(post-sxml post))))
#:collection-template
(lambda (site title posts prefix)
(define (post-uri post)
(string-append
"/"
(or prefix "")
(site-post-slug site post)
".html"))
`((h1 ,title)
,(map (lambda (post)
(let ((uri (string-append
"/"
(site-post-slug site post)
".html")))
`(div (h2 (a (@ (href ,uri)
(style "text-decoration: none;"))
,(post-ref post 'title)))
(div ,(date->string (post-date post) "~B ~d, ~Y"))
(div ,(first-paragraph post))
,(link* "read more..." uri)
(br)
(p (@ (style "text-align: center;")) "-->--<--"))))
posts)))))
(define (static-page title file-name body)
"Create a static page with TITLE at html file FILENAME using page BODY."
(lambda (site posts)
(make-page
file-name
(with-layout default-theme site title body)
sxml->html)))
;;; Custom markdown reader --------------------------------------------------
(define (sxml-identity . args) args)
;; Code block
(define (code-block . tree)
(sxml-match
tree
((pre (code ,source))
`(div (@ (id "code"))
(pre (@ (style "overflow: auto")) (code ,source))))
(,other other)))
;; Convert hrefs to custom hoverable link
(define (hover-link . tree)
(sxml-match
tree
((a (@ (href ,uri) unquote _) unquote name)
`(,(link* name uri)))))
;; Center all images
(define (center-images . tree)
(sxml-match
tree
((img (@ (src ,uri) unquote _))
`(,(centered-image uri)))))
(define %commonmark-rules
`((pre unquote code-block)
(a unquote hover-link)
(img unquote center-images)
(*text* unquote (lambda (tag str) str))
(*default* unquote sxml-identity)))
(define (post-process-commonmark sxml)
(pre-post-order sxml %commonmark-rules))
(define commonmark-reader*
(make-reader
(make-file-extension-matcher "md")
(lambda (file)
(call-with-input-file
file
(lambda (port)
(values
(read-metadata-headers port)
(post-process-commonmark (commonmark->sxml port))))))))