Projects - Website Settings
I first created my website using VIM to write HTML, and then Emacs. It's very boring and waste of my time whenever I upgraded my website (actually ugly also). Luckily I met Emacs and started to use it after a while I felt VIM is not good enough for me (although it is good enough). Then I heard Emacs Wiki, however I did not use it until now because when I wanted to give it a try I knew that Michael Olson started publishing the first release candidates of the muse mode a couple of months ago. So I gave it a try and it did not take long until I was really happy with the system. This page provides an overview about my setup and is a reference for myself (and possibly others).
The configuration structure for my websettings is:
$HOME/
|©¤©¤ personal-site
|©¤©¤ muse/
| |©¤©¤ en-header.html
| |©¤©¤ en-footer.html
|©¤©¤ site/
| |©¤©¤ web/
| | |©¤©¤ *.muse
| |©¤©¤ projects/
| | |©¤©¤ *.muse
| |©¤©¤ wiki/
| | |©¤©¤ *.muse
|©¤©¤ publish/
|©¤©¤ static/
| |©¤©¤ styles/
| | |©¤©¤ *.css
| |©¤©¤ logos/
| | |©¤©¤ *.png
|©¤©¤ web/
| |©¤©¤ *.html
|©¤©¤ projects/
| |©¤©¤ images/
| |©¤©¤ docs/
| |©¤©¤ scripts/
| |©¤©¤ source/
| |©¤©¤ *.html
|©¤©¤ wiki/
| |©¤©¤ scripts/
| |©¤©¤ *.html
|©¤©¤ bookmarks/
Move muse-latest.tar.gz downloaded before to ~/Emacs/Source/ and uncompress:
#mv /path/to/muse-latest.tar.gz ~/Emacs/Source/ #cd !$ && tar xvfz muse-latest.tar.gz
Running make if you use GNU Emacs or else first edit the Makefile.defs file in the top-level directory to comment
EMACS = emacs SITEFLAG = --no-site-file
then uncomment
#EMACS = xemacs
#SITEFLAG = -no-site-file
to use XEmacs and at last run make.
Edit the Makefile.defs file to make the variable ELISPDIR points to where you want the source and compiled Muse files to be installed and INFODIR indicates where to put the Muse manual. For my configuration, I change them to
ELISPDIR = ~/Emacs/Extensions/EmacsMuse INFODIR = ~/Emacs/Docs
then
#mkdir ~/Emacs/Extensions/EmacsMuse
and at last run make install.
See this part on EmacsConfig page.
;;; muse-mode ;; ~/Emacs/Extensions/EmacsMuse/ ;(load-file "~/Emacs/Extensions/muse-zhy.el") (load-file "~/Emacs/Extensions/muse-zhy-en.el")
;; Add to load path (add-to-list 'load-path "~/Emacs/Extensions/EmacsMuse") (add-to-list 'load-path "~/Emacs/Extensions/EmacsMuse/experimental") (add-to-list 'load-path "~/Emacs/Extensions/EmacsMuse/contrib")
;; Initialize (require 'outline) ; I like outline-style faces (require 'muse) ; load generic module (require 'muse-colors) ; load coloring/font-lock module (require 'muse-mode) ; load authoring mode (require 'muse-blosxom) ; load blosxom module (require 'muse-docbook) ; load DocBook publishing style (require 'muse-html) ; load (X)HTML publishing style (require 'muse-latex) ; load LaTeX/PDF publishing styles (require 'muse-texinfo) ; load Info publishing style (require 'muse-wiki) ; load Wiki support (require 'muse-xml) ; load XML support (require 'muse-message) ; load message support (experimental) (require 'tp-muse-highlight)
;; Here is an example of making a customized version of your favorite ;; publisher. All this does is run `my-muse-blosoxm-finalize' on the ;; published file immediately after saving it. (unless (muse-derive-style "my-xhtml" "xhtml" :header "~/personal-site/muse/en-header.html" :footer "~/personal-site/muse/en-footer.html")) ;; Here is my master project listing. (setq muse-project-alist '(("Website" ("~/personal-site/site/web" :force-publish ("WikiIndex") :default "WelcomePage") (:base "my-xhtml" :path "~/personal-site/publish/web")) ("Projects" ("~/personal-site/site/projects" :force-publish ("WikiIndex") :default "WelcomePage") (:base "my-xhtml" :path "~/personal-site/publish/projects")) ("Wiki" ("~/personal-site/site/wiki" :force-publish ("WikiIndex") :default "WelcomePage") (:base "my-xhtml" :path "~/personal-site/publish/wiki")) ("Bookmarks" ("~/personal-site/site/bookmarks" :default "index") (:base "my-xhtml" :path "~/personal-site/publish/bookmarks"))))
;; Wiki settings (setq muse-wiki-interwiki-alist '(("PlugWiki" . "http://plug.student-orgs.purdue.edu/wiki/") ("EmacsWiki" . "http://www.emacswiki.org/cgi-bin/wiki/") ("ArchWiki" . "http://wiki.gnuarch.org/") ;; abbreviations ("FlyZhy" . "http://www.flyzhy.org/") ("MWOLSON" . "http://www.mwolson.org/") ("CERIAS" . "http://www.cerias.purdue.edu/") ("PlannerMode" . "http://www.plannerlove.com/") ("GP2X" . "http://www.gp2x.co.uk/") ("UbuntuLinux" . "http://ubuntulinux.org/") ("PLUG" . "http://plug.student-orgs.purdue.edu/wiki/")))
;;;###autoload ;; Switch to the given project and prompt for a file (defun my-muse-project-find-file (project) (interactive) (let ((muse-current-project (muse-project project))) (call-interactively 'muse-project-find-file))) ;; Determine whether we are publishing a certain kind of output (defun my-muse-format-p (format) (let ((base (muse-get-keyword :base muse-publishing-current-style))) (when base (string-match format base)))) ;; Make the title of the page into the index (defun ywb-muse-generate-index (&optional project-list) "Generate the index of all wikifile except the file in the \"website\" project" (unless project-list (setq project-list (list (car (muse-project))))) (let (project-files) (muse-with-temp-buffer (dolist (project project-list) (setq project-files (muse-project-file-alist project)) (progn (insert "* " project "\n")) (dolist (file project-files) (unless (or (equal (car file) "WelcomePage") (equal (car file) "WikiIndex")) (insert " - [[" project "#" (car file) "][" (save-excursion (set-buffer (generate-new-buffer "*index*")) (insert-file-contents (cdr file)) (goto-char (point-min)) (setq title (if (re-search-forward "^#title" nil t) (buffer-substring (point) (line-end-position)) (car file))) (kill-buffer (current-buffer)) title) "]]\n"))) (insert "\n")) (buffer-string))))
;;; Custom variables (custom-set-variables '(muse-colors-autogen-headings (quote outline)) '(muse-colors-inline-image-method (quote muse-colors-use-publishing-directory)) '(muse-html-charset-default "utf-8") '(muse-html-encoding-default (quote utf-8)) '(muse-html-meta-content-encoding (quote utf-8)) '(muse-mode-hook (quote (flyspell-mode footnote-mode))) '(muse-publish-comments-p t) '(muse-publish-desc-transforms (quote (muse-wiki-publish-pretty-title muse-wiki-publish-pretty-interwiki))) '(muse-wiki-publish-small-title-words (quote ("the" "and" "at" "on" "of" "for" "in" "an" "a" "page"))) (custom-set-faces '(muse-bad-link ((t (:foreground "DeepPink" :underline "DeepPink" :weight bold)))) '(muse-link ((t (:foreground "blue" :underline "blue" :weight bold)))))
Write your muse file with .muse as its extended name and type C-c C-p to publish all the files in the current project. See MuseMode#Documentation or QuickStart for quick start with Muse Mode.
1. To write your website using muse mode you also should have some basic knowledge about HTML and CSS.
2. The html files are generated by htmlize.el