Better look and feel, more menus

This commit is contained in:
Yann Esposito (Yogsototh) 2019-07-21 09:29:43 +02:00
parent 0755dd4d04
commit f92f5d1da7
Signed by untrusted user who does not match committer: yogsototh
GPG key ID: 7B19A4C650D59646
2 changed files with 38 additions and 17 deletions

View file

@ -3,7 +3,7 @@
*/ */
body { body {
font-family: menlo, monospace; font-family: menlo, monospace;
font-size: 15px; font-size: 13px;
line-height: 20px; line-height: 20px;
margin: 0; margin: 0;
padding: 0; padding: 0;
@ -16,14 +16,19 @@ body {
#preamble { #preamble {
border-bottom: solid 1px; border-bottom: solid 1px;
} }
#preamble h1 {
margin-bottom: 0;
}
#postamble { #postamble {
border-top: solid 1px; border-top: solid 1px;
} }
#preamble,#postamble { #preamble,#postamble {
padding: 10px 0; padding: 10px 0;
}
.menu {
opacity: 0.5; opacity: 0.5;
} }
#preamble:focus,#postamble:focus, #preamble:hover,#postamble:hover { .menu:hover, .menu:focus {
opacity:1; opacity:1;
} }
#content,.content { #content,.content {
@ -31,6 +36,9 @@ body {
margin: 0 auto; margin: 0 auto;
padding: 10px; padding: 10px;
} }
#content *:first-child {
margin-top: 0;
}
h1, h2, h3, h4, h5, h6, pre, code, blockquote, ol, ul, ol ol, ul ul, ul ol, ol h1, h2, h3, h4, h5, h6, pre, code, blockquote, ol, ul, ol ol, ul ul, ul ol, ol
ul, li, p, section, header, footer { ul, li, p, section, header, footer {
@ -276,8 +284,16 @@ body {
background: var(--main-background); background: var(--main-background);
color: var(--main-foreground); color: var(--main-foreground);
} }
::selection {
color: var(--todo-txt);
background-color: var(--yellow);
}
::-moz-selection {
color: var(--todo-txt);
background-color: var(--yellow);
}
a, a:visited { a, a:visited {
color: var(--base1); color: var(--second-foreground);
} }
a:hover, a:active, a:focus { a:hover, a:active, a:focus {
color: var(--yellow); color: var(--yellow);

View file

@ -38,8 +38,8 @@ I write all the content with [[http://orgmode.org][org-mode]].
(defun org-blog-prepare (project-plist) (defun org-blog-prepare (project-plist)
"With help from `https://github.com/howardabrams/dot-files'. "With help from `https://github.com/howardabrams/dot-files'.
Touch `index.org' to rebuilt it. Touch `index.org' to rebuilt it.
Argument `PROJECT-PLIST' contains information about the current project." Argument `PROJECT-PLIST' contains information about the current project."
(let* ((base-directory (plist-get project-plist :base-directory)) (let* ((base-directory (plist-get project-plist :base-directory))
(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
@ -53,14 +53,15 @@ I write all the content with [[http://orgmode.org][org-mode]].
"<link rel=\"alternative\" type=\"application/rss+xml\" title=\"Subscribe to articles\" href=\"/archives.xml\" />" "<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\">")) "<link rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/favicon.ico\">"))
(defun menu () (defun menu (lst)
"Blog menu" "Blog menu"
(concat (concat
"<navigation id=\"menu\">" "<navigation class=\"menu\">"
(mapconcat 'identity (mapconcat 'identity
'("<a href=\"/index.html\">Home</a>" (append
"<a href=\"/archive.html\">Posts</a>" '("<a href=\"/index.html\">Home</a>"
"<a href=\"#preamble\">↑ Top ↑</a>") "<a href=\"/archive.html\">Posts</a>")
lst)
" | ") " | ")
"</navigation>")) "</navigation>"))
@ -84,10 +85,12 @@ I write all the content with [[http://orgmode.org][org-mode]].
"Pre-amble for whole blog." "Pre-amble for whole blog."
(concat (concat
"<div class=\"content\">" "<div class=\"content\">"
"<strong><a href=\"/index.html\">Her.esy.fun</a></strong>" (menu '("<a href=\"#postamble\">↓ bottom ↓</a>"))
"<h1>"
(format "%s" (plist-get info :title))
(when-let ((date (get-from-info info :date))) (when-let ((date (get-from-info info :date)))
(format " - <span class=\"article-date\">%s</span>" date)) (format " - <span class=\"article-date\">%s</span>" date))
" - <a href=\"#menu\">↓ menu ↓</a>" "</h1>"
"</div>")) "</div>"))
(defun get-from-info (info k) (defun get-from-info (info k)
@ -100,6 +103,7 @@ I write all the content with [[http://orgmode.org][org-mode]].
(cond ((eq 0 r) (format "%c" c)) (cond ((eq 0 r) (format "%c" c))
((< 0 r 10) (format "&#%d;" c)) ((< 0 r 10) (format "&#%d;" c))
(t (format "&#x%X;" c))))) (t (format "&#x%X;" c)))))
(defun obfuscate-html (txt) (defun obfuscate-html (txt)
(apply 'concat (apply 'concat
(mapcar 'rand-obfs txt))) (mapcar 'rand-obfs txt)))
@ -111,7 +115,8 @@ I write all the content with [[http://orgmode.org][org-mode]].
"<footer>" "<footer>"
(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 "<div class=\"author\">Author: <a href=\"mailto:%s\">%s</a></div>" (format "<div class=\"author\">Author: <a href=\"%s%s\">%s</a></div>"
(obfuscate-html "mailto:")
(obfuscate-html email) (obfuscate-html email)
(obfuscate-html author)) (obfuscate-html author))
(format "<div class=\"author\">Author: %s</div>" author))) (format "<div class=\"author\">Author: %s</div>" author)))
@ -128,7 +133,7 @@ I write all the content with [[http://orgmode.org][org-mode]].
"</div>") "</div>")
emacs-version spacemacs-version org-version) emacs-version spacemacs-version org-version)
"</footer>" "</footer>"
(menu) (menu '("<a href=\"#preamble\">↑ Top ↑</a>"))
"</div>")) "</div>"))
(defun org-blog-sitemap-format-entry (entry _style project) (defun org-blog-sitemap-format-entry (entry _style project)
@ -172,7 +177,7 @@ I write all the content with [[http://orgmode.org][org-mode]].
:publishing-function org-html-publish-to-html :publishing-function org-html-publish-to-html
:with-toc nil :with-toc nil
:with-title t :with-title nil
:with-date t :with-date t
:section-numbers nil :section-numbers nil
:html-doctype "html5" :html-doctype "html5"
@ -230,8 +235,8 @@ I write all the content with [[http://orgmode.org][org-mode]].
#+end_src #+end_src
#+begin_src elisp :results verbatim #+begin_src elisp :results verbatim
(obfuscate-html "yann.esposito@gmail.com") (append nil '("foo"))
#+end_src #+end_src
#+RESULTS: #+RESULTS:
: "&#x79;&#97;&#x6E;n&#46;&#x65;&#115;&#x70;&#x6F;&#x73;&#105;&#x74;&#x6F;&#x40;&#103;&#x6D;&#x61;&#x69;&#x6C;&#46;&#99;&#111;&#x6D;" : ("foo")