summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore8
-rw-r--r--index.org45
-rw-r--r--publish-mlnp.org208
3 files changed, 188 insertions, 73 deletions
diff --git a/.gitignore b/.gitignore
index 80d20f5..d6524c7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,8 @@
# .gitignore for mlnp.fr
-# All HTML and CSS should be generated from Org files, NO EXCEPTIONS.
-*.html
+# All CSS should be generated from Org files, NO EXCEPTIONS. This ensures all artifacts are documented.
*.css
-# Topnav items are generated upon export by the Org publish sitemap.
-resources/topnav-items.org \ No newline at end of file
+# Font files are not version-controlled.
+*.ttf
+*.otf \ No newline at end of file
diff --git a/index.org b/index.org
index 580b88d..d629487 100644
--- a/index.org
+++ b/index.org
@@ -1,38 +1,39 @@
# -*- mode: org; -*-
-#+TITLE: Home
-#+SUBTITLE: A personal blog written in [[https://orgmode.org/][Org mode]].
+#+TITLE: mlnp.fr
+#+SUBTITLE: A personal website created with [[https://orgmode.org/][Org mode]].
#+AUTHOR: Marius Peter
-#+DATE: <2022-01-23 Sun> Updated <2022-01-31 Mon>
+#+DATE: <2022-01-23 Sun>
#+EMAIL: mlnp@tuta.io
#+OPTIONS: num:nil toc:nil
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="resources/mlnp.css" />
-#+INCLUDE: resources/topnav.org
+#+INCLUDE: resources/topnav.html export html
-* Recent posts
+# #+begin_abstract
+# This website contains two main components: blog posts and wiki
+# pages. Blog posts relate to one-off topics of interest, whilst wiki
+# pages serve as my personal and professional [[https://en.wikipedia.org/wiki/Knowledge_management][Knowledge Management]]
+# resources.
+# #+end_abstract
-- This is a list
-- Foobar
-- Third item
+* TODO Latest blog posts
-* Projects
+# Implement (jQuery?) links to last 3 blog posts.
+
+All blog posts available [[file:blog/index.org][here]].
+
+#+BEGIN_SRC
+#+END_SRC
+
+
+* Latest wiki pages
+
+All wiki pages available [[file:wiki/index.org][here]].
* Publishing this website
-This entire website is built with [[https://orgmode.org/][Org mode]], an Emacs mode designed for
-literate programming among other things. Using Org mode for designing,
-building and publishing a website brings the following benefits:
-
-- Work within Emacs :: This advantage concerns existing Emacs users.
-- Literate programming :: Org files contain a mix of plain text
- associated with documentation, and code that can be executed. A
- documentation-centered workflow encourages us to describe our
- thought process as we write a program, this increases the likelihood
- of remembering why a particular piece of code was written.
-
-The entire website publication flow is described here:
-[[file:publish-mlnp.org]].
+Learn how I build this entire website on the [[file:publish-mlnp.org][publish]] page.
diff --git a/publish-mlnp.org b/publish-mlnp.org
index 2ea510b..6c2dc1f 100644
--- a/publish-mlnp.org
+++ b/publish-mlnp.org
@@ -1,52 +1,69 @@
# -*- mode: org; -*-
#+TITLE: Publish
-#+SUBTITLE: Publishing this very website.
+#+SUBTITLE: Guide to publishing this very website.
#+AUTHOR: Marius Peter
#+DATE: <2022-01-26 Wed>
#+OPTIONS: toc:nil
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="resources/mlnp.css" />
-#+INCLUDE: resources/topnav.org
-#+TOC: headlines 3
+#+INCLUDE: resources/topnav.html export html
#+begin_abstract
In the spirit of [[https://en.wikipedia.org/wiki/Literate_programming][literate programming]] encouraged by Org mode, this
-entire website's build process is documented on this very page. When
-Emacs builds this website, it parses and executes the code blocks
+entire website's build process is documented on this very page. In
+order to build this website, Emacs parses and executes the code blocks
contained on this page. By mixing behavior with the behavior's
documentation, we can future-proof our understanding of the build
-logic, making it possible to efficiently revisit this website at a
-later date in order to bring improvements.
+logic, making it possible to efficiently revisit and upgrade this
+website at a later date.
#+end_abstract
+#+TOC: headlines 3
+
+
+* Introduction
+
+This entire website is built with [[https://orgmode.org/][Org mode]], an Emacs mode designed for
+literate programming among other things. Using Org mode for designing,
+building and publishing a website brings the following benefits:
+
+- Work within Emacs :: This advantage concerns existing Emacs users.
+- Literate programming :: Org files contain a mix of plain text
+ associated with documentation, and code that can be executed. A
+ documentation-centered workflow encourages us to describe our
+ thought process as we write a program, this increases the likelihood
+ of remembering why a particular piece of code was written.
+
* Publishing targets
This first section lays out the interactive prompts used to bind
export-related symbols with the following publishing targets:
-- location :: Where should the website be published?
-- components :: What parts of the website should be built?
+- Location :: Where should the website be published?
+- Components :: What parts of the website should be built?
** Location
Two possible publishing locations are considered:
-- Local :: The website would be built on the local machine.
-- Remote :: The website would be built on a remote server, after
- uploading the selected files via ssh.
+- Local :: The website is built on the local machine. This is useful
+ for website development.
+- Remote :: The website is built on the specified remote server. This
+ is used to publish the website on the internet, it then becomes
+ visible at [[http://mlnp.fr/][mlnp.fr]].
#+NAME: org-publish-location
#+BEGIN_SRC elisp
(setq org-publish-location
(read-answer
"Should the website be built on the local or remote target? "
- '(("~/tmp-mlnp.fr/"
+ '(("/tmp/"
?l "build website on the local machine")
- ("/ssh:root@192.162.71.223:/var/www/html/mlnp.fr/"
+ ("/ssh:root@192.162.71.223:/var/www/"
?r "build website on the remote machine"))))
#+END_SRC
@@ -65,64 +82,155 @@ Two possible publishing locations are considered:
#+end_src
-
* Resources
-This section explores the =.css= and (maybe later) =.js= resources
-available on the website.
-
** CSS
-The main CSS file is located at [[file:resources/css.org]].
+The website styling information is described on the [[file:resources/css.org][CSS]] page.
+
+
+** JS
+
+The goal of this website is to /not/ have to rely on JavaScript.
+
+
+* COMMENT HTML preamble
+
+#+NAME: org-publish-html-preamble
+#+BEGIN_SRC emacs-lisp
+ (setq org-publish-html-preamble nil)
+ ;; (setq org-publish-html-preamble
+ ;; (concat
+ ;; "<nav id='topnav'>
+ ;; <a href='index.html' id='home'><code>home</code></a>
+ ;; <label for='hamburger'>&#9776;</label>
+ ;; <input type='checkbox' id='hamburger'/>"
+ ;; (progn
+ ;; (save-window-excursion
+ ;; (find-file "resources/topnav-items.org")
+ ;; (org-html-export-to-html nil nil nil t nil))
+ ;; (org-file-contents "resources/topnav-items.html"))
+ ;; "</nav>"))
+#+END_SRC
* Project components
The ~org-publish-project-alist~ variable is used by ~org-publish~ to
-identify website components and their properties upon export.
+identify website components and their properties upon export. It
+enables us to target different directories when publishing; I can
+write this website in a single, version-controlled directory, whilst
+maintaining separate export directories for =wiki.mlnp.fr= and
+=blog.mlnp.fr=.
+
+Both the wiki and the blog call for css and font resources hosted on
+=mlnp.fr=, so these resources need only be exported once---to the
+=mlnp.fr/resources/= folder.
#+NAME: org-publish-project-alist
#+BEGIN_SRC elisp
(require 'ox-publish)
(setq org-publish-project-alist
- `(("site"
+ `(
+ ;; Main site.
+ ("mlnp.fr"
+ :components ("mlnp-main-pages"
+ "mlnp-resources"
+ "resources-pages" ; Only hosted on the main website.
+ "mlnp-fonts"))
+ ("mlnp-main-pages"
:base-directory "./"
:base-extension "org"
- :publishing-directory ,org-publish-location
- :recursive nil ; Top-level pages are all in top-level org directory.
- :publishing-function org-html-publish-to-html
- :auto-sitemap t
- :sitemap-filename "resources/topnav-items.org"
- :sitemap-title "Top-level site links")
- ("posts"
- :base-directory "posts/"
+ :publishing-directory ,(concat org-publish-location "mlnp.fr/")
+ :recursive nil ; Main site pages are all in top-level org directory.
+ :publishing-function org-html-publish-to-html)
+ ("mlnp-resources"
+ :base-directory "resources/"
+ :base-extension "css\\|js"
+ :publishing-directory ,(concat org-publish-location "mlnp.fr/resources/")
+ :publishing-function org-publish-attachment)
+ ("resources-pages"
+ :base-directory "resources/"
:base-extension "org"
- :publishing-directory ,(concat org-publish-location "posts/")
+ :publishing-directory ,(concat org-publish-location "mlnp.fr/resources/")
+ :publishing-function org-html-publish-to-html)
+ ("mlnp-fonts"
+ :base-directory "resources/fonts/"
+ :base-extension "ttf\\|otf"
+ :publishing-directory ,(concat org-publish-location "mlnp.fr/resources/fonts/")
+ :publishing-function org-publish-attachment)
+
+ ;; Personal wiki.
+ ("wiki.mlnp.fr"
+ :components ("wiki-main-pages"
+ "wiki-resources"
+ "wiki-fonts"))
+ ("wiki-main-pages"
+ :base-directory "wiki/"
+ :base-extension "org"
+ :publishing-directory ,(concat org-publish-location "wiki.mlnp.fr/")
:recursive t
+ :html-head "<link rel='stylesheet' type='text/css' href='http://wiki.mlnp.fr/resources/mlnp.css'>"
+ :auto-sitemap t
+ :sitemap-filename "index.org"
+ :sitemap-title "Wiki"
:publishing-function org-html-publish-to-html)
- ("styles"
+ ("wiki-resources"
:base-directory "resources/"
- :base-extension "css"
- :publishing-directory ,(concat org-publish-location "resources/")
+ :base-extension "css\\|js"
+ :publishing-directory ,(concat org-publish-location "wiki.mlnp.fr/resources/")
+ :publishing-function org-publish-attachment)
+ ("wiki-fonts"
+ :base-directory "resources/fonts/"
+ :base-extension "ttf\\|otf"
+ :publishing-directory ,(concat org-publish-location "wiki.mlnp.fr/resources/fonts/")
:publishing-function org-publish-attachment)
- ("images"
- :base-directory "images/"
- :base-extension "jpg\\|gif\\|png\\|svg"
- :publishing-directory ,(concat org-publish-location "images/")
+
+ ;; Personal blog.
+ ("blog.mlnp.fr"
+ :components ("blog-main-pages"
+ "blog-resources"
+ "blog-fonts"))
+ ("blog-main-pages"
+ :base-directory "blog/"
+ :base-extension "org"
+ :publishing-directory ,(concat org-publish-location "blog.mlnp.fr/")
:recursive t
+ :html-head "<link rel='stylesheet' type='text/css' href='http://blog.mlnp.fr/resources/mlnp.css'>"
+ :auto-sitemap t
+ :sitemap-filename "index.org"
+ :sitemap-title "Blog"
+ :sitemap-sort-files anti-chronologically
+ :publishing-function org-html-publish-to-html)
+ ("blog-resources"
+ :base-directory "resources/"
+ :base-extension "css\\|js"
+ :publishing-directory ,(concat org-publish-location "blog.mlnp.fr/resources/")
:publishing-function org-publish-attachment)
- ("content"
- :components ("site"
- "posts"))
+ ("blog-fonts"
+ :base-directory "resources/fonts/"
+ :base-extension "ttf\\|otf"
+ :publishing-directory ,(concat org-publish-location "blog.mlnp.fr/resources/fonts/")
+ :publishing-function org-publish-attachment)
+
("all"
- :components ("content"
- "styles"
- "images"))))
+ :components ("mlnp.fr"
+ "wiki.mlnp.fr"
+ "blog.mlnp.fr"))))
#+END_SRC
-* Main publishing logic
+** =mlnp.fr=
+
+
+** =wiki.mlnp.fr=
+
+
+** =blog.mlnp.fr=
+
+
+* TODO Main publishing logic
This is the main publishing logic. Execute the following source block
to build the entire website.
@@ -131,7 +239,6 @@ to build the entire website.
#+BEGIN_SRC elisp :noweb no-export
<<org-publish-location>>
<<org-publish-components>>
- <<org-publish-html-preamble>>
<<org-publish-project-alist>>
@@ -141,6 +248,13 @@ to build the entire website.
(org-publish org-publish-components)
#+END_SRC
-Open the website.
+#+RESULTS: main
+
+Link to the locally built homepages:
+
+- Main site :: [[file:/tmp/mlnp.fr/index.html]]
+- Wiki :: [[file:/tmp/wiki.mlnp.fr/index.html]]
+- Blog :: [[file:/tmp/blog.mlnp.fr/index.html]]
+
-[[file:~/tmp-mlnp.fr/index.html]]
+* TODO Export resume to txt upon publishing
Copyright 2019--2026 Marius PETER