Misc.

Commit
4c2d4ab558d968a8fc311e4556215108721623f6
Author
Marius Peter <marius.peter@tutanota.com>
Author date
Committer
Marius Peter <marius.peter@tutanota.com>
Committer date
Changed files
.gitignore
index 80d20f5c..d6524c7f 100644..100644
@@ -1,8 +1,8 @@
1 1 # .gitignore for mlnp.fr
2 2
3 Removed: # All HTML and CSS should be generated from Org files, NO EXCEPTIONS.
4 Removed: *.html
3 Added: # All CSS should be generated from Org files, NO EXCEPTIONS. This ensures all artifacts are documented.
5 4 *.css
6 5
7 Removed: # Topnav items are generated upon export by the Org publish sitemap.
8 Removed: resources/topnav-items.org
6 Added: # Font files are not version-controlled.
7 Added: *.ttf
8 Added: *.otf
index.org
index 580b88dd..d6294871 100644..100644
@@ -1,38 +1,39 @@
1 1 # -*- mode: org; -*-
2 2
3 Removed: #+TITLE: Home
4 Removed: #+SUBTITLE: A personal blog written in [[https://orgmode.org/][Org mode]].
3 Added: #+TITLE: mlnp.fr
4 Added: #+SUBTITLE: A personal website created with [[https://orgmode.org/][Org mode]].
5 5 #+AUTHOR: Marius Peter
6 Removed: #+DATE: <2022-01-23 Sun> Updated <2022-01-31 Mon>
6 Added: #+DATE: <2022-01-23 Sun>
7 7 #+EMAIL: mlnp@tuta.io
8 8 #+OPTIONS: num:nil toc:nil
9 9
10 10 #+HTML_HEAD: <link rel="stylesheet" type="text/css" href="resources/mlnp.css" />
11 Removed: #+INCLUDE: resources/topnav.org
11 Added: #+INCLUDE: resources/topnav.html export html
12 12
13 13
14 Removed: * Recent posts
14 Added: # #+begin_abstract
15 Added: # This website contains two main components: blog posts and wiki
16 Added: # pages. Blog posts relate to one-off topics of interest, whilst wiki
17 Added: # pages serve as my personal and professional [[https://en.wikipedia.org/wiki/Knowledge_management][Knowledge Management]]
18 Added: # resources.
19 Added: # #+end_abstract
15 20
16 Removed: - This is a list
17 Removed: - Foobar
18 Removed: - Third item
19 21
22 Added: * TODO Latest blog posts
20 23
21 Removed: * Projects
24 Added: # Implement (jQuery?) links to last 3 blog posts.
22 25
26 Added: All blog posts available [[file:blog/index.org][here]].
23 27
24 Removed: * Publishing this website
28 Added: #+BEGIN_SRC
29 Added: #+END_SRC
25 30
26 Removed: This entire website is built with [[https://orgmode.org/][Org mode]], an Emacs mode designed for
27 Removed: literate programming among other things. Using Org mode for designing,
28 Removed: building and publishing a website brings the following benefits:
29 31
30 Removed: - Work within Emacs :: This advantage concerns existing Emacs users.
31 Removed: - Literate programming :: Org files contain a mix of plain text
32 Removed: associated with documentation, and code that can be executed. A
33 Removed: documentation-centered workflow encourages us to describe our
34 Removed: thought process as we write a program, this increases the likelihood
35 Removed: of remembering why a particular piece of code was written.
36 Removed:
37 Removed: The entire website publication flow is described here:
38 Removed: [[file:publish-mlnp.org]].
32 Added: * Latest wiki pages
33 Added:
34 Added: All wiki pages available [[file:wiki/index.org][here]].
35 Added:
36 Added:
37 Added: * Publishing this website
38 Added:
39 Added: Learn how I build this entire website on the [[file:publish-mlnp.org][publish]] page.
publish-mlnp.org
index 2ea510bf..6c2dc1f1 100644..100644
@@ -1,52 +1,69 @@
1 1 # -*- mode: org; -*-
2 2
3 3 #+TITLE: Publish
4 Removed: #+SUBTITLE: Publishing this very website.
4 Added: #+SUBTITLE: Guide to publishing this very website.
5 5 #+AUTHOR: Marius Peter
6 6 #+DATE: <2022-01-26 Wed>
7 7 #+OPTIONS: toc:nil
8 8
9 9 #+HTML_HEAD: <link rel="stylesheet" type="text/css" href="resources/mlnp.css" />
10 Removed: #+INCLUDE: resources/topnav.org
11 Removed: #+TOC: headlines 3
10 Added: #+INCLUDE: resources/topnav.html export html
12 11
13 12
14 13 #+begin_abstract
15 14 In the spirit of [[https://en.wikipedia.org/wiki/Literate_programming][literate programming]] encouraged by Org mode, this
16 Removed: entire website's build process is documented on this very page. When
17 Removed: Emacs builds this website, it parses and executes the code blocks
15 Added: entire website's build process is documented on this very page. In
16 Added: order to build this website, Emacs parses and executes the code blocks
18 17 contained on this page. By mixing behavior with the behavior's
19 18 documentation, we can future-proof our understanding of the build
20 Removed: logic, making it possible to efficiently revisit this website at a
21 Removed: later date in order to bring improvements.
19 Added: logic, making it possible to efficiently revisit and upgrade this
20 Added: website at a later date.
22 21 #+end_abstract
23 22
23 Added: #+TOC: headlines 3
24 24
25 Added:
26 Added: * Introduction
27 Added:
28 Added: This entire website is built with [[https://orgmode.org/][Org mode]], an Emacs mode designed for
29 Added: literate programming among other things. Using Org mode for designing,
30 Added: building and publishing a website brings the following benefits:
31 Added:
32 Added: - Work within Emacs :: This advantage concerns existing Emacs users.
33 Added: - Literate programming :: Org files contain a mix of plain text
34 Added: associated with documentation, and code that can be executed. A
35 Added: documentation-centered workflow encourages us to describe our
36 Added: thought process as we write a program, this increases the likelihood
37 Added: of remembering why a particular piece of code was written.
38 Added:
39 Added:
25 40 * Publishing targets
26 41
27 42 This first section lays out the interactive prompts used to bind
28 43 export-related symbols with the following publishing targets:
29 44
30 Removed: - location :: Where should the website be published?
31 Removed: - components :: What parts of the website should be built?
45 Added: - Location :: Where should the website be published?
46 Added: - Components :: What parts of the website should be built?
32 47
33 48
34 49 ** Location
35 50
36 51 Two possible publishing locations are considered:
37 52
38 Removed: - Local :: The website would be built on the local machine.
39 Removed: - Remote :: The website would be built on a remote server, after
40 Removed: uploading the selected files via ssh.
53 Added: - Local :: The website is built on the local machine. This is useful
54 Added: for website development.
55 Added: - Remote :: The website is built on the specified remote server. This
56 Added: is used to publish the website on the internet, it then becomes
57 Added: visible at [[http://mlnp.fr/][mlnp.fr]].
41 58
42 59 #+NAME: org-publish-location
43 60 #+BEGIN_SRC elisp
44 61 (setq org-publish-location
45 62 (read-answer
46 63 "Should the website be built on the local or remote target? "
47 Removed: '(("~/tmp-mlnp.fr/"
64 Added: '(("/tmp/"
48 65 ?l "build website on the local machine")
49 Removed: ("/ssh:root@192.162.71.223:/var/www/html/mlnp.fr/"
66 Added: ("/ssh:root@192.162.71.223:/var/www/"
50 67 ?r "build website on the remote machine"))))
51 68 #+END_SRC
52 69
@@ -65,65 +82,156 @@
65 82 #+end_src
66 83
67 84
68 Removed:
69 85 * Resources
70 86
71 Removed: This section explores the =.css= and (maybe later) =.js= resources
72 Removed: available on the website.
73 87
74 Removed:
75 88 ** CSS
76 89
77 Removed: The main CSS file is located at [[file:resources/css.org]].
90 Added: The website styling information is described on the [[file:resources/css.org][CSS]] page.
78 91
79 92
93 Added: ** JS
94 Added:
95 Added: The goal of this website is to /not/ have to rely on JavaScript.
96 Added:
97 Added:
98 Added: * COMMENT HTML preamble
99 Added:
100 Added: #+NAME: org-publish-html-preamble
101 Added: #+BEGIN_SRC emacs-lisp
102 Added: (setq org-publish-html-preamble nil)
103 Added: ;; (setq org-publish-html-preamble
104 Added: ;; (concat
105 Added: ;; "<nav id='topnav'>
106 Added: ;; <a href='index.html' id='home'><code>home</code></a>
107 Added: ;; <label for='hamburger'>&#9776;</label>
108 Added: ;; <input type='checkbox' id='hamburger'/>"
109 Added: ;; (progn
110 Added: ;; (save-window-excursion
111 Added: ;; (find-file "resources/topnav-items.org")
112 Added: ;; (org-html-export-to-html nil nil nil t nil))
113 Added: ;; (org-file-contents "resources/topnav-items.html"))
114 Added: ;; "</nav>"))
115 Added: #+END_SRC
116 Added:
117 Added:
80 118 * Project components
81 119
82 120 The ~org-publish-project-alist~ variable is used by ~org-publish~ to
83 Removed: identify website components and their properties upon export.
121 Added: identify website components and their properties upon export. It
122 Added: enables us to target different directories when publishing; I can
123 Added: write this website in a single, version-controlled directory, whilst
124 Added: maintaining separate export directories for =wiki.mlnp.fr= and
125 Added: =blog.mlnp.fr=.
84 126
127 Added: Both the wiki and the blog call for css and font resources hosted on
128 Added: =mlnp.fr=, so these resources need only be exported once---to the
129 Added: =mlnp.fr/resources/= folder.
130 Added:
85 131 #+NAME: org-publish-project-alist
86 132 #+BEGIN_SRC elisp
87 133 (require 'ox-publish)
88 134 (setq org-publish-project-alist
89 Removed: `(("site"
135 Added: `(
136 Added: ;; Main site.
137 Added: ("mlnp.fr"
138 Added: :components ("mlnp-main-pages"
139 Added: "mlnp-resources"
140 Added: "resources-pages" ; Only hosted on the main website.
141 Added: "mlnp-fonts"))
142 Added: ("mlnp-main-pages"
90 143 :base-directory "./"
91 144 :base-extension "org"
92 Removed: :publishing-directory ,org-publish-location
93 Removed: :recursive nil ; Top-level pages are all in top-level org directory.
94 Removed: :publishing-function org-html-publish-to-html
95 Removed: :auto-sitemap t
96 Removed: :sitemap-filename "resources/topnav-items.org"
97 Removed: :sitemap-title "Top-level site links")
98 Removed: ("posts"
99 Removed: :base-directory "posts/"
145 Added: :publishing-directory ,(concat org-publish-location "mlnp.fr/")
146 Added: :recursive nil ; Main site pages are all in top-level org directory.
147 Added: :publishing-function org-html-publish-to-html)
148 Added: ("mlnp-resources"
149 Added: :base-directory "resources/"
150 Added: :base-extension "css\\|js"
151 Added: :publishing-directory ,(concat org-publish-location "mlnp.fr/resources/")
152 Added: :publishing-function org-publish-attachment)
153 Added: ("resources-pages"
154 Added: :base-directory "resources/"
100 155 :base-extension "org"
101 Removed: :publishing-directory ,(concat org-publish-location "posts/")
156 Added: :publishing-directory ,(concat org-publish-location "mlnp.fr/resources/")
157 Added: :publishing-function org-html-publish-to-html)
158 Added: ("mlnp-fonts"
159 Added: :base-directory "resources/fonts/"
160 Added: :base-extension "ttf\\|otf"
161 Added: :publishing-directory ,(concat org-publish-location "mlnp.fr/resources/fonts/")
162 Added: :publishing-function org-publish-attachment)
163 Added:
164 Added: ;; Personal wiki.
165 Added: ("wiki.mlnp.fr"
166 Added: :components ("wiki-main-pages"
167 Added: "wiki-resources"
168 Added: "wiki-fonts"))
169 Added: ("wiki-main-pages"
170 Added: :base-directory "wiki/"
171 Added: :base-extension "org"
172 Added: :publishing-directory ,(concat org-publish-location "wiki.mlnp.fr/")
102 173 :recursive t
174 Added: :html-head "<link rel='stylesheet' type='text/css' href='http://wiki.mlnp.fr/resources/mlnp.css'>"
175 Added: :auto-sitemap t
176 Added: :sitemap-filename "index.org"
177 Added: :sitemap-title "Wiki"
103 178 :publishing-function org-html-publish-to-html)
104 Removed: ("styles"
179 Added: ("wiki-resources"
105 180 :base-directory "resources/"
106 Removed: :base-extension "css"
107 Removed: :publishing-directory ,(concat org-publish-location "resources/")
181 Added: :base-extension "css\\|js"
182 Added: :publishing-directory ,(concat org-publish-location "wiki.mlnp.fr/resources/")
108 183 :publishing-function org-publish-attachment)
109 Removed: ("images"
110 Removed: :base-directory "images/"
111 Removed: :base-extension "jpg\\|gif\\|png\\|svg"
112 Removed: :publishing-directory ,(concat org-publish-location "images/")
184 Added: ("wiki-fonts"
185 Added: :base-directory "resources/fonts/"
186 Added: :base-extension "ttf\\|otf"
187 Added: :publishing-directory ,(concat org-publish-location "wiki.mlnp.fr/resources/fonts/")
188 Added: :publishing-function org-publish-attachment)
189 Added:
190 Added: ;; Personal blog.
191 Added: ("blog.mlnp.fr"
192 Added: :components ("blog-main-pages"
193 Added: "blog-resources"
194 Added: "blog-fonts"))
195 Added: ("blog-main-pages"
196 Added: :base-directory "blog/"
197 Added: :base-extension "org"
198 Added: :publishing-directory ,(concat org-publish-location "blog.mlnp.fr/")
113 199 :recursive t
200 Added: :html-head "<link rel='stylesheet' type='text/css' href='http://blog.mlnp.fr/resources/mlnp.css'>"
201 Added: :auto-sitemap t
202 Added: :sitemap-filename "index.org"
203 Added: :sitemap-title "Blog"
204 Added: :sitemap-sort-files anti-chronologically
205 Added: :publishing-function org-html-publish-to-html)
206 Added: ("blog-resources"
207 Added: :base-directory "resources/"
208 Added: :base-extension "css\\|js"
209 Added: :publishing-directory ,(concat org-publish-location "blog.mlnp.fr/resources/")
114 210 :publishing-function org-publish-attachment)
115 Removed: ("content"
116 Removed: :components ("site"
117 Removed: "posts"))
211 Added: ("blog-fonts"
212 Added: :base-directory "resources/fonts/"
213 Added: :base-extension "ttf\\|otf"
214 Added: :publishing-directory ,(concat org-publish-location "blog.mlnp.fr/resources/fonts/")
215 Added: :publishing-function org-publish-attachment)
216 Added:
118 217 ("all"
119 Removed: :components ("content"
120 Removed: "styles"
121 Removed: "images"))))
218 Added: :components ("mlnp.fr"
219 Added: "wiki.mlnp.fr"
220 Added: "blog.mlnp.fr"))))
122 221 #+END_SRC
123 222
124 223
125 Removed: * Main publishing logic
224 Added: ** =mlnp.fr=
126 225
226 Added:
227 Added: ** =wiki.mlnp.fr=
228 Added:
229 Added:
230 Added: ** =blog.mlnp.fr=
231 Added:
232 Added:
233 Added: * TODO Main publishing logic
234 Added:
127 235 This is the main publishing logic. Execute the following source block
128 236 to build the entire website.
129 237
@@ -131,7 +239,6 @@
131 239 #+BEGIN_SRC elisp :noweb no-export
132 240 <<org-publish-location>>
133 241 <<org-publish-components>>
134 Removed: <<org-publish-html-preamble>>
135 242
136 243 <<org-publish-project-alist>>
137 244
@@ -141,6 +248,13 @@
141 248 (org-publish org-publish-components)
142 249 #+END_SRC
143 250
144 Removed: Open the website.
251 Added: #+RESULTS: main
145 252
146 Removed: [[file:~/tmp-mlnp.fr/index.html]]
253 Added: Link to the locally built homepages:
254 Added:
255 Added: - Main site :: [[file:/tmp/mlnp.fr/index.html]]
256 Added: - Wiki :: [[file:/tmp/wiki.mlnp.fr/index.html]]
257 Added: - Blog :: [[file:/tmp/blog.mlnp.fr/index.html]]
258 Added:
259 Added:
260 Added: * TODO Export resume to txt upon publishing