|
|
@ -48,16 +48,6 @@ |
|
|
|
subtree-end |
|
|
|
nil))) |
|
|
|
|
|
|
|
(defun spacelite/org-html-preamble (plist) |
|
|
|
(concat |
|
|
|
"<div class=\"org-center\">" |
|
|
|
"<p>[ " |
|
|
|
"<a href=\"/index.html\">Home</a> | " |
|
|
|
"<a href=\"/cv.html\">About Me</a> | " |
|
|
|
"<a href=\"/blog/index.html\">Blog</a> | " |
|
|
|
"<a href=\"/selfhosting.html\">Self Hosting</a> | " |
|
|
|
"<a href=\"/vinyl.html\">Vinyl</a> ]</p></div>")) |
|
|
|
|
|
|
|
(defun spacelite/org-html-postamble (plist) |
|
|
|
(concat |
|
|
|
"<hr />" |
|
|
@ -65,50 +55,6 @@ |
|
|
|
"<div class=\"figure\"><p><img src=\"https://static.fsf.org/nosvn/associate/crm/2960622.png\" alt=\"FSF Member\" height=\"45\" /></p></div>" |
|
|
|
"<div class=\"figure\"><p><img src=\"https://sdf.org/sdfbanner.png\" alt=\"SDF\" height=\"45\" /></p></div>")) |
|
|
|
|
|
|
|
(defun spacelite/blog-sitemap-function (title list) |
|
|
|
(concat "#+TITLE: dctrud@sdf :: Blog\n" |
|
|
|
"Welcome to my blog... I'm currently taking part in the [[https://100daystooffload.com/][#100DaysToOffload]] challenge\n" |
|
|
|
"so there should be something insignificant and uninteresting added here every day :-)\n\n" |
|
|
|
"Expect a mix of various things... computing, music, bbq, and other topics.\n\n" |
|
|
|
"[[https://dctrud.sdf.org/blog/rss.xml][RSS Feed]]\n\n" |
|
|
|
"* Recent Posts\n" |
|
|
|
(org-list-to-org list))) |
|
|
|
|
|
|
|
(defun spacelite/org-rss-publish-to-rss (plist filename pub-dir) |
|
|
|
"Publish RSS with PLIST, only when FILENAME is 'rss.org'. |
|
|
|
PUB-DIR is when the output will be placed." |
|
|
|
(if (equal "rss.org" (file-name-nondirectory filename)) |
|
|
|
(org-rss-publish-to-rss plist filename pub-dir))) |
|
|
|
|
|
|
|
(defun spacelite/format-rss-feed (title list) |
|
|
|
"Generate RSS feed, as a string. |
|
|
|
TITLE is the title of the RSS feed. LIST is an internal |
|
|
|
representation for the files to include, as returned by |
|
|
|
`org-list-to-lisp'. PROJECT is the current project." |
|
|
|
(concat "#+TITLE: " title "\n\n" |
|
|
|
(org-list-to-subtree list '(:icount "" :istart "")))) |
|
|
|
|
|
|
|
(defun spacelite/format-rss-feed-entry (entry style project) |
|
|
|
"Format ENTRY for the RSS feed. |
|
|
|
ENTRY is a file name. STYLE is either 'list' or 'tree'. |
|
|
|
PROJECT is the current project." |
|
|
|
(cond ((not (directory-name-p entry)) |
|
|
|
(let* ((file (org-publish--expand-file-name entry project)) |
|
|
|
(title (org-publish-find-title entry project)) |
|
|
|
(date (format-time-string "%Y-%m-%d" (org-publish-find-date entry project))) |
|
|
|
(link (concat (file-name-sans-extension entry) ".html"))) |
|
|
|
(with-temp-buffer |
|
|
|
(insert (format "* [[file:%s][%s]]\n" file title)) |
|
|
|
(org-set-property "RSS_PERMALINK" link) |
|
|
|
(org-set-property "PUBDATE" date) |
|
|
|
(insert-file-contents file) |
|
|
|
(buffer-string)))) |
|
|
|
((eq style 'tree) |
|
|
|
;; Return only last subdir. |
|
|
|
(file-name-nondirectory (directory-file-name entry))) |
|
|
|
(t entry))) |
|
|
|
|
|
|
|
|
|
|
|
(defun spacelite/init-org-evil () |
|
|
|
; evil key bindings |
|
|
|
(use-package evil-org |
|
|
@ -197,7 +143,7 @@ PROJECT is the current project." |
|
|
|
(require 'ox-rss) |
|
|
|
(setq org-publish-project-alist |
|
|
|
'(("site" |
|
|
|
:components ("content" "static" "blog")) |
|
|
|
:components ("content" "static")) |
|
|
|
("content" |
|
|
|
:base-directory "~/Org/Web/pages/" |
|
|
|
:base-extension "org" |
|
|
@ -211,7 +157,6 @@ PROJECT is the current project." |
|
|
|
:html-doctype "html5" |
|
|
|
:html-html5-fancy t |
|
|
|
:html-head "<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/org-css/stylesheet.css\" />" |
|
|
|
:html-preamble spacelite/org-html-preamble |
|
|
|
:html-postamble spacelite/org-html-postamble) |
|
|
|
("static" |
|
|
|
:base-directory "~/Org/Web/static/" |
|
|
@ -219,45 +164,7 @@ PROJECT is the current project." |
|
|
|
:publishing-directory "~/Org/WebPub/static/" |
|
|
|
:recursive t |
|
|
|
:publishing-function org-publish-attachment) |
|
|
|
("blog" |
|
|
|
:base-directory "~/Org/Web/blog/" |
|
|
|
:base-extension "org" |
|
|
|
:publishing-directory "~/Org/WebPub/blog/" |
|
|
|
:publishing-function org-html-publish-to-html |
|
|
|
:makeindex nil |
|
|
|
:auto-sitemap t |
|
|
|
:sitemap-filename "index.org" |
|
|
|
:sitemap-title "dctrud@sdf :: Blog" |
|
|
|
:sitemap-function spacelite/blog-sitemap-function |
|
|
|
:sitemap-sort-files anti-chronologically |
|
|
|
:recursive t |
|
|
|
:timestamp t |
|
|
|
:with-sub-superscript nil |
|
|
|
:section-numbers: nil |
|
|
|
:with-headline-numbers nil |
|
|
|
:exclude "index.org\\|rss.org" |
|
|
|
:html-doctype "html5" |
|
|
|
:html-html5-fancy t |
|
|
|
:html-head "<link rel=\"stylesheet\" type=\"text/css\" href=\"/static/org-css/stylesheet.css\" />" |
|
|
|
:html-preamble spacelite/org-html-preamble |
|
|
|
:html-postamble spacelite/org-html-postamble) |
|
|
|
("blog-rss" |
|
|
|
:base-directory "~/Org/Web/blog/" |
|
|
|
:base-extension "org" |
|
|
|
:publishing-directory "~/Org/WebPub/blog/" |
|
|
|
:publishing-function spacelite/org-rss-publish-to-rss |
|
|
|
:makeindex nil |
|
|
|
:auto-sitemap t |
|
|
|
:sitemap-filename "rss.org" |
|
|
|
:sitemap-title "dctrud@sdf :: Blog" |
|
|
|
:sitemap-sort-files anti-chronologically |
|
|
|
:sitemap-function spacelite/format-rss-feed |
|
|
|
:sitemap-format-entry spacelite/format-rss-feed-entry |
|
|
|
:rss-extension "xml" |
|
|
|
:exclude "index.org\\|rss.org" |
|
|
|
:html-link-home "https://dctrud.sdf.org/blog" |
|
|
|
:html-link-use-abs-url t |
|
|
|
)))) |
|
|
|
))) |
|
|
|
|
|
|
|
(defun spacelite/init-deft () |
|
|
|
(use-package deft |
|
|
|