Configuration

This website heavily borrows from the work of Kunal Bhalla and can be found on github here and here.

Imports

(require 'ob-css)
(require 'ox-publish)

Style

body {
  color: #111;
  font-family: 'Gentium Book Basic', serif;
  font-size: 16px;
  line-height: 24px;
  margin: 0 auto;
  max-width: 672px;
  padding: 0 32px;
}

a:link,
a:visited {
  background-color: #eee;
  border-bottom: solid #333 1px;
  color: #111;
  padding: 0 .2em;
  text-decoration: none;
}

a:hover {
  background-color: #333;
  color: #eee;
}

a:active {
  border-bottom: solid #f00 1px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'helvetica neue', 'arial', sans-serif;
  font-weight: normal;
  line-height: 1.2em;
}

h1.title {
  border-bottom: solid #d4d4d4 1px;
  padding-bottom: .2em;
  text-align: left;
}

.figure p {
  text-align: left;
}

#postamble {
  border-top: solid #d4d4d4 1px;
  color: #999;
  font-style: italic;
  text-align: right;
  margin-top: 1em;
}

#postamble a.source-link:link,
#postamble a.source-link:visited {
  color: #000;
  float: left;
  font-family: monospace;
  font-style: normal;
  text-transform: lowercase;
}

#postamble a.source-link:hover,
#postamble a.source-link:active {
  background-color: #000;
  color: #fff;
}

#postamble a:link, #postamble a:visited {
  background-color: transparent;
  border-bottom: none;
  color: #999;
}

#postamble a:hover {
  background-color: #777;
  color: #fff;
}

#postamble a:active {
 border-bottom: solid 1px #f00;
}

code {
  background-color: #eee;
  border-top: solid #d4d4d4 1px;
  border-bottom: solid #d4d4d4 1px;
  padding: 0 .2em;
}

pre.src, pre.example {
  background-color: #eee;
  border-top: solid #d4d4d4 1px;
  border-bottom: solid #d4d4d4 1px;
  border-left: none;
  border-right: none;
  box-shadow: none;
  font-size: 14px;
  line-height: 20px;
  padding: 1em;
  margin: 0;
  overflow: auto;
  max-width: 100%;
}

pre.src:before {
  background-color: transparent;
  border: none;
  top: 0;
  right: 0;
}

sup {
  line-height: 0;
}

hr {
  border-top: solid 1px #d4d4d4;
  border-bottom: none;
}

li p {
  margin: 0;
}

.footpara {
  margin: 0;
}

.footnotes {
  margin-top: 1em;
}

table, td, th {
  border: 1px solid black;
}

Header

<link href='https://fonts.googleapis.com/css?family=Gentium+Book+Basic:400,400i,700' rel='stylesheet' />
<style type='text/css'>
  <<style>>
</style>

Publishing configuration

(defun create-source-link (filename)
  (concat "./" (file-name-nondirectory filename) ".html"))

(defun create-postamble (options)
  (let ((input-file (plist-get options :input-file)))
    (concat
     "<a class='source-link' href='"
     (create-source-link input-file)
     "'>Source</a>"
     "Last updated on "
     (current-time-string)
     " &bullet; <a href='http://julienchastang.com'>julienchastang.com</a>"
     " by <a href='http://julienchastang.com'>Julien Chastang</a>")))

(defun create-project-configuration (title base-dir publishing-dir)
  `((,(concat title "-source")
     :base-directory ,base-dir
     :publishing-directory ,publishing-dir
     :base-extension "org"
     :recursive t
     :htmlized-source t
     :publishing-function org-org-publish-to-org)
    (,title
     :base-directory ,base-dir
     :publishing-directory ,publishing-dir
     :base-extension "org"
     :recursive t
     :section-numbers nil
     :publishing-function org-html-publish-to-html
     :with-author nil
     :with-toc nil
     :html-head-include-scripts nil
     :html-head-extra "
    <<header>>
            "
     :html-validation-link nil
     :html-footnotes-section "<div class=\"footnotes\" title=\"%s\">%s</div>"
     :html-postamble ,'create-postamble)))

(setq
 org-publish-project-alist
 `(,@(create-project-configuration
      "jc-notes"
      "/home/python/work/julienchastang/src/org"
      "/home/python/work/julienchastang/publish/julienchastang.github.io/")
   ("jc-static"
    :base-directory "/home/python/work/julienchastang/src/static/"
    :publishing-directory "/home/python/work/julienchastang/publish/julienchastang.github.io/static/"
    :base-extension any
    :recursive t
    :publishing-function org-publish-attachment)
   ("jc"
    :components ("jc-notes"
                 "jc-notes-source"
                 "jc-static"))))

Publish

(org-publish "jc" nil)
(global-set-key
 (kbd "C-c c")
 (lambda ()
   (interactive)
   (org-babel-load-file "/home/python/work/julienchastang/src/org/configuration.org")))
; (org-babel-execute-buffer)
SourceLast updated on Wed Mar 8 01:57:53 2017 • julienchastang.com by Julien Chastang