ezup.dev

Source Code of Dash Eclipse's Personal Site (ezup.dev)
git clone git://ezup.dev/ezup.dev.git
Log | Files | Refs | README | LICENSE

commit 5c738cdf480f2649348d145698b8d768d430a7a1
parent a05ae4e7f6ea90011c5acb0e3e77b2a5e794a87d
Author: Dash Eclipse <dash@ezup.dev>
Date:   Fri,  3 Jul 2020 15:33:06 +0000

Update

Diffstat:
M.web/blog/index.html | 5++++-
M.web/blog/pgp.html | 15++++++++-------
M.web/blog/rss.xml | 8++++----
M.web/styles/site.css | 2+-
Alayouts/head.html | 6++++++
Mposts/index.org | 3++-
Mposts/rss.org | 4++--
Mpublish.el | 58++++++++++++++++++++++++++++++++++++++++++----------------
Mstyles/site.css | 2+-
9 files changed, 70 insertions(+), 33 deletions(-)

diff --git a/.web/blog/index.html b/.web/blog/index.html @@ -1,12 +1,14 @@ <!DOCTYPE html> <html lang="en"> <head> -<!-- 2020-07-03 Fri 02:24 --> +<!-- 2020-07-03 Fri 15:28 --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Blog Index</title> <meta name="generator" content="Org mode"> <meta name="author" content="Dash Eclipse"> +<meta name="description" content="Dash Eclipse' Personal Blog" +> <link rel='icon' type='image/x-icon' href='/favicon.svg'/> <meta name='viewport' content='width=device-width, initial-scale=1'> <link rel='stylesheet' href='/styles/topnav.css' type='text/css'/> @@ -29,6 +31,7 @@ <main id="content"> <header> <h1 class="title">Blog Index</h1> +<p class="subtitle">Published on 2020-07-03 by Dash Eclipse.</p> </header><ul class="org-ul"> <li><p> <a href="pgp.html">OpenPGP Key Generation and Usage</a> diff --git a/.web/blog/pgp.html b/.web/blog/pgp.html @@ -1,7 +1,7 @@ <!DOCTYPE html> <html lang="en"> <head> -<!-- 2020-07-03 Fri 02:24 --> +<!-- 2020-07-03 Fri 15:28 --> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>OpenPGP Key Generation and Usage</title> @@ -30,12 +30,13 @@ <main id="content"> <header> <h1 class="title">OpenPGP Key Generation and Usage</h1> +<p class="subtitle">Published on 2020-06-30 by Dash Eclipse.</p> </header><p> In this article I'm gonna explain how do I generate OpenPGP keys and use PGP. </p> -<section id="outline-container-org3e3bb72" class="outline-2"> -<h2 id="org3e3bb72"><span class="section-number-2">1</span> Install GnuPG</h2> +<section id="outline-container-orgabbcd0c" class="outline-2"> +<h2 id="orgabbcd0c"><span class="section-number-2">1</span> Install GnuPG</h2> <div class="outline-text-2" id="text-1"> <p> On macOS you can use brew to install GnuPG <code>brew install gnupg</code> @@ -43,8 +44,8 @@ On macOS you can use brew to install GnuPG <code>brew install gnupg</code> </div> </section> -<section id="outline-container-orgba3e6b3" class="outline-2"> -<h2 id="orgba3e6b3"><span class="section-number-2">2</span> OpenPGP key generation</h2> +<section id="outline-container-org46aaefe" class="outline-2"> +<h2 id="org46aaefe"><span class="section-number-2">2</span> OpenPGP key generation</h2> <div class="outline-text-2" id="text-2"> <p> Beside <code>gpg --full-generate-key</code>, you can also create a key with gpg in batch mode<sup><a id="fnr.1" class="footref" href="#fn.1">1</a></sup>. @@ -81,8 +82,8 @@ gpg --batch --generate-key first-last.txt </div> </section> -<section id="outline-container-orge25b3b0" class="outline-2"> -<h2 id="orge25b3b0"><span class="section-number-2">3</span> Use subkeys</h2> +<section id="outline-container-org0736801" class="outline-2"> +<h2 id="org0736801"><span class="section-number-2">3</span> Use subkeys</h2> <div class="outline-text-2" id="text-3"> <p> I use encryption and signing subkeys instead of just use one key for everything, because it's safer when you keep your master key elsewhere and use different keys for different purposes. Debian also recommend to use subkeys.<sup><a id="fnr.2" class="footref" href="#fn.2">2</a></sup> diff --git a/.web/blog/rss.xml b/.web/blog/rss.xml @@ -9,18 +9,18 @@ xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"><channel> - <title>Dash Eclipse's Personal Site | ezup.dev</title> + <title>Dash Eclipse's Blog | ezup.dev</title> <atom:link href="https://ezup.dev/blog/rss.xml" rel="self" type="application/rss+xml" /> <link>https://ezup.dev/blog/</link> <description><![CDATA[]]></description> <language>en</language> - <pubDate>Fri, 03 Jul 2020 02:24:44 +0000</pubDate> - <lastBuildDate>Fri, 03 Jul 2020 02:24:44 +0000</lastBuildDate> + <pubDate>Fri, 03 Jul 2020 15:28:53 +0000</pubDate> + <lastBuildDate>Fri, 03 Jul 2020 15:28:53 +0000</lastBuildDate> <generator>Emacs 26.3 Org-mode 9.3.7</generator> <webMaster>dash@ezup.dev (Dash Eclipse)</webMaster> <image> <url>https://orgmode.org/img/org-mode-unicorn-logo.png</url> - <title>Dash Eclipse's Personal Site | ezup.dev</title> + <title>Dash Eclipse's Blog | ezup.dev</title> <link>https://ezup.dev/blog/</link> </image> diff --git a/.web/styles/site.css b/.web/styles/site.css @@ -108,7 +108,7 @@ body pre { background: white; } body pre.src { - overflow-y: auto !important; +/* overflow-y: auto !important; */ font-size: 16px; } body code { diff --git a/layouts/head.html b/layouts/head.html @@ -0,0 +1,6 @@ +<link rel='icon' type='image/x-icon' href='/favicon.svg'/> +<meta name='viewport' content='width=device-width, initial-scale=1'> +<link rel='stylesheet' href='/styles/topnav.css' type='text/css'/> +<link rel='stylesheet' href='/styles/site.css' type='text/css'/> +<link rel='stylesheet' href='/styles/syntax-coloring.css' type='text/css'/> +<link rel='alternate' type='application/rss+xml' title='RSS' href='/blog/rss.xml'> diff --git a/posts/index.org b/posts/index.org @@ -1,4 +1,5 @@ #+TITLE: Blog Index - +#+META_TYPE: website +#+DESCRIPTION: Dash Eclipse' Personal Blog - [[file:pgp.org][OpenPGP Key Generation and Usage]] #+html: <p class='pubdate'>by Dash Eclipse on Jun 30, 2020.</p> \ No newline at end of file diff --git a/posts/rss.org b/posts/rss.org @@ -1,8 +1,8 @@ -#+TITLE: Dash Eclipse's Personal Site | ezup.dev +#+TITLE: Dash Eclipse's Blog | ezup.dev * OpenPGP Key Generation and Usage :PROPERTIES: :RSS_PERMALINK: pgp.html :PUBDATE: 2020-06-30 -:ID: 5BB9F81C-3369-40B9-83E2-79FE675A2E1F +:ID: 7F047210-D0F1-43B3-8745-96952CD89494 :END: diff --git a/publish.el b/publish.el @@ -14,12 +14,9 @@ (require 'ox-publish) (require 'ox-rss) -(defvar ezup-url "https://ezup.dev/blog/" - "The URL where this site will be published") - -(defvar ezup-title "Dash Eclipse's Personal Site | ezup.dev" - "The title of this site.") +(defvar ezup-url "https://ezup.dev/blog/") +(defvar ezup-title "Dash Eclipse's Blog | ezup.dev") (setq org-html-postamble nil) ;;org-export-with-author nil) @@ -28,7 +25,7 @@ (setq org-html-divs '((preamble "header" "top") (content "main" "content")) org-html-container-element "section" - ;;org-html-metadata-timestamp-format psachin-date-format + org-html-metadata-timestamp-format "%Y-%m-%d" org-html-checkbox-type 'html org-html-html5-fancy t org-html-validation-link t @@ -50,6 +47,39 @@ (insert-file-contents (expand-file-name (format "%s.html" type) "layouts")) (buffer-string))))) +;; org-html-publish-to-html +;; https://code.orgmode.org/bzg/org-mode/src/release_9.3.7/lisp/ox-html.el#L3868-L3880 +(defun ezup/org-html-publish-to-html (plist filename pub-dir) + "Wrapper function to publish an file to html. + +PLIST contains the properties, FILENAME the source file and + PUB-DIR the output directory." + (let ((project (cons 'ezup plist))) + (plist-put plist :subtitle + (format "Published on %s by %s." + (format-time-string "%Y-%m-%d" (org-publish-find-date filename project)) + (plist-get plist :author))) + (org-html-publish-to-html plist filename pub-dir))) + + +;; org-publish-sitemap-default +;; https://code.orgmode.org/bzg/org-mode/src/release_9.3.7/lisp/ox-publish.el#L911-L917 +(defun ezup/org-publish-sitemap (title list) + "Generate sitemap as a string, having TITLE. +LIST is an internal representation for the files to include, as +returned by `org-list-to-lisp'." + ;;(let ((filtered-list (cl-remove-if (lambda (x) + ;;(and (sequencep x) (null (car x)))) + ;;list))) + (concat "#+TITLE: " title "\n" + ;"#+OPTIONS: title:nil\n" + "#+META_TYPE: website\n" + "#+DESCRIPTION: Dash Eclipse' Personal Blog\n" + ;;"\n#+ATTR_HTML: :class sitemap\n" + ; TODO use org-list-to-subtree instead + (org-list-to-org list))) + + ;; org-publish-sitemap-default-entry ;; https://code.orgmode.org/bzg/org-mode/src/release_9.3.7/lisp/ox-publish.el#L898-L909 (defun ezup/org-publish-sitemap-entry (entry style project) @@ -114,29 +144,29 @@ PROJECT is the current project." :base-directory "posts" :recursive t ;;:section-numbers nil - :with-toc nil + :with-toc nil :base-extension "org" :exclude "rss.org\\|index.org" - :publishing-function org-html-publish-to-html + ;:exclude ,(regexp-opt '("rss.org" "index.org")) + :publishing-function ezup/org-html-publish-to-html :publishing-directory ".web/blog" :auto-sitemap t :sitemap-filename "index.org" :sitemap-title "Blog Index" :sitemap-style list :sitemap-sort-files anti-chronologically - :sitemap-function org-publish-sitemap-default + :sitemap-function ezup/org-publish-sitemap :sitemap-format-entry ezup/org-publish-sitemap-entry :author "Dash Eclipse" :html-head-include-scripts nil :html-head-include-default-style nil :html-head ,ezup-html-head :html-preamble-format ,(ezup/prepostamble-format "preamble")) - ("rss" :base-directory "posts" :base-extension "org" :recursive nil - ;;:exclude (regexp-opt ("rss.org" "index.org")) + ;:exclude ,(regexp-opt '("rss.org" "index.org")) :exclude "rss.org\\|index.org" :publishing-directory ".web/blog" :org-rss-use-entry-url-as-guid t @@ -158,31 +188,26 @@ PROJECT is the current project." :with-author t :author "Dash Eclipse" :email "dash@ezup.dev") - ("images" :base-directory "images" :base-extension "svg\\|jpg\\|png" :publishing-directory ".web/images" :publishing-function org-publish-attachment) - ("favicon" :base-directory "." :base-extension "svg" :publishing-directory ".web" :publishing-function org-publish-attachment) - ("css" :base-directory "styles" :base-extension "css" :publishing-directory ".web/styles" :publishing-function org-publish-attachment) - ("fonts" :base-directory "fonts" :base-extension "woff2" :publishing-directory ".web/fonts" :publishing-function org-publish-attachment) - ("html" :base-directory "." :base-extension "html" @@ -191,3 +216,4 @@ PROJECT is the current project." ("website" :components ("posts" "rss" "images" "css" "fonts" "html")))) (provide 'publish) + diff --git a/styles/site.css b/styles/site.css @@ -108,7 +108,7 @@ body pre { background: white; } body pre.src { - overflow-y: auto !important; +/* overflow-y: auto !important; */ font-size: 16px; } body code {