From 218305dbfeb061092d3f5965e12e318113f16dbd Mon Sep 17 00:00:00 2001 From: "Yann Esposito (Yogsototh)" Date: Fri, 5 Jul 2019 23:29:02 +0200 Subject: [PATCH] cleanup --- .gitignore | 1 + _site/archive.html | 39 ---- _site/assets/minimalist.css | 117 ------------ _site/homepage.html | 175 ----------------- _site/index.html | 50 ----- _site/posts/index.html | 47 ----- archive.xml | 34 ---- src/archive.org | 2 +- {assets => src/assets/css}/minimalist.css | 7 +- src/{ => assets}/img/a.png | Bin src/assets/minimalist.css | 117 ------------ src/homepage-pandoc.html | 56 ------ src/homepage.html | 205 -------------------- src/homepage.org | 19 +- src/index.html | 83 -------- src/index.org | 220 ++++++++++------------ src/posts/2019-07-04-org-publish.org | 129 +++++++++++++ src/posts/index.org | 22 --- 18 files changed, 235 insertions(+), 1088 deletions(-) create mode 100644 .gitignore delete mode 100644 _site/archive.html delete mode 100644 _site/assets/minimalist.css delete mode 100644 _site/homepage.html delete mode 100644 _site/index.html delete mode 100644 _site/posts/index.html delete mode 100644 archive.xml rename {assets => src/assets/css}/minimalist.css (94%) rename src/{ => assets}/img/a.png (100%) delete mode 100644 src/assets/minimalist.css delete mode 100644 src/homepage-pandoc.html delete mode 100644 src/homepage.html delete mode 100644 src/index.html create mode 100644 src/posts/2019-07-04-org-publish.org delete mode 100644 src/posts/index.org diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ca35be0 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +_site diff --git a/_site/archive.html b/_site/archive.html deleted file mode 100644 index 806bdc9..0000000 --- a/_site/archive.html +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - -Blog Posts - - - - - - -
-
-
-Programing Heresy -
-
-
-

Blog Posts

-
-

-

  • Jul 04, 2019 her.esy.fun
  • -

    - -
    -
    -
    -
    - Home - - Posts -
    - -
    -
    -
    - - diff --git a/_site/assets/minimalist.css b/_site/assets/minimalist.css deleted file mode 100644 index 0629e64..0000000 --- a/_site/assets/minimalist.css +++ /dev/null @@ -1,117 +0,0 @@ -body { font-family: sans-serif; - font-size: 15px; - line-height: 20px; - max-width: 50em; - hyphens: auto; - -webkit-hyphens: auto; - -moz-hyphens:auto; - -ms-hyphens:auto; } - -h1, h2, h3, h4, h5, h6, -pre, code, blockquote, ol, ul, -ol ol, ul ul, ul ol, ol ul, li, -p, section, header, footer { - float: none; - margin: 0; - padding: 0; -} - -h1, h2, h3, h4, h5, h6, -pre, code, blockquote, -p, ul, ol, section, header, footer, .figure { - margin-top: 20px; - margin-bottom: 20px; -} -h1 { font-size: 1em; } -h2 { font-size: 1em; } -h3 { font-size: 1em; } -h4 { font-size: 1em; } -h5 { font-size: 1em; } -h6 { font-size: 1em; } -h1::before { content: "# "; opacity: 0.5; } -h2::before { content: "## "; opacity: 0.5; } -h3::before { content: "### "; opacity: 0.5; } -h4::before { content: "#### "; opacity: 0.5; } -h5::before { content: "##### "; opacity: 0.5; } -h6::before { content: "###### "; opacity: 0.5; } -p { margin: 0; padding: 0; } -hr { - position: relative; - height: 20px; - font-size: 0; - line-height: 0; - overflow: hidden; - border: 0; - margin-bottom: 20px; -} -hr:after { - content: "----------------------------------------------------------------------------------------------------"; - font-family: monospace; - position: absolute; - top: 0; - left: 0; - font-size: 14px; - line-height: 20px; - width: 100%; - word-wrap: break-word; -} -blockquote { margin-left: 0; } -pre::after,pre::before { content: "~~~~~~"; display: block; font-size: 1.25em; opacity: 0.3; } -code { - font-family: "courrier new", monospace; - background: #f2f2f2; -} -pre code { background: none; } -blockquote { - position: relative; - padding-left: 17px; - padding-left: 2ch; - overflow: hidden; -} -blockquote:after { - content: ">\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>"; - white-space: pre; - position: absolute; - top: 0; - left: 0; - font-size: 14px; - line-height: 20px; - opacity: 0.3; -} - -li { - position: relative; - display: block; - padding-left: 18px; -} -li:after { - position: absolute; - top: 0; - left: 0; -} -ul > li:after { - content: "▪"; - opacity: 0.2; -} -ol { - counter-reset: ol; -} -ol > li:after { - content: counter(ol) "."; - counter-increment: ol; -} - -/* colors */ -a, a:visited { color: #008AFF; } -a:active, a:hover, a:focus { color: #0085a1; } - -h1 { color: #6c71c4;} -h2 { color: #d33682;} -h3 { color: #dc322f;} -h4 { color: #cb4b16;} -h5 { color: #b58900;} -h6 { color: #859900;} - -img { max-width: 100%; - max-height: 800px; - margin: 20px auto; } diff --git a/_site/homepage.html b/_site/homepage.html deleted file mode 100644 index 898f471..0000000 --- a/_site/homepage.html +++ /dev/null @@ -1,175 +0,0 @@ - - - - - - -her.esy.fun - - - - - - - - - -
    -
    - -
    -
    -

    her.esy.fun

    -

    -Welcome to her.esy.fun! -

    - -
    -

    Testing

    -
    -

    -I will test some classical things. -First let’s test bold, then italic then, code and terminal. -Also forgot barré. -And a veryveryveryverylongwordlike Supercalifragilisticexpialidocious -and even longer SupercalifragilisticexpialidociousSupercalifragilisticexpialidocious -and even very very longer -SupercalifragilisticexpialidociousSupercalifragilisticexpialidociousSupercalifragilisticexpialidociousSupercalifragilisticexpialidociousSupercalifragilisticexpialidocious -

    - -
    -
    (def foo
    -  "this is some clojure code"
    -  [& args]
    -  (string/join ", " args))
    -
    -
    - -

    -Then let’s try some blockquote: -

    - -
    -

    -This is a quote here. I’m fond of using it. -

    - -

    -– Shakespeare -

    -
    - -
      -
    • item 1
    • -
    • item 2 -
        -
      • sub-item
      • -
      • re-sub-item -
          -
        • sub-sub-item
        • -
      • -
      • sub
      • -
    • -
    • item 3
    • -
    • item 4
    • -
    - - -
      -
    1. foo
    2. -
    3. bar
    4. -
    5. baz
    6. -
    - - -
    - -

    -some text -

    - -

    -A figure with a caption: -

    - - -
    -The bomb - -
    Figure 1: The bomb that started the expriment in Twin Peaks
    -
    -
    -
    - -
    -

    h2 test

    -
    -
    -
    -

    h3 test

    -
    -
    -
    -

    h4 test

    -
    -
    -
    -
    h5 test
    -
    -
    -
    -
    h6 test
    -
    -
    -
    -h7 does not exists -
    -
    -
      -
    • lower …
      -
        -
      • deeper
        -
          -
        • even deeper…
          -
            -
          • still even deeeeper
            -
            -

            -Deep enough now :) -

            -
            -
          • -
          -
        • -
        -
      • -
      -
    • -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    - - diff --git a/_site/index.html b/_site/index.html deleted file mode 100644 index 2e13e16..0000000 --- a/_site/index.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - -her.esy.fun - - - - - - -
    -
    -
    -Programing Heresy -
    -
    -
    -

    her.esy.fun

    -
    -

    Welcome!

    -
    -

    -her.esy.fun -

    - -

    -This is a new take on my personal blog. -With a lot more minimalism in mind. -

    -
    -
    - -
    -

    Posts

    -
    - -
    -
    -
    - -
    -
    -
    - - diff --git a/_site/posts/index.html b/_site/posts/index.html deleted file mode 100644 index 1278ef0..0000000 --- a/_site/posts/index.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - -her.esy.fun - - - - - - -
    -
    - -
    -
    -

    her.esy.fun

    -

    -her.esy.fun -

    - -

    -This is a new take on my personal blog. -With a lot more minimalism in mind. -

    - -
    -

    Articles

    -
    -
    - -
    -
    -
    - - diff --git a/archive.xml b/archive.xml deleted file mode 100644 index 50d500c..0000000 --- a/archive.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - Blog Posts - - https://her.esy.fun/ - - en - Fri, 05 Jul 2019 17:08:36 +0200 - Fri, 05 Jul 2019 17:08:36 +0200 - Emacs 26.1 Org-mode 9.2.3 - yaesposi@YAESPOSI-M-82JZ (yaesposi) - - https://orgmode.org/img/org-mode-unicorn-logo.png - Blog Posts - https://her.esy.fun/ - - -
    -

    -

  • Jul 04, 2019 her.esy.fun
  • -

    - -
    -
    -
    diff --git a/src/archive.org b/src/archive.org index 5f8b3d3..5b8039b 100644 --- a/src/archive.org +++ b/src/archive.org @@ -2,5 +2,5 @@ #+begin_archive -@@html:
  • @@ @@html:@@ Jul 04, 2019 @@html:@@ [[file:posts/index.org][her.esy.fun]] @@html:@@ @@html:
  • @@ +@@html:
  • @@ @@html:@@ Jul 05, 2019 @@html:@@ [[file:posts/2019-07-04-org-publish.org][org-publish]] @@html:@@ @@html:
  • @@ #+end_archive diff --git a/assets/minimalist.css b/src/assets/css/minimalist.css similarity index 94% rename from assets/minimalist.css rename to src/assets/css/minimalist.css index 0629e64..820ff5c 100644 --- a/assets/minimalist.css +++ b/src/assets/css/minimalist.css @@ -56,7 +56,12 @@ hr:after { word-wrap: break-word; } blockquote { margin-left: 0; } -pre::after,pre::before { content: "~~~~~~"; display: block; font-size: 1.25em; opacity: 0.3; } +pre { max-width: 100%; overflow: scroll; font-size: 12px; } +pre::after,pre::before { + content: "~~~~~~~~~"; + font-size: 12px; + display: block; + opacity: 1; } code { font-family: "courrier new", monospace; background: #f2f2f2; diff --git a/src/img/a.png b/src/assets/img/a.png similarity index 100% rename from src/img/a.png rename to src/assets/img/a.png diff --git a/src/assets/minimalist.css b/src/assets/minimalist.css deleted file mode 100644 index 0629e64..0000000 --- a/src/assets/minimalist.css +++ /dev/null @@ -1,117 +0,0 @@ -body { font-family: sans-serif; - font-size: 15px; - line-height: 20px; - max-width: 50em; - hyphens: auto; - -webkit-hyphens: auto; - -moz-hyphens:auto; - -ms-hyphens:auto; } - -h1, h2, h3, h4, h5, h6, -pre, code, blockquote, ol, ul, -ol ol, ul ul, ul ol, ol ul, li, -p, section, header, footer { - float: none; - margin: 0; - padding: 0; -} - -h1, h2, h3, h4, h5, h6, -pre, code, blockquote, -p, ul, ol, section, header, footer, .figure { - margin-top: 20px; - margin-bottom: 20px; -} -h1 { font-size: 1em; } -h2 { font-size: 1em; } -h3 { font-size: 1em; } -h4 { font-size: 1em; } -h5 { font-size: 1em; } -h6 { font-size: 1em; } -h1::before { content: "# "; opacity: 0.5; } -h2::before { content: "## "; opacity: 0.5; } -h3::before { content: "### "; opacity: 0.5; } -h4::before { content: "#### "; opacity: 0.5; } -h5::before { content: "##### "; opacity: 0.5; } -h6::before { content: "###### "; opacity: 0.5; } -p { margin: 0; padding: 0; } -hr { - position: relative; - height: 20px; - font-size: 0; - line-height: 0; - overflow: hidden; - border: 0; - margin-bottom: 20px; -} -hr:after { - content: "----------------------------------------------------------------------------------------------------"; - font-family: monospace; - position: absolute; - top: 0; - left: 0; - font-size: 14px; - line-height: 20px; - width: 100%; - word-wrap: break-word; -} -blockquote { margin-left: 0; } -pre::after,pre::before { content: "~~~~~~"; display: block; font-size: 1.25em; opacity: 0.3; } -code { - font-family: "courrier new", monospace; - background: #f2f2f2; -} -pre code { background: none; } -blockquote { - position: relative; - padding-left: 17px; - padding-left: 2ch; - overflow: hidden; -} -blockquote:after { - content: ">\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>\A>"; - white-space: pre; - position: absolute; - top: 0; - left: 0; - font-size: 14px; - line-height: 20px; - opacity: 0.3; -} - -li { - position: relative; - display: block; - padding-left: 18px; -} -li:after { - position: absolute; - top: 0; - left: 0; -} -ul > li:after { - content: "▪"; - opacity: 0.2; -} -ol { - counter-reset: ol; -} -ol > li:after { - content: counter(ol) "."; - counter-increment: ol; -} - -/* colors */ -a, a:visited { color: #008AFF; } -a:active, a:hover, a:focus { color: #0085a1; } - -h1 { color: #6c71c4;} -h2 { color: #d33682;} -h3 { color: #dc322f;} -h4 { color: #cb4b16;} -h5 { color: #b58900;} -h6 { color: #859900;} - -img { max-width: 100%; - max-height: 800px; - margin: 20px auto; } diff --git a/src/homepage-pandoc.html b/src/homepage-pandoc.html deleted file mode 100644 index d32e9ff..0000000 --- a/src/homepage-pandoc.html +++ /dev/null @@ -1,56 +0,0 @@ -

    Welcome to her.esy.fun!

    -

    Testing

    -

    I will test some classical things. First let's test bold, then italic then, code and terminal. Also forgot barré. And a veryveryveryverylongwordlike Supercalifragilisticexpialidocious and even longer SupercalifragilisticexpialidociousSupercalifragilisticexpialidocious and even very very longer SupercalifragilisticexpialidociousSupercalifragilisticexpialidociousSupercalifragilisticexpialidociousSupercalifragilisticexpialidociousSupercalifragilisticexpialidocious

    -
    (def foo
    -  "this is some clojure code"
    -  [& args]
    -  (string/join ", " args))
    -

    Then let's try some blockquote:

    -
    -

    This is a quote here. I'm fond of using it.

    -

    – Shakespeare

    -
    - -
      -
    1. foo
    2. -
    3. bar
    4. -
    5. baz
    6. -
    -
    -

    some text

    -

    A figure with a caption:

    -
    -The bomb that started the expriment in Twin Peaks
    The bomb that started the expriment in Twin Peaks
    -
    -

    h2 test

    -

    h3 test

    -

    h4 test

    -

    h5 test

    -
    h6 test
    -
    h7 does not exists
    -
      -
    1. lower …

      -
        -
      1. deeper

        -
          -
        1. even deeper…

          -
            -
          1. still even deeeeper

            -

            Deep enough now :)

          2. -
        2. -
      2. -
    2. -
    diff --git a/src/homepage.html b/src/homepage.html deleted file mode 100644 index 7b8b579..0000000 --- a/src/homepage.html +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - -her.esy.fun - - - - - - - - -
    -

    her.esy.fun

    -

    -Welcome to her.esy.fun! -

    - -
    -

    Testing

    -
    -

    -I will test some classical things. -First let’s test bold, then italic then, code and terminal. -Also forgot barré. -And a veryveryveryverylongwordlike Supercalifragilisticexpialidocious -and even longer SupercalifragilisticexpialidociousSupercalifragilisticexpialidocious -and even very very longer -SupercalifragilisticexpialidociousSupercalifragilisticexpialidociousSupercalifragilisticexpialidociousSupercalifragilisticexpialidociousSupercalifragilisticexpialidocious -

    - -
    -
    (def foo
    -  "this is some clojure code"
    -  [& args]
    -  (string/join ", " args))
    -
    -
    - -

    -Then let’s try some blockquote: -

    - -
    -

    -This is a quote here. I’m fond of using it. -

    - -

    -– Shakespeare -

    -
    - -
      -
    • item 1
    • -
    • item 2 -
        -
      • sub-item
      • -
      • re-sub-item -
          -
        • sub-sub-item
        • -
      • -
      • sub
      • -
    • -
    • item 3
    • -
    • item 4
    • -
    - - -
      -
    1. foo
    2. -
    3. bar
    4. -
    5. baz
    6. -
    - - -
    - -

    -some text -

    - -

    -A figure with a caption: -

    - - -
    -

    The bomb -

    -

    Figure 1: The bomb that started the expriment in Twin Peaks

    -
    -
    -
    - -
    -

    h2 test

    -
    -
    -
    -

    h3 test

    -
    -
    -
    -

    h4 test

    -
    -
    -
    -
    h5 test
    -
    -
    -
    -
    h6 test
    -
    -
    -
    -h7 does not exists -
    -
    -
      -
    • lower …
      -
        -
      • deeper
        -
          -
        • even deeper…
          -
            -
          • still even deeeeper
            -
            -

            -Deep enough now :) -

            -
            -
          • -
          -
        • -
        -
      • -
      -
    • -
    -
    -
    -
    -
    -
    -
    -
    -
    -

    Author: Yann Esposito

    -

    Created: 2019-07-04 Jeu 22:31

    -

    Spacemacs, org-mode (Emacs 26.1, Org mode 9.2.3)

    -

    Validate

    -
    - - diff --git a/src/homepage.org b/src/homepage.org index f961c6d..92c1469 100644 --- a/src/homepage.org +++ b/src/homepage.org @@ -3,27 +3,10 @@ #+EMAIL: yann.esposito@gmail.com #+KEYWORDS: programming #+DESCRIPTION: +#+OPTIONS: H:6 Welcome to [[https://her.esy.fun][her.esy.fun]]! -* Writer :noexport: - -#+BIND: org-exporet-publishing-directory "./dist" - -#+LANGUAGE: en -#+LANG: en -#+OPTIONS: ':t *:t -:t ::t <:t H:3 \n:nil ^:t arch:headline author:t c:nil -#+OPTIONS: creator:comment d:(not LOGBOOK) date:t e:t email:nil f:t inline:t -#+OPTIONS: p:nil pri:nil stat:t tags:t tasks:t tex:t timestamp:t -#+OPTIONS: html-style:nil num:nil toc:nil -#+OPTIONS: todo:t |:t -#+CREATOR: Spacemacs, org-mode (Emacs 26.1, Org mode 9.2.3) -#+HTML_HEAD: -#+HTML_HEAD: -#+OPTIONS: H:6 -#+BIND: org-export-publishing-directory "./dist" - - * Testing I will test some classical things. diff --git a/src/index.html b/src/index.html deleted file mode 100644 index 9934d78..0000000 --- a/src/index.html +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - -her.esy.fun - - - - - - - -
    -

    her.esy.fun

    -

    -her.esy.fun -

    - -

    -This is a new take on my personal blog. -With a lot more minimalism in mind. -

    - -
    -

    Posts

    -
    - -
    -
    -
    - - diff --git a/src/index.org b/src/index.org index bb330fa..616882f 100644 --- a/src/index.org +++ b/src/index.org @@ -1,4 +1,4 @@ -* Code magic :noexport: +* Code magic :noexport: #+TITLE: her.esy.fun #+AUTHOR: Yann Esposito #+EMAIL: yann.esposito@gmail.com @@ -7,136 +7,118 @@ #+LANGUAGE: en #+LANG: en #+CREATOR: Spacemacs, org-mode (Emacs 26.1, Org mode 9.2.3) -#+OPTIONS: ':t *:t -:t ::t <:t H:3 \n:nil ^:t arch:headline author:t c:nil -#+OPTIONS: creator:comment d:(not LOGBOOK) date:t e:t email:nil f:t inline:t -#+OPTIONS: p:nil pri:nil stat:t tags:t tasks:t tex:t timestamp:t -#+OPTIONS: html-style:nil num:nil toc:nil -#+OPTIONS: html-postamble:nil #+OPTIONS: H:6 -#+OPTIONS: todo:t |:t -#+HTML_HEAD_EXTRA: #+begin_src elisp :results none - (require 'org) - (require 'ox-publish) - (require 'ox-html) - (require 'org-element) - (require 'ox-rss) + (require 'org) + (require 'ox-publish) + (require 'ox-html) + (require 'org-element) + (require 'ox-rss) - (defun org-blog-prepare (project-plist) - "With help from `https://github.com/howardabrams/dot-files'. - Touch `index.org' to rebuilt it. - Argument `PROJECT-PLIST' contains information about the current project." - (let* ((base-directory (plist-get project-plist :base-directory)) - (buffer (find-file-noselect (expand-file-name "index.org" base-directory) t))) - (with-current-buffer buffer - (set-buffer-modified-p t) - (save-buffer 0)) - (kill-buffer buffer))) + (defun org-blog-prepare (project-plist) + "With help from `https://github.com/howardabrams/dot-files'. + Touch `index.org' to rebuilt it. + Argument `PROJECT-PLIST' contains information about the current project." + (let* ((base-directory (plist-get project-plist :base-directory)) + (buffer (find-file-noselect (expand-file-name "index.org" base-directory) t))) + (with-current-buffer buffer + (set-buffer-modified-p t) + (save-buffer 0)) + (kill-buffer buffer))) - (defvar org-blog-head - " - ") + (defvar org-blog-head + " + ") - (defun org-blog-preamble (_plist) - "Pre-amble for whole blog." - "Programing Heresy") + (defun org-blog-preamble (_plist) + "Pre-amble for whole blog." + "Programing Heresy") (defun org-blog-postamble (_plist) - "Post-amble for whole blog." - "
    - Home - - Posts") + "Post-amble for whole blog." + "
    + Home - + Posts") - (defun org-blog-sitemap-format-entry (entry _style project) - "Return string for each ENTRY in PROJECT." - (when (s-starts-with-p "posts/" entry) - (format "@@html:@@ %s @@html:@@ [[file:%s][%s]] @@html:@@" - (format-time-string "%h %d, %Y" - (org-publish-find-date entry project)) - entry - (org-publish-find-title entry project)))) + (defun org-blog-sitemap-format-entry (entry _style project) + "Return string for each ENTRY in PROJECT." + (when (s-starts-with-p "posts/" entry) + (format "@@html:@@ %s @@html:@@ [[file:%s][%s]] @@html:@@" + (format-time-string "%h %d, %Y" + (org-publish-find-date entry project)) + entry + (org-publish-find-title entry project)))) - (defun org-blog-publish-to-html (plist filename pub-dir) - "Same as `org-html-publish-to-html' but modifies html before finishing." - (let ((file-path (org-html-publish-to-html plist filename pub-dir))) - (with-current-buffer (find-file-noselect file-path) - (goto-char (point-min)) - (search-forward "") - (insert (concat "\n
    \n " - "
    " - "
    ")) - (goto-char (point-max)) - (search-backward "") - (insert "\n
    \n
    \n
    \n") - (save-buffer) - (kill-buffer)) - file-path)) + (defun org-blog-sitemap-function (title list) + "Return sitemap using TITLE and LIST returned by `org-blog-sitemap-format-entry'." + (concat "#+TITLE: " title "\n\n" + "\n#+begin_archive\n" + (mapconcat (lambda (li) + (format "@@html:
  • @@ %s @@html:
  • @@" (car li))) + (seq-filter #'car (cdr list)) + "\n") + "\n#+end_archive\n")) - (defun org-blog-sitemap-function (title list) - "Return sitemap using TITLE and LIST returned by `org-blog-sitemap-format-entry'." - (concat "#+TITLE: " title "\n\n" - "\n#+begin_archive\n" - (mapconcat (lambda (li) - (format "@@html:
  • @@ %s @@html:
  • @@" (car li))) - (seq-filter #'car (cdr list)) - "\n") - "\n#+end_archive\n")) + (setq base-dir (concat (projectile-project-root) "src")) + (setq publish-dir (concat (projectile-project-root) "_site")) + (setq assets-dir (concat base-dir "/assets")) + (setq publish-assets-dir (concat publish-dir "/assets")) + (setq rss-dir base-dir) + (setq publish-rss-dir publish-dir) + (setq org-publish-project-alist + `(("orgfiles" + :base-directory ,base-dir + :exclude ".*drafts/.*" + :base-extension "org" - (setq org-publish-project-alist - `(("orgfiles" - :base-directory "~/y/her.esy.fun/src/" - :exclude ".*drafts/.*" - :base-extension "org" + :publishing-directory ,publish-dir - :publishing-directory "~/y/her.esy.fun/_site/" + :recursive t + :preparation-function org-blog-prepare + :publishing-function org-html-publish-to-html - :recursive t - :preparation-function org-blog-prepare - :publishing-function org-blog-publish-to-html + :with-toc nil + :with-title t + :with-date t + :section-numbers nil + :html-doctype "html5" + :html-html5-fancy t + :html-head-include-default-style nil + :html-head-include-scripts nil + :htmlized-source t + :html-head-extra ,org-blog-head + :html-preamble org-blog-preamble + :html-postamble org-blog-postamble - :with-toc nil - :with-title t - :with-date t - :section-numbers nil - :html-doctype "html5" - :html-html5-fancy t - :html-head-include-default-style nil - :html-head-include-scripts nil - :htmlized-source t - :html-head-extra ,org-blog-head - :html-preamble org-blog-preamble - :html-postamble org-blog-postamble + :auto-sitemap t + :sitemap-filename "archive.org" + :sitemap-title "Blog Posts" + :sitemap-style list + :sitemap-sort-files anti-chronologically + :sitemap-format-entry org-blog-sitemap-format-entry + :sitemap-function org-blog-sitemap-function) - :auto-sitemap t - :sitemap-filename "archive.org" - :sitemap-title "Blog Posts" - :sitemap-style list - :sitemap-sort-files anti-chronologically - :sitemap-format-entry org-blog-sitemap-format-entry - :sitemap-function org-blog-sitemap-function) + ("assets" + :base-directory ,assets-dir + :base-extension ".*" + :publishing-directory ,publish-assets-dir + :publishing-function org-publish-attachment + :recursive t) - ("assets" - :base-directory "~/y/her.esy.fun/src/assets/" - :base-extension ".*" - :publishing-directory "~/y/her.esy.fun/_site/assets/" - :publishing-function org-publish-attachment - :recursive t) - - ("rss" - :base-directory "~/y/her.esy.fun/src/" - :base-extension "org" - :html-link-home "https://her.esy.fun/" - :html-link-use-abs-url t - :rss-extension "xml" - :publishing-directory "~/y/her.esy.fun/" - :publishing-function (org-rss-publish-to-rss) - :exclude ".*" - :include ("archive.org") - :section-numbers nil - :table-of-contents nil) - - ("blog" :components ("orgfiles" "assets" "rss")))) + ("rss" + :base-directory ,rss-dir + :base-extension "org" + :html-link-home "https://her.esy.fun/" + :html-link-use-abs-url t + :rss-extension "xml" + :publishing-directory ,publish-rss-dir + :publishing-function (org-rss-publish-to-rss) + :exclude ".*" + :include ("archive.org") + :section-numbers nil + :table-of-contents nil) + ("blog" :components ("orgfiles" "assets" "rss")))) #+end_src * Welcome! @@ -146,12 +128,4 @@ This is a new take on my personal blog. With a lot more minimalism in mind. -* Posts - -#+begin_src elisp :results value list :exports results - (mapcar (lambda (d) (concat "[[./posts/" d "][" d "]]")) - (directory-files "posts" nil "\\.org")) -#+end_src - -#+RESULTS: -- [[posts/index.org][index.org]] +With [[http://orgmode.org][org-mode]] diff --git a/src/posts/2019-07-04-org-publish.org b/src/posts/2019-07-04-org-publish.org new file mode 100644 index 0000000..8b53223 --- /dev/null +++ b/src/posts/2019-07-04-org-publish.org @@ -0,0 +1,129 @@ +#+TITLE: Static blog with org-mode +#+AUTHOR: Yann Esposito +#+EMAIL: yann.esposito@gmail.com +#+KEYWORDS: programming, blog + +[[https://her.esy.fun][her.esy.fun]] + +This is a new take on my personal blog. +With a lot more minimalism in mind. + +Fully done with [[https://orgmode.org][=org-mode=]]. + +* Code magic + +Here is how I publish this website in emacs using org-mode. +I just eval that code and then do a simple `org-publish` for the blog. + +And that's it. + +#+begin_src elisp :results none + (require 'org) + (require 'ox-publish) + (require 'ox-html) + (require 'org-element) + (require 'ox-rss) + + (defun org-blog-prepare (project-plist) + "With help from `https://github.com/howardabrams/dot-files'. + Touch `index.org' to rebuilt it. + Argument `PROJECT-PLIST' contains information about the current project." + (let* ((base-directory (plist-get project-plist :base-directory)) + (buffer (find-file-noselect (expand-file-name "index.org" base-directory) t))) + (with-current-buffer buffer + (set-buffer-modified-p t) + (save-buffer 0)) + (kill-buffer buffer))) + + (defvar org-blog-head + " + ") + + (defun org-blog-preamble (_plist) + "Pre-amble for whole blog." + "Programming Heresy") + + (defun org-blog-postamble (_plist) + "Post-amble for whole blog." + "
    + Home - + Posts") + + (defun org-blog-sitemap-format-entry (entry _style project) + "Return string for each ENTRY in PROJECT." + (when (s-starts-with-p "posts/" entry) + (format (concat "@@html:" + "" + "@@ %s @@html:@@ [[file:%s][%s]] @@html:@@") + (format-time-string "%Y-%m-%d" + (org-publish-find-date entry project)) + entry + (org-publish-find-title entry project)))) + + (defun org-blog-sitemap-function (title list) + "Return sitemap using TITLE and LIST returned by `org-blog-sitemap-format-entry'." + (concat "#+TITLE: " title "\n\n" + "\n#+begin_archive\n" + (mapconcat (lambda (li) + (format "@@html:
  • @@ %s @@html:
  • @@" (car li))) + (seq-filter #'car (cdr list)) + "\n") + "\n#+end_archive\n")) + + (setq rootdir (projectile-project-root)) + + (setq org-publish-project-alist + `(("orgfiles" + :base-directory (concat rootdir "/src/") + :exclude ".*drafts/.*" + :base-extension "org" + + :publishing-directory (concat rootdir "/_site/") + + :recursive t + :preparation-function org-blog-prepare + :publishing-function org-html-publish-to-html + + :with-toc nil + :with-title t + :with-date t + :section-numbers nil + :html-doctype "html5" + :html-html5-fancy t + :html-head-include-default-style nil + :html-head-include-scripts nil + :htmlized-source t + :html-head-extra ,org-blog-head + :html-preamble org-blog-preamble + :html-postamble org-blog-postamble + + :auto-sitemap t + :sitemap-filename "archive.org" + :sitemap-title "Blog Posts" + :sitemap-style list + :sitemap-sort-files anti-chronologically + :sitemap-format-entry org-blog-sitemap-format-entry + :sitemap-function org-blog-sitemap-function) + + ("assets" + :base-directory (concat rootdir "/src/assets/") + :base-extension ".*" + :publishing-directory (concat rootdir "/_site/assets/") + :publishing-function org-publish-attachment + :recursive t) + + ("rss" + :base-directory (concat rootdir "/src/") + :base-extension "org" + :html-link-home "https://her.esy.fun/" + :html-link-use-abs-url t + :rss-extension "xml" + :publishing-directory (concat rootdir "/") + :publishing-function (org-rss-publish-to-rss) + :exclude ".*" + :include ("archive.org") + :section-numbers nil + :table-of-contents nil) + + ("blog" :components ("orgfiles" "assets" "rss")))) +#+end_src diff --git a/src/posts/index.org b/src/posts/index.org deleted file mode 100644 index aa359a9..0000000 --- a/src/posts/index.org +++ /dev/null @@ -1,22 +0,0 @@ -#+TITLE: her.esy.fun -#+AUTHOR: Yann Esposito -#+EMAIL: yann.esposito@gmail.com -#+KEYWORDS: programming -#+DESCRIPTION: -#+LANGUAGE: en -#+LANG: en -#+CREATOR: Spacemacs, org-mode (Emacs 26.1, Org mode 9.2.3) -#+OPTIONS: ':t *:t -:t ::t <:t H:3 \n:nil ^:t arch:headline author:t c:nil -#+OPTIONS: creator:comment d:(not LOGBOOK) date:t e:t email:nil f:t inline:t -#+OPTIONS: p:nil pri:nil stat:t tags:t tasks:t tex:t timestamp:t -#+OPTIONS: html-style:nil num:nil toc:nil -#+OPTIONS: html-postamble:nil -#+OPTIONS: todo:t |:t -#+HTML_HEAD_EXTRA: - -[[https://her.esy.fun][her.esy.fun]] - -This is a new take on my personal blog. -With a lot more minimalism in mind. - -* Articles