Updated the style, details of footer.
This commit is contained in:
parent
f2b5d8dbd1
commit
5850dec67f
4 changed files with 42 additions and 22 deletions
|
@ -1,6 +1,7 @@
|
||||||
#+TITLE: Blog Posts
|
#+TITLE: Blog Posts
|
||||||
|
#+AUTHOR: Yann Esposito
|
||||||
|
#+EMAIL: yann.esposito@gmail.com
|
||||||
|
|
||||||
#+begin_archive
|
#+begin_archive
|
||||||
@@html:<li>@@ @@html:<span class="archive-item"><span class="archive-date">@@ Jul 05, 2019 @@html:</span>@@ [[file:posts/2019-07-04-org-publish.org][org-publish]] @@html:</span>@@ @@html:</li>@@
|
@@html:<li>@@ @@html:<span class="archive-item"><span class="archive-date">@@ 2019-07-05: @@html:</span>@@ [[file:posts/2019-07-04-org-publish.org][org-publish]] @@html:</span>@@ @@html:</li>@@
|
||||||
#+end_archive
|
#+end_archive
|
||||||
|
|
|
@ -46,7 +46,7 @@ hr {
|
||||||
}
|
}
|
||||||
hr:after {
|
hr:after {
|
||||||
content: "----------------------------------------------------------------------------------------------------";
|
content: "----------------------------------------------------------------------------------------------------";
|
||||||
font-family: monospace;
|
font-family: "courrier new", monospace;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
opacity: 0.3;
|
opacity: 0.3;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
@ -123,3 +123,10 @@ img { max-width: 100%;
|
||||||
margin: 20px auto; }
|
margin: 20px auto; }
|
||||||
footer { font-size: 0.8em; opacity: 0.5; }
|
footer { font-size: 0.8em; opacity: 0.5; }
|
||||||
footer:hover { opacity: 1; }
|
footer:hover { opacity: 1; }
|
||||||
|
navigation { font-weight: bold;
|
||||||
|
font-family: "courrier new", monospace;
|
||||||
|
}
|
||||||
|
navigation a { display: inline-block;
|
||||||
|
padding: .5ex 1ex;
|
||||||
|
margin-right: 1em;
|
||||||
|
}
|
||||||
|
|
|
@ -23,23 +23,26 @@
|
||||||
(buffer (find-file-noselect (expand-file-name "index.org" base-directory) t)))
|
(buffer (find-file-noselect (expand-file-name "index.org" base-directory) t)))
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(set-buffer-modified-p t)
|
(set-buffer-modified-p t)
|
||||||
(save-buffer 0))
|
(save-buffer 0))))
|
||||||
(kill-buffer buffer)))
|
|
||||||
|
|
||||||
(defvar org-blog-head
|
(defvar org-blog-head
|
||||||
"<link rel=\"stylesheet\" type=\"text/css\" href=\"/assets/css/minimalist.css\"/>
|
(concat
|
||||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">
|
"<link rel=\"stylesheet\" type=\"text/css\" href=\"/assets/css/minimalist.css\"/>"
|
||||||
<link rel=\"alternative\" type=\"application/rss+xml\" title=\"Subscribe to articles\" href=\"/archives.xml\" />
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">"
|
||||||
<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\">")
|
"<link rel=\"alternative\" type=\"application/rss+xml\" title=\"Subscribe to articles\" href=\"/archives.xml\" />"
|
||||||
|
"<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\">"))
|
||||||
|
|
||||||
(defun org-blog-preamble (_plist)
|
(defun org-blog-preamble (_plist)
|
||||||
"Pre-amble for whole blog."
|
"Pre-amble for whole blog."
|
||||||
"<strong><code>Programing Heresy</code></strong>")
|
"<strong><code>Her.esy.fun</code></strong>")
|
||||||
|
|
||||||
(defun menu ()
|
(defun menu ()
|
||||||
"Blog menu"
|
"Blog menu"
|
||||||
"<a href=\"/\">Home</a> -
|
(concat
|
||||||
<a href=\"/archive.html\">Posts</a>")
|
"<navigation>"
|
||||||
|
"<a href=\"/\">Home</a>"
|
||||||
|
"<a href=\"/archive.html\">Posts</a>"
|
||||||
|
"</navigation>"))
|
||||||
|
|
||||||
(defun get-from-info (info k)
|
(defun get-from-info (info k)
|
||||||
(let ((i (car (plist-get info k))))
|
(let ((i (car (plist-get info k))))
|
||||||
|
@ -49,35 +52,39 @@
|
||||||
(defun org-blog-postamble (info)
|
(defun org-blog-postamble (info)
|
||||||
"Post-amble for whole blog."
|
"Post-amble for whole blog."
|
||||||
(concat "<footer>"
|
(concat "<footer>"
|
||||||
(menu)
|
|
||||||
"<hr/>"
|
|
||||||
(when-let ((author (get-from-info info :author)))
|
(when-let ((author (get-from-info info :author)))
|
||||||
(if-let ((email (plist-get info :email)))
|
(if-let ((email (plist-get info :email)))
|
||||||
(format "<p class=\"author\">Author: <a href=\"mailto:%s\">%s</a></p>" email author)
|
(format "<p class=\"author\">Author: <a href=\"mailto:%s\">%s</a></p>" email author)
|
||||||
(format "<p class=\"author\">Author: %s</p>" author)))
|
(format "<p class=\"author\">Author: %s</p>" author)))
|
||||||
(format "<p class=\"date\">Modified: %s</p>"
|
|
||||||
(format-time-string "%Y-%m-%d %H:%M:%S"))
|
|
||||||
(when-let ((date (get-from-info info :date)))
|
(when-let ((date (get-from-info info :date)))
|
||||||
(format "<p class=\"date\">Created: %s</p>" date))
|
(format "<p class=\"date\">Created: %s</p>" date))
|
||||||
|
(when-let ((keywords (plist-get info :keywords)))
|
||||||
|
(format "<p class=\"keywords\">Keywords: <code>%s</code></p>" keywords))
|
||||||
|
(format "<p class=\"date\">Generated: %s</p>"
|
||||||
|
(format-time-string "%Y-%m-%d %H:%M:%S"))
|
||||||
(format (concat "<p class=\"creator\"> Generated with "
|
(format (concat "<p class=\"creator\"> Generated with "
|
||||||
"<a href=\"https://www.gnu.org/software/emacs/\" target=\"_blank\" rel=\"noopener noreferrer\">Emacs %s</a>, "
|
"<a href=\"https://www.gnu.org/software/emacs/\" target=\"_blank\" rel=\"noopener noreferrer\">Emacs %s</a>, "
|
||||||
"<a href=\"http://spacemacs.org\" target=\"_blank\" rel=\"noopener noreferrer\">Spacemacs %s</a>, "
|
"<a href=\"http://spacemacs.org\" target=\"_blank\" rel=\"noopener noreferrer\">Spacemacs %s</a>, "
|
||||||
"<a href=\"http://orgmode.org\" target=\"_blank\" rel=\"noopener noreferrer\">Org Mode %s</a>")
|
"<a href=\"http://orgmode.org\" target=\"_blank\" rel=\"noopener noreferrer\">Org Mode %s</a>")
|
||||||
emacs-version spacemacs-version org-version)
|
emacs-version spacemacs-version org-version)
|
||||||
"</footer>"))
|
"</footer>"
|
||||||
|
"<hr/>"
|
||||||
|
(menu)))
|
||||||
|
|
||||||
(defun org-blog-sitemap-format-entry (entry _style project)
|
(defun org-blog-sitemap-format-entry (entry _style project)
|
||||||
"Return string for each ENTRY in PROJECT."
|
"Return string for each ENTRY in PROJECT."
|
||||||
(when (s-starts-with-p "posts/" entry)
|
(when (s-starts-with-p "posts/" entry)
|
||||||
(format "@@html:<span class=\"archive-item\"><span class=\"archive-date\">@@ %s @@html:</span>@@ [[file:%s][%s]] @@html:</span>@@"
|
(format "@@html:<span class=\"archive-item\"><span class=\"archive-date\">@@ %s: @@html:</span>@@ [[file:%s][%s]] @@html:</span>@@"
|
||||||
(format-time-string "%h %d, %Y"
|
(format-time-string "%Y-%m-%d"
|
||||||
(org-publish-find-date entry project))
|
(org-publish-find-date entry project))
|
||||||
entry
|
entry
|
||||||
(org-publish-find-title entry project))))
|
(org-publish-find-title entry project))))
|
||||||
|
|
||||||
(defun org-blog-sitemap-function (title list)
|
(defun org-blog-sitemap-function (title list)
|
||||||
"Return sitemap using TITLE and LIST returned by `org-blog-sitemap-format-entry'."
|
"Return sitemap using TITLE and LIST returned by `org-blog-sitemap-format-entry'."
|
||||||
(concat "#+TITLE: " title "\n\n"
|
(concat "#+TITLE: " title "\n"
|
||||||
|
"#+AUTHOR: Yann Esposito\n"
|
||||||
|
"#+EMAIL: yann.esposito@gmail.com\n"
|
||||||
"\n#+begin_archive\n"
|
"\n#+begin_archive\n"
|
||||||
(mapconcat (lambda (li)
|
(mapconcat (lambda (li)
|
||||||
(format "@@html:<li>@@ %s @@html:</li>@@" (car li)))
|
(format "@@html:<li>@@ %s @@html:</li>@@" (car li)))
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
#+TITLE: Static blog with org-mode
|
#+TITLE: Static blog with org-mode
|
||||||
#+AUTHOR: Yann Esposito
|
#+AUTHOR: Yann Esposito
|
||||||
#+EMAIL: yann.esposito@gmail.com
|
#+EMAIL: yann.esposito@gmail.com
|
||||||
|
#+DATE: 2019-07-04
|
||||||
#+KEYWORDS: programming, blog, org-mode
|
#+KEYWORDS: programming, blog, org-mode
|
||||||
|
|
||||||
This is the first article using my new blog system.
|
This is the first article using my new blog system.
|
||||||
|
@ -43,4 +44,8 @@ First imagine a Markdown but more TODO list oriented.
|
||||||
But along with this, emacs has a lot of helper functions to work with those
|
But along with this, emacs has a lot of helper functions to work with those
|
||||||
org-mode files.
|
org-mode files.
|
||||||
|
|
||||||
|
One real game changer is ~org-capture~.
|
||||||
|
You can add a task quite easily while doing other work in emacs.
|
||||||
|
|
||||||
|
|
||||||
[fn:vim] I wrote this article to help people use vim: [[http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/][learn vim progressively]]
|
[fn:vim] I wrote this article to help people use vim: [[http://yannesposito.com/Scratch/en/blog/Learn-Vim-Progressively/][learn vim progressively]]
|
||||||
|
|
Loading…
Reference in a new issue