updated tech post index and orgmodessg

master
Barrington 2022-12-08 15:26:56 +01:00
parent 8ac4848bf1
commit 0d711c549d
Signed by: svragv
GPG Key ID: B39C0BCEE94A4A89
2 changed files with 18 additions and 6 deletions

View File

@ -27,3 +27,4 @@ These articles are sorted from oldest to newest.
5. [[./bsd_make.html][Using BSD make as build system]]
6. [[./modern_perl.html][Perl in CURRENT_YEAR]]
7. [[./raku.html][The Raku programming language]]

View File

@ -6,6 +6,7 @@
#+options: ^:{}
#+TITLE: suragu.net - Org-mode as a Static Site Generator
#+HTML_HEAD_EXTRA: <link rel="stylesheet" type="text/css" href="../css/styles.css"/>
* org-mode as a Static Site Generator
Created: 2022-06-14
Last updated: 2022-06-14
@ -20,10 +21,6 @@ this process.
And yes, this article was written in =org-mode=.
If you enjoy this article, please consider donating:
[[https://liberapay.com/raoul11][https://liberapay.com/raoul11]]. For questions or comments on this
article feel free to reach me out at teru-sama [at] riseup [dot] net.
** The basics
Every emacs users (I hope) knows about org-mode, it is a very powerful
@ -133,20 +130,34 @@ compile my website just well:
(setq org-publish-project-alist
'(("suragu.net"
:base-directory "~/repos/suragu_org/"
:publishing-directory "~/repos/suragu_org/out_html"
:publishing-directory "~/repos/suragu"
:section-numbers nil
:publishing-function org-html-publish-to-html
:table-of-contents nil
:recursive t
)))
(defun make-suragu ()
(defun sosa/make-suragu ()
(interactive)
(org-publish "suragu.net")
#+end_src
And that's it! Everytime I want to recompile this website I just have
to run =M-x make-suragu= and org-publish will do the rest for me!
** Automatically publishing your site with sshfs
sshfs is a filesystem client based on ssh and FUSE. This means remote
directories using sshfs. So you can mount your server's webroot in
your local machine, so publishing sites can be easy if you set the
=publishing-directory= in the =org-publish-project-alist= to the
remote mountpoint:
#+begin_src shell
sshfs root@192.168.1.57:/var/www/sites/suragu.net ~/repos/suragu
#+end_src
So when you run the function to publish your website
(=sosa/make-suragu= in this case). It will automatically publish to
the sshfs mounted directory. So your website will be updated.
** Conclusion
=org-mode= is a great markup language that can repleace markdown in most
tags and also works well as a static site generator. What else do you