emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Alan Schmitt <alan.schmitt@polytechnique.org>
To: Rainer Hansen <rainer.hansen@gmx.net>
Cc: emacs-orgmode@gnu.org
Subject: Re: Best way to create blog for company web site with Orgmode
Date: Thu, 10 Mar 2016 08:37:07 +0100	[thread overview]
Message-ID: <m2ziu64wd8.fsf@charm-ecran.irisa.fr> (raw)
In-Reply-To: <87r3fjqx39.fsf@gmx.net> (Rainer Hansen's message of "Wed, 09 Mar 2016 20:18:18 +0100")

[-- Attachment #1: Type: text/plain, Size: 3020 bytes --]

On 2016-03-09 20:18, Rainer Hansen <rainer.hansen@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
  :PROPERTIES:
  :CUSTOM_ID: mainbody
  :HTML_CONTAINER_CLASS: container-mainbody
  :END:

** Welcome to the AJACS web site
Content goes here


The common.org is like this:

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

* sidebar
  :PROPERTIES:
  :CUSTOM_ID: sidebar
  :HTML_CONTAINER_CLASS: container-sidebar
  :END:

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

#+begin_center
#+ATTR_HTML: :width 100
[[./files/ANR.png]]\\
ANR-14-CE28-0008  
#+end_center


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;
}
#+end_src


Finally this is all exported using a very simple Makefile

#+begin_src make
EMACS=emacs
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
#+end-src


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)
#+end_src


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"))
(package-initialize)

(provide 'local_settings)
#+end_src

Best,

Alan

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

  parent reply	other threads:[~2016-03-10  7:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-08 20:49 Best way to create blog for company web site with Orgmode Rainer Hansen
2016-03-09  9:45 ` Arkadiusz Drabczyk
2016-03-09 20:11   ` Rainer Hansen
2016-03-09 17:47 ` Brett Viren
2016-03-09 19:18   ` Rainer Hansen
2016-03-09 21:15     ` Rainer Hansen
2016-03-09 23:33       ` Brett Viren
2016-03-10  7:37     ` Alan Schmitt [this message]
2016-03-10  9:11       ` Eric S Fraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2ziu64wd8.fsf@charm-ecran.irisa.fr \
    --to=alan.schmitt@polytechnique.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=rainer.hansen@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).