Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 145 lines (135 sloc) 6.641 kb
1deefca @sachac Add blog posts, start fleshing out index
authored
1 ;; build site
2 (package-initialize)
3 (require 'ox-publish)
4 (require 'htmlize)
5 (org-babel-do-load-languages
6 'org-babel-load-languages
7 '((dot . t)
8 (ditaa . t)
9 (R . t)))
10
11 (setq-default buffer-file-coding-system 'utf-8)
12
13 (defvar sacha/emacs-notes-html-head
4846231 @sachac Add transcript for IRC with ERC (Eric Collins)
authored
14 "<link rel=\"stylesheet\" type=\"text/css\" href=\"./css/foundation.min.css\"></link>
2a6067c @sachac Add Open Sans reference
authored
15 <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'></link>
1deefca @sachac Add blog posts, start fleshing out index
authored
16 <link rel=\"stylesheet\" type=\"text/css\" href=\"./css/org-export.css\"></link>
17 <link rel=\"stylesheet\" type=\"text/css\" href=\"./css/style.css\"></link>
18 <link rel=\"stylesheet\" type=\"text/css\" href=\"./css/emacs-notes.css\"></link>
19 <script src=\"./js/jquery.min.js\"></script>
20 <script src=\"./js/emacs-notes.js\"></script>")
21
22 (defvar sacha/emacs-notes-postamble "<div class=\"back-to-top\"><a href=\"#top\">Back to top</a> | <a href=\"mailto:sacha@sachachua.com\">E-mail me</a></div>")
23
24 (defvar sacha/emacs-notes-directory (file-name-directory (or load-file-name buffer-file-name))
25 "Location of files.")
26
27 (defun sacha/emacs-notes-org-publish-project (project &optional force async)
28 "Override some variables."
29 (interactive
30 (list
31 (assoc (org-icompleting-read
4846231 @sachac Add transcript for IRC with ERC (Eric Collins)
authored
32 "Publish project: "
33 org-publish-project-alist nil t)
34 org-publish-project-alist)
1deefca @sachac Add blog posts, start fleshing out index
authored
35 current-prefix-arg))
36 (let ((buffer-file-coding-system 'utf-8)
4846231 @sachac Add transcript for IRC with ERC (Eric Collins)
authored
37 (select-safe-coding-system-accept-default-p t)
38 org-confirm-babel-evaluate
39 make-backup-files
40 org-html-validation-link)
1deefca @sachac Add blog posts, start fleshing out index
authored
41 (org-publish-project project force async)))
42
5ffea06 @sachac Updates
authored
43 (defun sacha/emacs-notes-org-publish-current-file (&optional force async)
44 "Override some variables."
45 (interactive)
46 (let ((buffer-file-coding-system 'utf-8)
47 (select-safe-coding-system-accept-default-p t)
48 org-confirm-babel-evaluate
49 make-backup-files
50 org-html-validation-link)
51 (org-publish-current-file force async)))
52
1deefca @sachac Add blog posts, start fleshing out index
authored
53 (defun sacha/emacs-notes-org-html-publish-to-html (plist filename pub-dir)
54 "Publish without saving backup files."
55 (let ((buffer-file-coding-system 'utf-8)
56 (select-safe-coding-system-accept-default-p t)
57 org-confirm-babel-evaluate
58 make-backup-files org-html-validation-link)
8e37d37 @sachac Updated project
authored
59 (condition-case nil
60 (org-html-publish-to-html plist filename pub-dir)
61 (error (message "Error publishing %s" filename)))))
1deefca @sachac Add blog posts, start fleshing out index
authored
62
aedcb3a @sachac Tweak project loading
authored
63 (unless (assoc "emacs-notes-base" org-publish-project-alist)
64 (add-to-list 'org-publish-project-alist
65 `("emacs-notes-base"
66 :base-directory ,sacha/emacs-notes-directory
67 :base-extension "org"
68 :exclude "tasks.org" ; regexp
69 :publishing-directory ,sacha/emacs-notes-directory
70 :publishing-function sacha/emacs-notes-org-html-publish-to-html
71 :html-head-include-default-style nil
72 :html-head-include-scripts nil
73 :html-head ,sacha/emacs-notes-html-head
74 :auto-sitemap t ; Generate sitemap.org automagically...
75 :sitemap-filename "sitemap.org" ; Call it sitemap.org (it's the default)...
76 :sitemap-title "Sitemap" ; With title 'Sitemap'.
77 :makeindex t
78 :with-timestamp t
79 :section-numbers nil
80 :html-preamble ""
81 :html-postamble ,sacha/emacs-notes-postamble
82 :htmlized-source t
83 )))
84 (unless (assoc "emacs-notes-blog-posts" org-publish-project-alist)
4846231 @sachac Add transcript for IRC with ERC (Eric Collins)
authored
85 (add-to-list 'org-publish-project-alist
86 `("emacs-notes-blog-posts"
87 :base-directory ,(expand-file-name "blog-posts" sacha/emacs-notes-directory)
88 :base-extension "org"
89 :exclude "tasks.org" ; regexp
90 :publishing-directory ,(expand-file-name "blog-posts" sacha/emacs-notes-directory)
91 :publishing-function sacha/emacs-notes-org-html-publish-to-html
92 :html-head-include-default-style nil
93 :html-head-include-scripts nil
94 :html-head ,(replace-regexp-in-string "\\./" "../" sacha/emacs-notes-html-head)
95 :auto-sitemap t ; Generate sitemap.org automagically...
96 :sitemap-filename "sitemap.org" ; Call it sitemap.org (it's the default)...
97 :sitemap-title "Sitemap" ; With title 'Sitemap'.
98 :section-numbers nil
99 :html-preamble ""
100 :html-postamble ,sacha/emacs-notes-postamble
101 :makeindex t
102 :with-timestamp t
103 :htmlized-source)))
9826412 @sachac Split off the first section of the Read Lisp Tweak Emacs guide.
authored
104 (unless (assoc "read-lisp-tweak-emacs" org-publish-project-alist)
105 (add-to-list 'org-publish-project-alist
106 `("read-lisp-tweak-emacs"
107 :base-directory ,(expand-file-name "read-lisp-tweak-emacs" sacha/emacs-notes-directory)
108 :base-extension "txt"
109 :publishing-directory ,(expand-file-name "read-lisp-tweak-emacs" sacha/emacs-notes-directory)
110 :publishing-function sacha/emacs-notes-org-html-publish-to-html
111 :html-head-include-default-style nil
112 :html-head-include-scripts nil
113 :html-head ,(replace-regexp-in-string "\\./" "../" sacha/emacs-notes-html-head)
114 :auto-sitemap t ; Generate sitemap.org automagically...
115 :sitemap-filename "sitemap.org" ; Call it sitemap.org (it's the default)...
116 :sitemap-title "Sitemap" ; With title 'Sitemap'.
117 :section-numbers nil
118 :html-preamble ""
119 :html-postamble ,sacha/emacs-notes-postamble
120 :makeindex t
121 :with-timestamp t
122 :htmlized-source)))
4846231 @sachac Add transcript for IRC with ERC (Eric Collins)
authored
123 (unless (assoc "emacs-notes-transcripts" org-publish-project-alist)
124 (add-to-list 'org-publish-project-alist
125 `("emacs-notes-transcripts"
126 :base-directory ,(expand-file-name "transcripts" sacha/emacs-notes-directory)
127 :publishing-directory ,(expand-file-name "transcripts" sacha/emacs-notes-directory)
128 :publishing-function sacha/emacs-notes-org-html-publish-to-html
129 :html-head-include-default-style nil
130 :html-head-include-scripts nil
131 :html-head ,(replace-regexp-in-string "\\./" "../" sacha/emacs-notes-html-head)
132 :auto-sitemap t ; Generate sitemap.org automagically...
133 :sitemap-filename "sitemap.org" ; Call it sitemap.org (it's the default)...
134 :sitemap-title "Sitemap" ; With title 'Sitemap'.
135 :section-numbers nil
136 :html-preamble ""
137 :html-postamble ,sacha/emacs-notes-postamble
138 :makeindex t
139 :with-timestamp t
140 :htmlized-source)))
aedcb3a @sachac Tweak project loading
authored
141 (unless (assoc "sacha/emacs-notes" org-publish-project-alist)
4846231 @sachac Add transcript for IRC with ERC (Eric Collins)
authored
142 (add-to-list 'org-publish-project-alist '("sacha/emacs-notes"
143 :components ("emacs-notes-base" "emacs-notes-blog-posts" "emacs-notes-transcripts"))))
1deefca @sachac Add blog posts, start fleshing out index
authored
144
Something went wrong with that request. Please try again.