How do I write this website?

I use Emacs for the website, the setup is pretty simple, I show how I do it here.

I have a two components, static files and pages:

(setq org-publish-project-alist
         :base-directory "~/emacs_site/"
         :base-extension "org"
         :publishing-directory "~/code/"
         :recursive t
         :section-numbers nil
         :with-toc nil
         :publishing-function publish-and-sgin-html

         :auto-sitemap t
         :sitemap-filename ""
         :sitemap-title "Journal"
         :sitemap-sort-files anti-chronologically
         :sitemap-date-format "Published: %a %b %d %Y"
         :headline-levels 4
         :html-preamble "
<ul class=\"menu\">
<li><a href=\"\">Home</a></li>
<li><a href=\"\">About</a></li>
<li><a href=\"\">Journal</a></li>
         :html-postamble "
<a style=\"display:block; text-align:center; \" href=''>
<img style=\"width:auto;\" src='' alt='hacker emblem' /></a>"

         :html-head-extra ,(concat "<style>" (with-temp-buffer
                                               (insert-file-contents "~/emacs_site/static/css/theme.css")
                                               (buffer-string)) "</style>"))
         :base-directory "~/emacs_site/"
         :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf"
         :publishing-directory "~/code/"
         :recursive t
         :publishing-function org-publish-attachment)

         :base-directory "~/emacs_site/"
         :publishing-directory "~/emacs_site/static/files/"
         :recursive t
         :publishing-function org-babel-tangle-publish)
         :base-directory "~/code/"
         :base-extension "org"
         :exclude ".*"   
         :publishing-directory "~/public_html/"
         :publishing-function org-rss-publish-to-rss
         :include (""))
         :components (""
                      ;; ""

Then I have this wrapper over org-html-publish-to-html to sign files:

(defun publish-and-sgin-html (plist filename pub-dir)
  (let ((filename (org-html-publish-to-html plist filename pub-dir)))
        (expand-file-name filename)

and the top of the cake

(defun publish-my-website ()
  (cond ((not (boundp 'curr-epa-key))
         (setq curr-epa-key (epa-select-keys (epg-make-context) "Select keys for signing.
If no one is selected, default secret key is used.  "
                                             nil t))))
  (org-publish "" t))

I also have a capture template, to capture blog posts from anywhere in Emacs:

(defun capture-report-data-file ()
  (let ((name (read-string "Name: ")))
    (find-file (expand-file-name (format ""
                                         (format-time-string "%Y-%m-%d")
                                         name) "~/emacs_site/blog/"))))

(add-to-list 'org-capture-templates
                "Blog post"
                (function capture-report-data-file)
                "#+TITLE: %^{prompt}\n#+DATE: %T\n\n%?"))

This looks simple because it is. Having the power of Emacs and org-mode for my static website is nice I guess.

Author: Mohamed Aziz Knani

Date: 2019-06-17 Mon 20:45

Emacs 26.2 (Org mode 9.2.1)


hacker emblem