2021-04-23 18:18:12 +00:00
|
|
|
|
#+title: Archive
|
|
|
|
|
#+options: author:nil date:nil
|
2021-04-25 16:37:21 +00:00
|
|
|
|
#+html_head: <style> a { background-size: 0 !important; } </style>
|
2021-04-23 18:18:12 +00:00
|
|
|
|
|
|
|
|
|
* Post processing :noexport:
|
|
|
|
|
First we need to get all the posts
|
|
|
|
|
|
|
|
|
|
#+name: collect-posts
|
|
|
|
|
#+begin_src emacs-lisp
|
2021-04-25 14:29:57 +00:00
|
|
|
|
(setq posts (nreverse
|
|
|
|
|
(directory-files (expand-file-name "../content" default-directory)
|
|
|
|
|
t "[0-9]\\{4\\}-[0-9][0-9]-[0-9][0-9]-.+\\.org")))
|
2021-04-23 18:18:12 +00:00
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
Then we want to format the content for inclusion.
|
|
|
|
|
|
|
|
|
|
#+name: post-formatting
|
|
|
|
|
#+begin_src emacs-lisp
|
|
|
|
|
(defun post-item (file)
|
|
|
|
|
(with-temp-buffer
|
|
|
|
|
(insert-file-contents file)
|
|
|
|
|
(setq keywords (org-collect-keywords '("TITLE" "DATE")))
|
|
|
|
|
(format "+ @@html:<a href='%s.html'>@@ *%s* %s@@html:</a>@@"
|
|
|
|
|
(file-name-base file)
|
|
|
|
|
(cadr (assoc "DATE" keywords))
|
|
|
|
|
(cadr (assoc "TITLE" keywords)))))
|
|
|
|
|
#+end_src
|
|
|
|
|
|
|
|
|
|
* Output :ignore:
|
|
|
|
|
|
|
|
|
|
#+begin_src emacs-lisp :noweb yes :results raw :exports results
|
|
|
|
|
<<collect-posts>>
|
|
|
|
|
<<post-formatting>>
|
|
|
|
|
(mapconcat
|
|
|
|
|
(lambda (p) (post-item p))
|
|
|
|
|
posts
|
|
|
|
|
"\n")
|
|
|
|
|
#+end_src
|