site

Website's source files.
Log | Files | Refs | LICENSE

commit a2d77ad50ab52c6cbd101ed85474555f4b9f0d0f
parent 755c5cc14854fb349ddda02c6b29ca061acec4b3
Author: Ryan Jeffrey <ryan@ryanmj.xyz>
Date:   Sat, 13 Feb 2021 00:14:30 -0800

1.0 - Site is now usable.

Diffstat:
Mindex.org | 4++--
Dposts/views/postamble.html | 24------------------------
Dposts/views/preamble.html | 34----------------------------------
Mpublish.el | 39+++++++++++++++++++++++++--------------
Dviews/postamble.html | 24------------------------
Dviews/preamble.html | 34----------------------------------
6 files changed, 27 insertions(+), 132 deletions(-)

diff --git a/index.org b/index.org @@ -3,8 +3,8 @@ #+options: d:(not "LOGBOOK") date:t e:t email:nil f:t inline:t num:t #+options: p:nil pri:nil prop:nil stat:t tags:t tasks:t tex:t #+options: timestamp:t title:nil toc:t todo:t |:t -#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../css/terminal.css" /> -#+HTML_HEAD: <script src="../scripts/main.js"></script> +#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="css/terminal.css" /> +#+HTML_HEAD: <script src="scripts/main.js"></script> #+language: en #+select_tags: export #+exclude_tags: noexport diff --git a/posts/views/postamble.html b/posts/views/postamble.html @@ -1,24 +0,0 @@ - </div> -</div> -<div class="fttr"> - <a href="https://www.gnu.org/software/emacs/"> - <img alt="POWERED BY EMACS" src="res/stickies/emacs.png" /> - </a> - <a href="https://www.gnu.org/licenses/gpl-3.0.en.html"> - <img alt="GPLv3" src="res/stickies/gplv3.png" /> - </a> - <a href="https://www.sxemacs.org/"> - <img alt="POWERED BY SXEMACS" src="res/stickies/sxe.png" /> - </a> - <a href="https://www.xemacs.org/"> - <img alt="POWERED BY XEMACS" src="res/stickies/xe.png" /> - </a> - - <a href='https://ipv6-test.com/validate.php?url=referer'> - <img src='res/stickies/button-ipv6-big.png' alt='ipv6 ready' title='ipv6 ready'> - </a> - - <a href="https://jigsaw.w3.org/css-validator/check/referer"> - <img src="res/stickies/vcss.gif" alt="Valid CSS!"> - </a> -</div> diff --git a/posts/views/preamble.html b/posts/views/preamble.html @@ -1,34 +0,0 @@ -<div id="task-meta" class="topl"> - <h4 style="margin-left:1em; margin-top:0.5em;">Links</h4> - <hr> - - <div id="taskbar"> - <div id="home"> - <a href="index.html"><img src="res/user-home.png" alt="Homepage" class="taskimg"></a> - <h4>Home</h4> - </div> - - <div id="blog"> - <a href="blog.html"><img src="res/folder-documents.png" alt="Blog" class="taskimg"></a> - <h4>Blog</h4> - </div> - - <div id="files"> - <a href="files/"><img src="res/ktorrent.png" alt="Files" class="taskimg"></a> - <h4>Files</h4> - </div> - - <div id="git-server"> - <a href="git.ryanmj.xyz"><img src="res/folder-git.png" alt="git" class="taskimg"></a> - <h4>Git Server</h4> - </div> - - <div id="contact-me"> - <a href="mailto:ryan@ryanmj.xyz"><img alt="Email me" src="res/kopete.png"/></a> - <h4>Contact Me</h4> - </div> - </div> -</div> - -<div class="twin topl"> - <div style="tcontent"> diff --git a/publish.el b/publish.el @@ -37,26 +37,32 @@ (require 'ox-publish) (require 'ox-html) - - (setq site-dir (concat (getenv "HOME") "/src/site")) (setq export-site "/ssh:root@ryanmj.xyz:/var/www/underground/") (defun create-preamble (plist) "Insert preamble, PLIST is list of options." - (with-temp-buffer - (insert-file-contents "views/preamble.html") (buffer-string))) + (let* ((file-name (file-name-nondirectory (plist-get plist :output-file)))) + (cond + ((string= file-name "index.html") + (with-temp-buffer + (insert-file-contents "views/preamble-i.html") (buffer-string))) + (t (insert-file-contents "views/preamble-e.html"))))) (defun create-postamble (plist) "Insert postamble, PLIST is list of options." - (with-temp-buffer - (insert-file-contents "views/postamble.html") (buffer-string))) + (let* ((file-name (file-name-nondirectory (plist-get plist :output-file)))) + (cond + ((string= file-name "index.html") + (with-temp-buffer + (insert-file-contents "views/postamble-i.html") (buffer-string))) + (t (insert-file-contents "views/postamble-e.html"))))) ;; Replace __PROMPT__ with the actual prompt (add-hook 'org-export-before-parsing-hook #'(lambda (backend) (goto-char (point-min)) (while (search-forward "__PROMPT__" (point-max) t) - (kill-line) + (kill-backward-chars (length "__PROMPT__")) (insert "@@html:<span style='color: var(--bisque4)'>ryan</span><span style='color:blue'>@</span><span style='color:yellow'>themainframe</span><span style='font-weight:bold'></span>@@")))) @@ -103,11 +109,13 @@ Assumes that all files in FILES exist." (defun create-blogmap-entry (entry _style project) "Create an entry for the blogmap. One string for each ENTRY in PROJECT." - (format "@@html:<span class=\"archive-item\"><span class=\"archive-date\">@@ %s @@html:</span>@@ [[file:%s][%s]] @@html:</span>@@" - (format-time-string "%h %d, %Y" - (org-publish-find-date entry project)) - entry - (org-publish-find-title entry project))) + (format "@@html:<p>-rw-r--r-- 1 ryan ryan @@ %4s [[file:%s][%s]] @@html:</p>@@" + (shell-command-to-string (format "wc -c < %s | numfmt --to=si | tr -d '\n'" (org-publish--expand-file-name entry project))) + ;(format-time-string "%h %d, %Y" + ; (org-publish-find-date entry project)) + entry + (org-publish-find-title entry project) + )) (defun create-blogmap (title list) "Create the sitemap for the posts/ directory. @@ -140,11 +148,14 @@ Return sitemap using TITLE and LIST returned by `create-blogmap-entry'." :recursive t :publishing-function org-html-publish-to-html + :html-preamble create-preamble + :html-postamble create-postamble + ;; Sitemap. :auto-sitemap t - :sitemap-filename "blog.org" - :sitemap-title "Blog" + :sitemap-filename "sitemap.org" + :sitemap-title "Blog Map" :sitemap-style list :sitemap-sort-files anti-chronologically :sitemap-format-entry create-blogmap-entry diff --git a/views/postamble.html b/views/postamble.html @@ -1,24 +0,0 @@ - </div> -</div> -<div class="fttr"> - <a href="https://www.gnu.org/software/emacs/"> - <img alt="POWERED BY EMACS" src="res/stickies/emacs.png" /> - </a> - <a href="https://www.gnu.org/licenses/gpl-3.0.en.html"> - <img alt="GPLv3" src="res/stickies/gplv3.png" /> - </a> - <a href="https://www.sxemacs.org/"> - <img alt="POWERED BY SXEMACS" src="res/stickies/sxe.png" /> - </a> - <a href="https://www.xemacs.org/"> - <img alt="POWERED BY XEMACS" src="res/stickies/xe.png" /> - </a> - - <a href='https://ipv6-test.com/validate.php?url=referer'> - <img src='res/stickies/button-ipv6-big.png' alt='ipv6 ready' title='ipv6 ready'> - </a> - - <a href="https://jigsaw.w3.org/css-validator/check/referer"> - <img src="res/stickies/vcss.gif" alt="Valid CSS!"> - </a> -</div> diff --git a/views/preamble.html b/views/preamble.html @@ -1,34 +0,0 @@ -<div id="task-meta" class="topl"> - <h4 style="margin-left:1em; margin-top:0.5em;">Links</h4> - <hr> - - <div id="taskbar"> - <div id="home"> - <a href="index.html"><img src="res/user-home.png" alt="Homepage" class="taskimg"></a> - <h4>Home</h4> - </div> - - <div id="blog"> - <a href="blog.html"><img src="res/folder-documents.png" alt="Blog" class="taskimg"></a> - <h4>Blog</h4> - </div> - - <div id="files"> - <a href="files/"><img src="res/ktorrent.png" alt="Files" class="taskimg"></a> - <h4>Files</h4> - </div> - - <div id="git-server"> - <a href="git.ryanmj.xyz"><img src="res/folder-git.png" alt="git" class="taskimg"></a> - <h4>Git Server</h4> - </div> - - <div id="contact-me"> - <a href="mailto:ryan@ryanmj.xyz"><img alt="Email me" src="res/kopete.png"/></a> - <h4>Contact Me</h4> - </div> - </div> -</div> - -<div class="twin topl"> - <div style="tcontent">