On 2016-03-09 20:18, Rainer Hansen <rainer.han...@gmx.net> writes:

> Sometimes I should read more carefully what I write. I want to use a
> static web site generator! So Wordpress is no option for me.

I maintain several very basic web sites in org. *Basic* is the keyword
here. Here is an example: http://ajacs.inria.fr/

Note that I suck at design and CSS, but I think this is orthogonal to
the matter at hand ;)

Each page is its own org file, and there is an additional file for the
left-hand bar.

Here is what index.org starts with:

#+INCLUDE: "common.org"

* body
  :CUSTOM_ID: mainbody
  :HTML_CONTAINER_CLASS: container-mainbody

** Welcome to the AJACS web site
Content goes here

The common.org is like this:

#+OPTIONS: toc:nil num:nil
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="/style.css" />

* sidebar
  :CUSTOM_ID: sidebar
  :HTML_CONTAINER_CLASS: container-sidebar

- [[http://ajacs.inria.fr/][Home]]
- [[./members.org][Members]]
- [[./meetings.org][Meetings]]

#+ATTR_HTML: :width 100

The layout is done using CSS. Here is an excerpt:

#+begin_src css
.container-mainbody {
    margin-left:  200px;
    padding: 10px;

.container-sidebar {
    float: left;
    width: 200px;
    padding-top: 12px;

#postamble {
    clear: both;

#mainbody, #sidebar {
    display: none;

#text-sidebar li a {
    color: rgb(54, 117, 148);
    text-decoration: none;

#address {
    display: none;

#text-address {
    color: rgb(54, 117, 148);
    text-align: center;

#mainheading {
    text-align: center;

.container-sidebar ul {
    list-style: none;

Finally this is all exported using a very simple Makefile

#+begin_src make
BATCH_EMACS=$(EMACS) --batch -Q -l init.el

PUB_FILES=index.html meetings.html internships/proxies.html style.css

%.html: %.org common.org
        $(BATCH_EMACS) $*.org -f org-html-export-to-html

all: $(PUB_FILES)

publish: $(PUB_FILES)
        rsync -azR --no-p --rsh=ssh -O $^ gf:/home/groups/ajacs/htdocs/

.PHONY: all publish

Oh, I need to show the init.el as well for the export:

#+begin_src emacs-lisp
(add-to-list 'load-path (file-name-directory load-file-name))

(require 'local_settings)

(require 'org)
(require 'ox-html)

(setq org-html-postamble nil)

The local-settings.el file allows us to collaborate using different kind
of installations for org.

#+begin_src emacs-lisp
(setq emacsd-dir "/Users/schmitta/.emacs.d/")

;; (add-to-list 'load-path (concat emacsd-dir "org/emacs/site-lisp/org"))

(setq package-user-dir (concat emacsd-dir "elpa"))

(provide 'local_settings)



OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂ (2016-02, Mauna Loa Obs.): 404.02

Attachment: signature.asc
Description: PGP signature

Reply via email to