diff options
author | 2012-12-10 02:22:18 +0100 | |
---|---|---|
committer | 2012-12-10 02:22:18 +0100 | |
commit | a2f077cf13d307c4d9d862028f459b783ede53cc (patch) | |
tree | 48d67b2e218cc5f97b52e412f5b45d3bff545c16 /site/blog/index.org | |
parent | 210460d177a9a4bdd5f2e8cfe08abe3277681aec (diff) | |
download | orgweb-a2f077cf13d307c4d9d862028f459b783ede53cc.tar.gz orgweb-a2f077cf13d307c4d9d862028f459b783ede53cc.zip |
Add some blog posts
Also an index page that automatically generates a list of all the
posts available.
Diffstat (limited to 'site/blog/index.org')
-rw-r--r-- | site/blog/index.org | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/site/blog/index.org b/site/blog/index.org new file mode 100644 index 0000000..5630590 --- /dev/null +++ b/site/blog/index.org @@ -0,0 +1,21 @@ +#+TITLE: Blog + +* Posts + #+begin_src emacs-lisp :exports results :results list + (defun file-to-data (file) + (unless (or (string= file ".") (string= file "..") (string= file "index.org")) + (let (title date) + (with-temp-buffer + (insert-file (concat "/home/slash/var/src/orgweb/site/blog/" file)) + (goto-char (point-min)) + (re-search-forward "^#\\+TITLE: \\(.*\\)$") + (setq title (buffer-substring-no-properties + (match-beginning 1) (match-end 1))) + (goto-char (point-min)) + (re-search-forward "^#\\+DATE: \\(.*\\)$") + (setq date (buffer-substring-no-properties + (match-beginning 1) (match-end 1)))) + (list date (concat "[[file:" file "][" title "]]"))))) + + (mapcar #'cadr (sort (delete nil (mapcar #'file-to-data (directory-files "/home/slash/var/src/orgweb/site/blog"))) (lambda (el1 el2) (not (string-lessp (car el1) (car el2)))))) + #+end_src |