Add descriptions.

This commit is contained in:
Yann Esposito (Yogsototh) 2020-05-02 15:30:40 +02:00
parent ae8c3a1954
commit 367de29ccd
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646
12 changed files with 22 additions and 40 deletions

View file

@ -10,7 +10,6 @@
(defvar draft-publish-assets-dir (concat draft-publish-dir "/")) (defvar draft-publish-assets-dir (concat draft-publish-dir "/"))
(defvar posts-dir (concat base-dir "/posts")) (defvar posts-dir (concat base-dir "/posts"))
(defvar rss-title "Subscribe to articles") (defvar rss-title "Subscribe to articles")
(defvar posts-descr "Articles")
(defvar css-path "/css/mk.css") (defvar css-path "/css/mk.css")
(defvar author-name "Yann Esposito") (defvar author-name "Yann Esposito")
(defvar author-email "yann@esposito.host") (defvar author-email "yann@esposito.host")
@ -57,12 +56,14 @@
(defun logo () (defun logo ()
(concat (concat
"<div id=\"logo\">" "<div id=\"logo\">"
"<a href=\"/\">"
"<svg width=\"5em\" viewBox=\"0 0 64 64\">" "<svg width=\"5em\" viewBox=\"0 0 64 64\">"
"<circle cx=\"32\" cy=\"32\" r=\"30\" stroke=\"var(--b2)\" stroke-width=\"2\" fill=\"var(--b03)\"/>" "<circle cx=\"32\" cy=\"32\" r=\"30\" stroke=\"var(--b2)\" stroke-width=\"2\" fill=\"var(--b03)\"/>"
"<circle cx=\"32\" cy=\"32\" r=\"12\" stroke=\"var(--r)\" stroke-width=\"2\" fill=\"var(--o)\"/>" "<circle cx=\"32\" cy=\"32\" r=\"12\" stroke=\"var(--r)\" stroke-width=\"2\" fill=\"var(--o)\"/>"
"<circle cx=\"32\" cy=\"32\" r=\"6\" stroke-width=\"0\" fill=\"var(--y)\"/>" "<circle cx=\"32\" cy=\"32\" r=\"6\" stroke-width=\"0\" fill=\"var(--y)\"/>"
"<ellipse cx=\"32\" cy=\"14\" rx=\"14\" ry=\"8\" stroke-width=\"0\" fill=\"var(--b3)\"/>" "<ellipse cx=\"32\" cy=\"14\" rx=\"14\" ry=\"8\" stroke-width=\"0\" fill=\"var(--b3)\"/>"
"</svg>" "</svg>"
"</a>"
"</div>")) "</div>"))
(defun relative-link (output-file) (defun relative-link (output-file)
@ -204,43 +205,25 @@
(menu '("<a href=\"#preamble\">↑ Top ↑</a>")) (menu '("<a href=\"#preamble\">↑ Top ↑</a>"))
"</div>")) "</div>"))
(defun y/org-get-keywords ()
(org-element-map (org-element-parse-buffer 'element) 'keyword
(lambda (keyword) (cons (org-element-property :key keyword)
(org-element-property :value keyword)))))
(defun y/org-get-meta (keyword)
(cdr (assoc keyword (y/org-get-keywords))))
(defun y/get-meta (file meta-name)
"Return the value of the meta of an org-mode file.
(y/get-meta file \"DESCRIPTION\")
"
(org-babel-with-temp-filebuffer file (y/org-get-meta meta-name)))
(defun date-format-entry (entry _style project) (defun date-format-entry (entry _style project)
"Return string for each ENTRY in PROJECT." "Return string for each ENTRY in PROJECT."
(when (string-match "posts/.*" entry) (when (string-match "posts/.*" entry)
(let* ((file (org-publish--expand-file-name entry project)) (let* ((file (org-publish--expand-file-name entry project))
(title (org-publish-find-title entry project)) (title (org-publish-find-title entry project))
(artdate (format-time-string "%Y-%m-%d" (org-publish-find-date entry project))) (artdate (format-time-string "%Y-%m-%d" (org-publish-find-date entry project)))
;; (keywords (y/get-meta file "KEYWORDS")) (description (org-publish-find-property entry :description project 'html)))
(description (y/get-meta file "DESCRIPTION")))
(concat (concat
(format " @@html:<span class=\"metas\">%s</span>@@: " artdate) (format " @@html:<span class=\"metas\">%s</span>@@: " artdate)
(format " *[[file:%s][%s]]*" file title) (format " *[[file:%s][%s]]*" file title)
(format " @@html:<div class=\"description\">@@%s@@html:</div>@@" description) (format " @@html:<div class=\"description\">%s</div>@@" description)
(format " @@html:<div class=\"metas\">@@ ") (format " @@html:<div class=\"metas\">@@ ")
;; (keywords-to-html keywords)
" @@html:</div>@@\n")))) " @@html:</div>@@\n"))))
(defun org-blog-sitemap-fn-descr (descr title list) (defun org-blog-sitemap-fn-descr (_descr 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" (concat "#+TITLE: " title "\n"
"#+AUTHOR: " author-name "\n" "#+AUTHOR: " author-name "\n"
"#+EMAIL: " author-email "\n" "#+EMAIL: " author-email "\n"
"#+DESCRIPTION: " descr "\n"
(concat "@@html:" (menu '()) "@@") (concat "@@html:" (menu '()) "@@")
"\n\n" "\n\n"
(mapconcat (lambda (li) (format "%s" (car li))) (mapconcat (lambda (li) (format "%s" (car li)))
@ -297,7 +280,7 @@ Return output file name."
(t (copy-file filename dst-file t)))))) (t (copy-file filename dst-file t))))))
(defalias 'org-blog-posts-sitemap-fn (defalias 'org-blog-posts-sitemap-fn
(apply-partially 'org-blog-sitemap-fn-descr posts-descr)) (apply-partially 'org-blog-sitemap-fn-descr ""))
(setq org-html-htmlize-output-type 'css) (setq org-html-htmlize-output-type 'css)
(setq org-html-htmlize-font-prefix "org-") (setq org-html-htmlize-font-prefix "org-")

Binary file not shown.

View file

@ -1,7 +1,7 @@
#+TITLE: This is the title #+TITLE: This is the title
#+AUTHOR: Yann Esposito #+AUTHOR: Yann Esposito
#+EMAIL: yann@esposito.host #+EMAIL: yann@esposito.host
#+KEYWORDS: programming #+KEYWORDS: programming demo
#+DESCRIPTION: css demonstration #+DESCRIPTION: css demonstration
#+OPTIONS: H:5 #+OPTIONS: H:5
#+OPTIONS: auto-id:t toc:t #+OPTIONS: auto-id:t toc:t

View file

@ -2,7 +2,6 @@
#+KEYWORDS: programming #+KEYWORDS: programming
#+AUTHOR: Yann Esposito #+AUTHOR: Yann Esposito
#+EMAIL: yann@esposito.host #+EMAIL: yann@esposito.host
#+DESCRIPTION:
#+LANGUAGE: en #+LANGUAGE: en
#+LANG: en #+LANG: en
#+OPTIONS: H:5 #+OPTIONS: H:5

View file

@ -4,14 +4,12 @@
#+EMAIL: yann@esposito.host #+EMAIL: yann@esposito.host
#+DATE: [2019-10-19 Sat] #+DATE: [2019-10-19 Sat]
#+KEYWORDS: self-hosting, chat, irc #+KEYWORDS: self-hosting, chat, irc
#+DESCRIPTION: How to modernize IRC #+DESCRIPTION: Why and how to have modern and respectful chat system with IRC.
#+OPTIONS: auto-id:t toc:t #+OPTIONS: auto-id:t toc:t
#+begin_notes #+begin_notes
tl;dr: Why and how to have modern and respectful chat system with IRC.
After reviewing and testing many different chat solutions the clear winner After reviewing and testing many different chat solutions the clear winner
is IRC. More precisely via those softwares: (at least for my taste) is IRC. More precisely via those softwares:
- IRC - IRC
- ZNC (with playback and palaver module) - ZNC (with playback and palaver module)
- weechat with replay script (terminal client) - weechat with replay script (terminal client)

View file

@ -3,7 +3,7 @@
#+EMAIL: yann@esposito.host #+EMAIL: yann@esposito.host
#+DATE: [2019-11-10 Sun] #+DATE: [2019-11-10 Sun]
#+KEYWORDS: self-hosting, chat, irc #+KEYWORDS: self-hosting, chat, irc
#+DESCRIPTION: Small script to change the profile of iTerm in sync with macOS preferences #+DESCRIPTION: Change the profile of iTerm in sync with macOS preferences.
#+OPTIONS: auto-id:t toc:nil #+OPTIONS: auto-id:t toc:nil
#+begin_notes #+begin_notes

View file

@ -3,7 +3,7 @@
#+EMAIL: yann@esposito.host #+EMAIL: yann@esposito.host
#+DATE: [2019-11-30 Sat] #+DATE: [2019-11-30 Sat]
#+KEYWORDS: blog #+KEYWORDS: blog
#+DESCRIPTION: Recent changes on my blog system #+DESCRIPTION: About recent changes on my blog system.
#+OPTIONS: auto-id:t toc:nil #+OPTIONS: auto-id:t toc:nil
When I started this new blog, I wanted to find something minimal to be able When I started this new blog, I wanted to find something minimal to be able

View file

@ -3,7 +3,8 @@
#+EMAIL: yann@esposito.host #+EMAIL: yann@esposito.host
#+DATE: [2019-12-06 Fri] #+DATE: [2019-12-06 Fri]
#+KEYWORDS: blog, shell, script #+KEYWORDS: blog, shell, script
#+DESCRIPTION: How to optimize the size of a full website by using information in both HTML and CSS. #+DESCRIPTION: Optimize the size of a full static website by taking advantage
#+DESCRIPTION: of information found in both HTML and CSS.
#+OPTIONS: auto-id:t toc:nil #+OPTIONS: auto-id:t toc:nil
One of the major problem with CSS and HTML is that they are highly One of the major problem with CSS and HTML is that they are highly

View file

@ -4,11 +4,13 @@
#+author: Yann Esposito #+author: Yann Esposito
#+EMAIL: yann@esposito.host #+EMAIL: yann@esposito.host
#+keywords: Haskell, programming, functional, tutorial #+keywords: Haskell, programming, functional, tutorial
#+DESCRIPTION: A short and intense introduction to Haskell.<br/> #+DESCRIPTION: A short and intense introduction to Haskell.
#+DESCRIPTION: <br/> #+DESCRIPTION: This is an update of my old (2012) article.
#+DESCRIPTION: This is an update of my old (2012) article.<br/> #+DESCRIPTION: A lot of things have changed since then.
#+DESCRIPTION: A lot of things have changed since then.<br/> #+DESCRIPTION: Mostly I changed my approach about the easiest way to install
#+DESCRIPTION: I took the time to read it again.<br/> #+DESCRIPTION: a Haskell playground.
#+DESCRIPTION: I removed the not as important part, and added a short
#+DESCRIPTION: introduction about starting a new project.
#+OPTIONS: auto-id:t toc:t #+OPTIONS: auto-id:t toc:t
#+STARTUP: overview #+STARTUP: overview

View file

@ -3,7 +3,7 @@
#+author: Yann Esposito #+author: Yann Esposito
#+EMAIL: yann@esposito.host #+EMAIL: yann@esposito.host
#+keywords: org-mode, blog #+keywords: org-mode, blog
#+DESCRIPTION: add links to code block during orgmode export #+DESCRIPTION: Add links to code block during orgmode export.
#+OPTIONS: auto-id:t toc:t #+OPTIONS: auto-id:t toc:t
#+STARTUP: overview #+STARTUP: overview

View file

@ -4,7 +4,7 @@
#+EMAIL: yann@esposito.host #+EMAIL: yann@esposito.host
#+keywords: colorscheme #+keywords: colorscheme
#+DESCRIPTION: A generalization of solarized (https://solaryzed.esy.fun). #+DESCRIPTION: A generalization of solarized (https://solaryzed.esy.fun).
#+DESCRIPTION: I tried to make keep the same fundamentals and to free some variables. #+DESCRIPTION: I tried to keep the same fundamentals and to free some variables.
#+OPTIONS: auto-id:t toc:t #+OPTIONS: auto-id:t toc:t
#+STARTUP: overview #+STARTUP: overview

View file

@ -2,7 +2,6 @@
#+KEYWORDS: programming, presentations, slides #+KEYWORDS: programming, presentations, slides
#+AUTHOR: Yann Esposito #+AUTHOR: Yann Esposito
#+EMAIL: yann@esposito.host #+EMAIL: yann@esposito.host
#+DESCRIPTION:
#+LANGUAGE: en #+LANGUAGE: en
#+LANG: en #+LANG: en
#+OPTIONS: H:5 #+OPTIONS: H:5