Commit 8d99b796 authored by Ioanna M. Dimitriou H.'s avatar Ioanna M. Dimitriou H. 💬

Added web-feed and first new post. Major restructure.

parent 22b5bbe8
;;;;common.lisp
(in-package :ioa.re.common)
;; Common utility functions related to file input and output.
(defvar *local-directory* "")
(setf *local-directory*
(asdf:system-source-directory "ioa.re"))
(defun absolute-pathname (relative-path-string)
(merge-pathnames relative-path-string *local-directory*))
(defun absolute-path-string (relative-path-string)
(namestring (absolute-pathname relative-path-string)))
;;;;dispatchers.lisp
(in-package :ioa.re.dispatchers)
(defun get-dispatch-table ()
(append
(get-post-dispatchers)
(list
(hunchentoot:create-static-file-dispatcher-and-handler
"/ioa.css" (absolute-path-string "www/ioa.css"))
(hunchentoot:create-static-file-dispatcher-and-handler
"/ioa.ico" (absolute-path-string "www/ioa.ico"))
(hunchentoot:create-folder-dispatcher-and-handler
"/pdfs/" (absolute-path-string "www/pdfs/"))
(hunchentoot:create-folder-dispatcher-and-handler
"/images/" (absolute-path-string "www/images/"))
(hunchentoot:create-static-file-dispatcher-and-handler
"/posts.xml" (absolute-path-string "www/posts.xml"))
(hunchentoot:create-prefix-dispatcher
"/posts" 'posts-handler)
(hunchentoot:create-prefix-dispatcher
"/" 'index-handler))))
;; setup html-template
(setq html-template:*default-template-pathname*
(ioa.re.common:absolute-path-string "www/templates/"))
;;; Menu dispatchers
;; Index page
(defun index-handler ()
(with-output-to-string (stream)
(html-template:fill-and-print-template
#P"ioa.tmpl"
(list :title "ioa's website"
:template '((#P"index.tmpl")))
:stream stream)))
;; posts page, rss feed, and individual posts
(defun posts-handler ()
"The page listing the posts."
(with-output-to-string (stream)
(html-template:fill-and-print-template
#P"ioa.tmpl"
(list :title "ioa's posts"
:rss T
:template '((#P"posts.tmpl")))
:stream stream)))
(defsystem "ioa.re"
:components ((:file "server"))
:description "ioa's hunchentoot website"
:author "Ioanna M. Dimitriou H."
:components ((:file "packages")
(:file "common"
:depends-on ("packages"))
(:file "posts"
:depends-on ("packages"))
(:file "dispatchers"
:depends-on ("packages"
"common"
"posts"))
(:file "server"
:depends-on ("packages"
"dispatchers")))
:depends-on ("hunchentoot"
"html-template"))
(defpackage :ioa.re.common
(:use :cl)
(:documentation "Pathname and local directory functionality.")
(:export :absolute-path-string))
(defpackage :ioa.re.posts
(:use :cl)
(:documentation "Dispatchers for each post.")
(:export :get-post-dispatchers))
(defpackage :ioa.re.dispatchers
(:use :cl
:split-sequence
:hunchentoot
:html-template
:ioa.re.common
:ioa.re.posts)
(:documentation "Collects all the dispatchers, and defines the index and posts page handlers.")
(:export :get-dispatch-table))
(defpackage :ioa.re
(:use :cl
:hunchentoot
:ioa.re.dispatchers)
(:documentation "The Hunchentoot server setup for my personal website.")
(:export :start-website
:stop-website))
......@@ -2,103 +2,20 @@
(in-package :ioa.re.posts)
;; Structure of posts
(defstruct (post (:constructor make-post%))
id
title
relative-link
absolute-link
categories
(author-name "Ioanna M. Dimitriou H." :type 'string)
(author-uri "https://ioa.re")
(link-alt NIL)
pubDate
updated
summary
content-type
content)
;;; Posts are saved as plists in files in www/posts
;; Each file of type "post" in www/posts, is read and saved into a POST
;; structure, in a list of POSTS.
;; Functions related to input and output to disk.
(defvar *local-directory*
(uiop/os:getcwd))
(defun absolute-pathname (relative-path-string)
(merge-pathnames relative-path-string *local-directory*))
(defun absolute-path-string (relative-path-string)
(namestring (absolute-pathname relative-path-string)))
;;; POST structures from the *.post files
(defun pubDate->id (pubDate)
"To order the posts chronologically."
(destructuring-bind (day-comma date month year time zone)
(split-sequence:split-sequence #\Space pubDate)
(format nil "~a~a~a"
(parse-integer year)
(parse-integer month)
(parse-integer date))))
(defun relative-link (link)
(concatenate 'string "post/" link))
(defun absolute-link (link)
(concatenate 'string "https://ioa.re/"
(relative-link link)))
(defun make-post (&key
link ; to be deduced from the filename
pubDate
title
categories
updated
summary
;; so far content-type can only be NIL (plain html) or
;; "LaTeX", which I haven't finished implementing.
content-type
content)
(make-post%
:id (pubDate->id pubDate)
:title title
:relative-link (relative-link link)
:absolute-link (absolute-link link)
:categories categories
:pubDate pubDate
:updated updated
:summary summary
:content-type content-type
:content content))
;;; Collecting all posts stored in www/posts/*.post
(defun get-post-filenames (posts-relative-directory)
(remove-if
(lambda (pathname)
(or (not (equal (pathname-type pathname)
"post"))
(equal (pathname-name pathname)
"template")))
(uiop:directory-files posts-relative-directory)))
(defun post-from-filename (post-filename)
(let ((link (pathname-name post-filename)))
(eval `(make-post :link ,link
,@(uiop:safe-read-file-form post-filename)))))
(defun collect-posts () ; => list
"This package's exported function, collects all posts in www/posts into POST
structures in a list."
(let ((post-filenames (get-post-filenames "www/posts/")))
(loop for post-filename in post-filenames
for post = (post-from-filename post-filename)
;; must finish the MathML implementation before I allow these:
unless (equal "LaTeX" (post-content post))
collect post)))
;;; Manually creating and collecting post dispatchers.
(defun get-post-dispatchers ()
(list
(hunchentoot:create-prefix-dispatcher
"/post/2019-09-13-hello-world-again"
'hello-world-again-handler)))
;; hello-world
(defun hello-world-again-handler ()
(with-output-to-string (stream)
(html-template:fill-and-print-template
#P"ioa.tmpl"
(list :title "hello world, again"
:template '((#P"post/2019-09-13-hello-world-again.tmpl")))
:stream stream)))
(defpackage :ioa.re
(:use :cl :hunchentoot :html-template)
(:documentation "Creates ioa's website with html-template served by hunchentoot."))
(in-package :ioa.re)
;; Server and initial dispatch table
(defvar *server*)
(defvar *local-directory*
(namestring (asdf:system-source-directory :ioa.re)))
(defun local (rel-path)
(concatenate 'string *local-directory* rel-path))
(setq hunchentoot:*dispatch-table* ; dispatches folders, files, and pages
(list
(hunchentoot:create-static-file-dispatcher-and-handler
"/ioa.css" (local "www/ioa.css"))
(hunchentoot:create-prefix-dispatcher
"/" 'generate-index-page)))
(ioa.re.dispatchers:get-dispatch-table))
(defun start-website (&key (address "localhost") (port 8383))
(setq *server* (hunchentoot:start
......@@ -30,25 +16,12 @@
(defun stop-website ()
(stop *server*))
(setq html-template:*default-template-pathname*
(concatenate 'string *local-directory* "www/templates/"))
;; ## Index page
(defun generate-index-page ()
(with-output-to-string (stream)
(html-template:fill-and-print-template
#P"ioa.tmpl"
'()
:stream stream)))
;;; debugging
(defun debug-mode-on ()
(setq *catch-errors-p* NIL)
(setq *show-lisp-errors-p* T))
(setq hunchentoot:*catch-errors-p* NIL)
(setq hunchentoot:*show-lisp-errors-p* T))
(defun debug-mode-off ()
(setq *catch-errors-p* T)
(setq *show-lisp-errors-p* NIL))
(setq hunchentoot:*catch-errors-p* T)
(setq hunchentoot:*show-lisp-errors-p* NIL))
......@@ -2,14 +2,19 @@ html {
font-family: sans-serif;
}
b {
font-weight: 500;
code {
font-size: 1.2em;
vertical-align: middle;
}
a:link {
color: green;
}
a:visited {
color: darkgreen;
}
div.info {
font-size: 1em;
line-height: .85em;
......@@ -48,25 +53,79 @@ nav li{
section.bit {
clear: both;
max-width: 40em;
max-width: 32em;
margin: auto;
margin-bottom: 4em;
text-align: justify;
}
section.bit h1, section.bit h2, section.bit p {
padding: 0 0.5em;
margin-top: 0;
line-height: 1.27em;
padding-bottom: 7em;
}
section.bit h1 {
padding-top: 1em;
}
section.bit h2 {
font-weight: 900;
font-size: 1em;
margin-top: 1em;
margin-bottom: 0.5em;
h3 {
font-weight: bold;
font-size: 1.5em;
padding-top: 2em;
}
h2 {
font-weight: bold;
font-size: 1em;
padding-top: 1em;
}
h4 {
font-weight: bold;
font-size: 1em;
color: rgb(40, 40, 40);
padding-top: 0.5em;
padding-left: 0.5em;
margin-bottom: -0.5em;
}
h5 {
font-weight: 100;
color: gray;
font-style: italic;
font-size: 0.85em;
margin: 0em;
padding: 0em;
}
pubDate {
font-weight: 100;
color: gray;
font-style: italic;
font-size: 0.85em;
margin: 0em;
padding: 0em;
}
dl {
padding: 2.7em;
}
dl dt {
font-weight: bold;
}
dl dt a {
font-weight: 100;
}
dl dd description {
font-style: italic;
}
.LaTeX {
height: 1.27em;
vertical-align: middle;
}
.centered {
text-align: center;
padding: 2.7em;
}
www/ioa.ico

19.1 KB

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>ioa's posts</title>
<link>https://ioa.re/posts</link>
<description>Ioanna's mostly technical posts. New posts focus on software, old posts may include set theory.</description>
<image>https://ioa.re/ioa.png</image>
<item>
<title>hello world, again</title>
<link>https://ioa.re/post/2019-09-13-hello-world-again</link>
<pubDate>Fri, 13 Sep 2019 20:15:00 GMT(+1)</pubDate>
<description>
First new post from this website. Personal note.
</description>
</item>
</channel>
</rss>
......@@ -10,7 +10,11 @@
<li><a href="#about">about me</a></li>
<li><a href="#projects">software projects</a></li>
<li><a href="#publications">peer reviewed publications</a></li>
<li>unpublished notes: TBA</li>
<li><a href="/posts">my posts</a></li>
</ul>
</section>
<!-- TMPL_INCLUDE 'about.tmpl' -->
<!-- TMPL_INCLUDE 'projects.tmpl' -->
<!-- TMPL_INCLUDE 'publications.tmpl' -->
......@@ -4,10 +4,16 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>ioa's website</title>
<title><!-- TMPL_VAR title --></title>
<link rel="stylesheet" href="/ioa.css">
</head>
<link rel="icon" href="/ioa.ico" type="image/x-icon">
<!-- TMPL_IF rss -->
<link rel="alternate" title="ioa's posts" type="application/rss+xml" href="https://ioa.re/posts.xml">
<!-- /TMPL_IF -->
</head>
<header>
<!-- TMPL_INCLUDE 'menu.tmpl' -->
</header>
......@@ -16,19 +22,7 @@
<article>
<!-- TMPL_INCLUDE 'index.tmpl' -->
<!-- TMPL_INCLUDE 'about.tmpl' -->
<!-- TMPL_INCLUDE 'projects.tmpl' -->
<!-- TMPL_INCLUDE 'publications.tmpl' -->
<section>
<p>
<b>TBA: unpublished notes</b><br>
<br>
For the moment see <a href="https://web.archive.org/web/20161013235654/http://boolesrings.org/ioanna/">a cached version of my previous website</a>.
</p>
</section>
<!-- TMPL_CALL template -->
</article>
......
<div class="row">
<nav>
<ul>
<li><a href="#">home</a></li>
<li><a href="#about">about</a></li>
<li><a href="#projects">projects</a></li>
<li><a href="#publications">publications</a></li>
<li><a href="/">home</a></li>
<li><a href="/#about">about</a></li>
<li><a href="/#projects">projects</a></li>
<li><a href="/#publications">publications</a></li>
<li><a href="/posts">posts</a></li>
</ul>
</nav>
......
<section class="bit">
<h3>hello world, again</h3>
<h5>Fri, 13 Sep 2019 20:15:00 GMT(+1)</h5>
</postHeader>
<p>
Hello to people who read my posts for the first time,
and hello again to people who read my
<a href="https://web.archive.org/web/20161013235654/http://boolesrings.org/ioanna/">previous website</a>
then hosted on <a href="https://boolesrings.org/">boolesrings.org</a>.
</p>
<h2>introducing the new website</h2>
<p>
Since the original <a href="https://boolesrings.org/">boolesrings</a>
server was shut down last year, I was busy learning all kinds of new
things about software, so I neglected migrating my website.
Brand new and hand made, it's now being served to you by
<a href="https://edicl.github.io/hunchentoot/">Hunchentoot</a>,
running in Clozure Common Lisp, on nixOS.
</p>
<p>
Like all my personal projects, it's free and
<a href="https://gitlab.common-lisp.net/idimitriou/website">open source</a>.
It gets automatically updated with a trivial ansible playbook and a script,
every time I push changes to the above linked repository.
This website does not track you.
</p>
<h2>introducing the posts and rss feed</h2>
<p>
At first I wanted to write content management for my posts,
despite advice against it, but quickly realised that it's indeed a huge waste
of time. The brand new <a href="/posts.xml">RSS feed</a> is typed by hand.
The posts and their listing in the <a href="/posts">posts page</a> are written
almost entirely by hand with the help of trusty
<a href="https://edicl.github.io/html-template/">html-template</a>,
which I used for <a href="https://cgraph.inters.co/">CGraph</a> as well.
Comment-functionality in the posts is not yet implemented.
</p>
<p>
This is a very simple and straightforward setup, which is of course
the Right Thing™ to do. ^^
</p>
<h4>boolesrings</h4>
<p>
If this feed works as expected, it should appear at some point in the
<a href="https://boolesrings.org/">Boole's Rings</a> feed again.
<b>Thank you Peter and Sam!</b>
I did promise them that the first "real" post will be about
<a href="https://gitlab.common-lisp.net/idimitriou/lambda">my toy λ calculus compiler</a>,
and my attempts to compile simple untyped λ calculus to a stack machine.
<b>However</b>, this will have to wait a bit;
during my last visit to my parents, I volunteered on a very important
project for my mother.
</p>
<h4>small public library program</h4>
<p>
My mother, Marta Suzana Dimitriou Henríquez, is a librarian,
honoured by the city of Thessaloniki for setting up the city's network of
medical libraries. Now retired and partially moved to my father's
village in Mavroudi, Igoumenitsa, she is organising the first
public library in the area. I couldn't be more proud of her, and
I'm very pleased that I can help her with that. So the first "real"
post will be about this project.
</p>
<h4>my older boolesrings posts and <img class="LaTeX" src="/images/LaTeX.png"> support</h4>
<p>
The posts from my previous boolesrings hosted website will be
migrated soon. First, I should finish polishing up a small latex-in-html
library I cut out of CGraph's code. <img class="LaTeX" src="/images/LaTeX.png">
because it has the most beautiful maths format.
<a href="https://cgraph.inters.co/names-and-statements">Here</a> you can see
how it's being used for CGraph.
I would like to eventually add MathML support to that library.
</p>
<h2>miscellania</h2>
<p>
A personal update:
</p>
<ul>
<li>
Both the server library, <code>hunchentoot</code>, and the templating library,
<code>html-template</code>, are written by first common-lisper and then set
theorist
<a href="http://lisp-univ-etc.blogspot.com/2012/03/lisp-hackers-edi-weitz.html">Edi Weitz</a>.
I didn't know this when I chose his libraries, and I like the
coincidence. ^^
</li>
<li>
<em>For my former set theory and logic colleagues:</em><br/>
You should really <b>try Lisp</b>. I was introduced to and loved
Common Lisp first, but also Scheme is an excellent choice for a
logician, imho. <b>It just makes sense.</b> The switch to a career
in software development wasn't easy, but it was worth it. This is
so much fun! I am happy I found something in which I can get so
absorbed, as I did with pure logic.
</li>
<li>
My full time job is in a software consultancy, but I try
to meet up with my <a href="https://inters.co">interstellar</a>
partner and bestie <a href="https://mr.gy">Max Rottenkolber</a> for
hack-time as often as possible.
</li>
<li>
As always, I really appreciate all sorts of corrections, and
suggestions for improvement, to anything I write. Also questions.
Email me!
</li>
</ul>
Here's a recent photo, in case you see me in a conference, do say hi.
It's probably going to be at the
<a href="https://european-lisp-symposium.org/">European Lisp Symposium</a>.
<div class="centered">
<img src="/images/ioa-2019.jpg"
alt="me in 2019"
height="256"
width="256">
</div>
</section>
<section class="bit">
<a id="posts"></a>
<h1>posts</h1>
<p>
In reverse chronological order.
</p>
<dl>
<dt>
hello world, again
<a href="/post/2019-09-13-hello-world-again">
<pubDate>Fri, 13 Sep 2019 20:15:00 GMT(+1)</pubDate>
</a>
</dt>
<dd>
<description>
First new post from this website. Personal note.
</description>
</dd>
</dl>
<p>
Articles before 2019 will be copied from my
<a href="https://web.archive.org/web/20161013235654/http://boolesrings.org/ioanna/">previous website</a>,
and will appear below.
</p>
<!--
<dl>
<dt>a toolkit for the Dodd-Jensen core model</dt>
<dd>
<a href="https://ioa.re/post/2014-06-17-core-model-toolkit-html">
<pubDate>Tue, 17 Jun 2014 13:10:00 GMT(+1)</pubDate>
</a>
<description>
Applied set theory: Presenting a collection of theorems about the Dodd-Jensen core model,
which hopefully helps make this model more approachable to novices of core model theory.
Contains useful tricks for results on large cardinal axioms without the axiom of choice.
</description>
</dd>
</dl>
-->
</section>
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