removed archive
This commit is contained in:
parent
d5a574ba0e
commit
5de898d7a2
7 changed files with 75 additions and 97 deletions
43
Shakefile.hs
43
Shakefile.hs
|
@ -113,13 +113,10 @@ getBlogpostFromMetas path toc pandoc@(Pandoc meta _) = do
|
||||||
inlineToTxt (Str t) = t
|
inlineToTxt (Str t) = t
|
||||||
inlineToTxt _ = ""
|
inlineToTxt _ = ""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
sortByPostDate :: [BlogPost] -> [BlogPost]
|
sortByPostDate :: [BlogPost] -> [BlogPost]
|
||||||
sortByPostDate =
|
sortByPostDate =
|
||||||
sortBy (\a b-> compare (postDate b) (postDate a))
|
sortBy (\a b-> compare (postDate b) (postDate a))
|
||||||
|
|
||||||
|
|
||||||
build :: FilePath -> FilePath
|
build :: FilePath -> FilePath
|
||||||
build = (</>) siteDir
|
build = (</>) siteDir
|
||||||
|
|
||||||
|
@ -145,7 +142,7 @@ buildRules = do
|
||||||
let asset = dropDirectory1 out
|
let asset = dropDirectory1 out
|
||||||
case (takeExtension asset) of
|
case (takeExtension asset) of
|
||||||
".html" -> do
|
".html" -> do
|
||||||
if out == siteDir </> "archive.html"
|
if out == siteDir </> "index.html"
|
||||||
then buildArchive getPosts getTemplate out
|
then buildArchive getPosts getTemplate out
|
||||||
else genHtmlAction getPost getTemplate out
|
else genHtmlAction getPost getTemplate out
|
||||||
".pdf" -> do
|
".pdf" -> do
|
||||||
|
@ -157,7 +154,7 @@ buildRules = do
|
||||||
fileExists <- doesFileExist (srcDir </> asset)
|
fileExists <- doesFileExist (srcDir </> asset)
|
||||||
if fileExists
|
if fileExists
|
||||||
then copyFileChanged (srcDir </> asset) out
|
then copyFileChanged (srcDir </> asset) out
|
||||||
else if out == siteDir </> "archive.gmi"
|
else if out == siteDir </> "index.gmi"
|
||||||
then buildGeminiArchive getPosts out
|
then buildGeminiArchive getPosts out
|
||||||
else genGeminiAction out
|
else genGeminiAction out
|
||||||
".jpg" -> compressImage asset
|
".jpg" -> compressImage asset
|
||||||
|
@ -169,6 +166,11 @@ buildRules = do
|
||||||
needAll
|
needAll
|
||||||
command_[] "engine/pre-deploy.sh" []
|
command_[] "engine/pre-deploy.sh" []
|
||||||
|
|
||||||
|
welcomeTxt :: Text
|
||||||
|
welcomeTxt = toS $ T.intercalate "\n" $
|
||||||
|
[ "Welcome to my small place on the Internet."
|
||||||
|
]
|
||||||
|
|
||||||
buildArchive
|
buildArchive
|
||||||
:: (() -> Action [BlogPost])
|
:: (() -> Action [BlogPost])
|
||||||
-> (FilePath -> Action Template) -> [Char] -> Action ()
|
-> (FilePath -> Action Template) -> [Char] -> Action ()
|
||||||
|
@ -178,9 +180,9 @@ buildArchive getPosts getTemplate out = do
|
||||||
need $ css <> map postSrc posts
|
need $ css <> map postSrc posts
|
||||||
let
|
let
|
||||||
title :: Text
|
title :: Text
|
||||||
title = "#+title: Posts"
|
title = "#+title: Yann Esposito's blog"
|
||||||
articleList = toS $ T.intercalate "\n" $ map postInfo posts
|
articleList = toS $ T.intercalate "\n" $ map postInfo posts
|
||||||
fileContent = title <> "\n\n" <> articleList
|
fileContent = title <> "\n\n" <> welcomeTxt <> "\n\n" <> articleList
|
||||||
eitherResult <- liftIO $ Pandoc.runIO $ Readers.readOrg (def { readerStandalone = True }) (toS fileContent)
|
eitherResult <- liftIO $ Pandoc.runIO $ Readers.readOrg (def { readerStandalone = True }) (toS fileContent)
|
||||||
bp <- case eitherResult of
|
bp <- case eitherResult of
|
||||||
Left _ -> fail "BAD"
|
Left _ -> fail "BAD"
|
||||||
|
@ -198,6 +200,18 @@ buildArchive getPosts getTemplate out = do
|
||||||
]
|
]
|
||||||
writeFile' out (toS htmlContent)
|
writeFile' out (toS htmlContent)
|
||||||
|
|
||||||
|
geminiMenu :: Text
|
||||||
|
geminiMenu = T.intercalate "\n"
|
||||||
|
[ "=> /index.gmi Home"
|
||||||
|
, "=> /gem-atom.xml Feed"
|
||||||
|
, "=> /slides.gmi Slides"
|
||||||
|
, "=> /about-me.gmi About"
|
||||||
|
, ""
|
||||||
|
, "=> https://gitea.esy.fun code"
|
||||||
|
, "=> https://espial.esy.fun/u:yogsototh bookmarks"
|
||||||
|
, "=> https://espial.esy.fun/u:yogsototh/notes notes"
|
||||||
|
]
|
||||||
|
|
||||||
buildGeminiArchive
|
buildGeminiArchive
|
||||||
:: (() -> Action [BlogPost])
|
:: (() -> Action [BlogPost])
|
||||||
-> [Char] -> Action ()
|
-> [Char] -> Action ()
|
||||||
|
@ -206,9 +220,12 @@ buildGeminiArchive getPosts out = do
|
||||||
need $ map postSrc posts
|
need $ map postSrc posts
|
||||||
let
|
let
|
||||||
title :: Text
|
title :: Text
|
||||||
title = "# Posts"
|
title = "# Yann Esposito's posts"
|
||||||
articleList = toS $ T.intercalate "\n" $ map postGeminiInfo posts
|
articleList = toS $ T.intercalate "\n" $ map postGeminiInfo posts
|
||||||
fileContent = title <> "\n\n" <> articleList
|
fileContent = title
|
||||||
|
<> "\n\n" <> welcomeTxt
|
||||||
|
<> "\n\n" <> articleList
|
||||||
|
<> "\n\n" <> geminiMenu
|
||||||
writeFile' out (toS fileContent)
|
writeFile' out (toS fileContent)
|
||||||
|
|
||||||
postGeminiInfo :: BlogPost -> Text
|
postGeminiInfo :: BlogPost -> Text
|
||||||
|
@ -253,6 +270,7 @@ postamble now bp =
|
||||||
, "@@html:<i>Any comment? Click on my email below and I'll add it.</i>@@"
|
, "@@html:<i>Any comment? Click on my email below and I'll add it.</i>@@"
|
||||||
, ""
|
, ""
|
||||||
, "| author | @@html:<span class=\"author\">@@ [[mailto:Yann Esposito <yann@esposito.host>?subject=yblog: " <> (postTitle bp) <> "][Yann Esposito <yann@esposito.host>]] @@html:</span>@@ |"
|
, "| author | @@html:<span class=\"author\">@@ [[mailto:Yann Esposito <yann@esposito.host>?subject=yblog: " <> (postTitle bp) <> "][Yann Esposito <yann@esposito.host>]] @@html:</span>@@ |"
|
||||||
|
, "| gpg | [[file:files/publickey.txt][CB420F8005F1A662]] |"
|
||||||
, "| tags | " <> T.intercalate " " (map ("#"<>) (postTags bp)) <> " |"
|
, "| tags | " <> T.intercalate " " (map ("#"<>) (postTags bp)) <> " |"
|
||||||
, "| date | " <> postDate bp <> " |"
|
, "| date | " <> postDate bp <> " |"
|
||||||
, "| rss | [[file:/rss.xml][RSS]] ([[https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Fher.esy.fun%2Frss.xml][validate]]) |"
|
, "| rss | [[file:/rss.xml][RSS]] ([[https://validator.w3.org/feed/check.cgi?url=https%3A%2F%2Fher.esy.fun%2Frss.xml][validate]]) |"
|
||||||
|
@ -382,7 +400,7 @@ allGeminiAction :: Action ()
|
||||||
allGeminiAction = do
|
allGeminiAction = do
|
||||||
allOrgFiles <- getDirectoryFiles srcDir ["//*.org"]
|
allOrgFiles <- getDirectoryFiles srcDir ["//*.org"]
|
||||||
let allGeminiFiles = map (-<.> "gmi") allOrgFiles
|
let allGeminiFiles = map (-<.> "gmi") allOrgFiles
|
||||||
need (map build $ allGeminiFiles <> ["archive.gmi"])
|
need (map build $ allGeminiFiles <> ["index.gmi"])
|
||||||
|
|
||||||
compressImage :: FilePath -> Action ()
|
compressImage :: FilePath -> Action ()
|
||||||
compressImage img = do
|
compressImage img = do
|
||||||
|
@ -400,15 +418,16 @@ compressImage img = do
|
||||||
, "-quality","85"
|
, "-quality","85"
|
||||||
, "-define","filter:blur=0.75"
|
, "-define","filter:blur=0.75"
|
||||||
, "-filter","Gaussian"
|
, "-filter","Gaussian"
|
||||||
, "-ordered-dither","o4x4,4"
|
-- , "-ordered-dither","o4x4,4"
|
||||||
, dst ]
|
, dst ]
|
||||||
|
|
||||||
|
|
||||||
needFast :: Action ()
|
needFast :: Action ()
|
||||||
needFast = do
|
needFast = do
|
||||||
allAssets <- filter (/= ".DS_Store") <$> getDirectoryFiles srcDir ["**"]
|
allAssets <- filter (/= ".DS_Store") <$> getDirectoryFiles srcDir ["**"]
|
||||||
need (map build $ allAssets <> ["archive.html"])
|
need (map build $ allAssets <> ["index.html"])
|
||||||
allHtmlAction
|
allHtmlAction
|
||||||
|
allGeminiAction
|
||||||
|
|
||||||
fastRule :: Rules ()
|
fastRule :: Rules ()
|
||||||
fastRule =
|
fastRule =
|
||||||
|
|
|
@ -6,5 +6,21 @@ src="$1"
|
||||||
dst="$2"
|
dst="$2"
|
||||||
|
|
||||||
./engine/org2gemini_step1.sh "$src" | \
|
./engine/org2gemini_step1.sh "$src" | \
|
||||||
perl -pe 's#\[\[([^]]*)\]\[([^]]*)\]\]#\n=> $1 $2#g;s#=> file:([^ ]*)\.org#=> $1.gmi#g;s#\[\[(file:)?([^]]*)\]\]#=> $2#g;' | \
|
perl -pe 's#^email:\s+yann\@esposito.host\s*#$&=> /files/publickey.txt gpg\n#g;' | \
|
||||||
perl -pe 's#^\* *\n##' > "$dst"
|
perl -pe 's#\[\[([^]]*)\]\[([^]]*)\]\]#\n=> $1 $2#g;' | \
|
||||||
|
perl -pe 's#=> file:([^ ]*)\.org#=> $1.gmi#g;' | \
|
||||||
|
perl -pe 's#\[\[(file:)?([^]]*)\]\]#=> $2#g;' | \
|
||||||
|
perl -pe 's#^\* *\n##' | \
|
||||||
|
perl -pe 's#^\**[ ]*:.*:$##' | \
|
||||||
|
perl -pe 's#^\s[- ]*$##;' > "$dst"
|
||||||
|
|
||||||
|
{ echo ""
|
||||||
|
echo "=> /index.gmi Home"
|
||||||
|
echo "=> /gem-atom.xml Feed"
|
||||||
|
echo "=> /slides.gmi Slides"
|
||||||
|
echo "=> /about-me.gmi About"
|
||||||
|
echo ""
|
||||||
|
echo "=> https://gitea.esy.fun code"
|
||||||
|
echo "=> https://espial.esy.fun/u:yogsototh bookmarks"
|
||||||
|
echo "=> https://espial.esy.fun/u:yogsototh/notes notes"
|
||||||
|
} >> "$dst"
|
||||||
|
|
|
@ -6,15 +6,17 @@ BEGIN { IGNORECASE=1; }
|
||||||
|
|
||||||
/^#\+(BEGIN|END)_SRC ?/i { gsub(/#\+(BEGIN|END)_SRC ?/,"```"); }
|
/^#\+(BEGIN|END)_SRC ?/i { gsub(/#\+(BEGIN|END)_SRC ?/,"```"); }
|
||||||
/^#\+(BEGIN|END)_[^ ]* ?/i { gsub(/#\+(BEGIN|END)_([^ ]*) ?/,"______"); }
|
/^#\+(BEGIN|END)_[^ ]* ?/i { gsub(/#\+(BEGIN|END)_([^ ]*) ?/,"______"); }
|
||||||
|
|
||||||
|
/^#\+(macro|lang|language|options|startup):/ { skip=1; }
|
||||||
|
/{{{br}}}/ { gsub(/{{{br}}}/,""); }
|
||||||
|
/{{{pemail}}}/ { gsub(/{{{pemail}}}/,"yann@esposito.host"); }
|
||||||
|
|
||||||
/^#\+TITLE: / { gsub(/^#[^:]*: /,"# "); }
|
/^#\+TITLE: / { gsub(/^#[^:]*: /,"# "); }
|
||||||
/^ *:[a-zA-Z_0-9]*:/ { skip=1; }
|
/^ *:[a-zA-Z_0-9]*:/ { skip=1; }
|
||||||
/^\* / { gsub(/^\* /,"# "); }
|
/^\* / { gsub(/^\* /,"# "); }
|
||||||
/^\*\* / { gsub(/^\*\* /,"## "); }
|
/^\*\* / { gsub(/^\*\* /,"## "); }
|
||||||
/^\*\*\* / { gsub(/^\*\*\* /,"### "); }
|
/^\*\*\* / { gsub(/^\*\*\* /,"### "); }
|
||||||
|
|
||||||
/^#\+(macro|lang|language|options|startup):/ { skip=1; }
|
|
||||||
/{{{br}}}/ { gsub(/{{{br}}}/,""); }
|
|
||||||
/{{{pemail}}}/ { gsub(/{{{pemail}}}/,"yann@esposito.host"); }
|
|
||||||
/@@html:/ { htmlskip = 1; }
|
/@@html:/ { htmlskip = 1; }
|
||||||
|
|
||||||
!skip && /^#\+([^:]*):/ {
|
!skip && /^#\+([^:]*):/ {
|
||||||
|
@ -29,3 +31,4 @@ BEGIN { IGNORECASE=1; }
|
||||||
print;
|
print;
|
||||||
}
|
}
|
||||||
/@@/ && !/@@html:/ { htmlskip = 0; }
|
/@@/ && !/@@html:/ { htmlskip = 0; }
|
||||||
|
/@@$/ { htmlskip = 0; }
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
@@html:<nav>
|
@@html:<nav>
|
||||||
<a href="/index.html">Home</a> |
|
<a href="/index.html">Home</a> |
|
||||||
<a href="/archive.html">Posts</a> |
|
|
||||||
<a href="/slides.html">Slides</a> |
|
<a href="/slides.html">Slides</a> |
|
||||||
<a href="/about-me.html">About</a>
|
<a href="/about-me.html">About</a>
|
||||||
<span class="details">
|
<span class="details">
|
||||||
|
@ -20,13 +19,13 @@
|
||||||
</nav>@@
|
</nav>@@
|
||||||
|
|
||||||
#+begin_notes
|
#+begin_notes
|
||||||
*Sorry for the late reply.*
|
If you are still waiting a reply from me.
|
||||||
|
Don't take it personally.
|
||||||
After reading Digital Minimalism[fn:dm] I decided to drastically protect
|
After reading Digital Minimalism[fn:dm] I decided to drastically protect
|
||||||
myself against most real-time notifications.
|
myself against most real-time notifications.
|
||||||
|
|
||||||
I try to look at my email everyday.
|
I try to look at my email everyday.
|
||||||
But sometime a few days could go without me checking them.
|
But it is not unusual I can skip a few days without checking any notification.
|
||||||
|
|
||||||
So I'll answer, it can just take a lot of time.
|
So I'll answer, it can just take a lot of time.
|
||||||
|
|
||||||
|
@ -44,17 +43,24 @@ This will certainly be the best way for me to notice you among notifications.
|
||||||
#+MACRO: pemail @@html: <a href="mailto:yann@esposito.host">Yann Esposito <yann@esposito.host></a>@@
|
#+MACRO: pemail @@html: <a href="mailto:yann@esposito.host">Yann Esposito <yann@esposito.host></a>@@
|
||||||
|
|
||||||
|
|
||||||
| email | {{{pemail}}} |
|
- email: {{{pemail}}}
|
||||||
| gpg | [[file:files/publickey.txt][CB420F8005F1A662]] |
|
- gpg: [[file:files/publickey.txt][CB420F8005F1A662]]
|
||||||
|
|
||||||
| | self-hosted | web |
|
** Social
|
||||||
|----------------+------------------+----------------------|
|
:PROPERTIES:
|
||||||
| programs | [[https://gitea.esy.fun/yogsototh][gitea.esy.fun]] | [[https://github.com/yogsototh][github/yogsototh]] |
|
:CUSTOM_ID: social
|
||||||
| bookmarks | [[https://espial.esy.fun/u:yogsototh][espial.esy.fun]] | [[https://pinboard.in/u:yogsototh][pinboard/u:yogsototh]] |
|
:END:
|
||||||
| microblog | [[https://espial.esy.fun/u:yogsototh/notes][espial.esy.fun]] | [[https://twitter.com/yogsototh][twitter/@yogsototh]] |
|
|
||||||
| lobste.rs | . . . . . . . . | [[https://lobste.rs/u/yogsototh][/u/yogsototh]] |
|
- github: [[https://github.com/yogsototh][github/yogsototh]]
|
||||||
| reddit | . . . . . . . . | [[https://reddit.com/u/yogsototh][/u/yogsototh]] |
|
- my bookmarks: [[https://pinboard.in/u:yogsototh][pinboard/u:yogsototh]]
|
||||||
| stack overflow | . . . . . . . . | [[https://stackoverflow.com/users/40569/yogsototh][yogsototh]] |
|
- microblog: [[https://twitter.com/yogsototh][@yogsototh]]
|
||||||
|
- lobste.rs: [[https://lobste.rs/u/yogsototh][/u/yogsototh]]
|
||||||
|
|
||||||
|
With some self-hosted alternatives:
|
||||||
|
|
||||||
|
- code: [[https://gitea.esy.fun/yogsototh][gitea.esy.fun]]
|
||||||
|
- bookmarks: [[https://espial.esy.fun/u:yogsototh][espial.esy.fun]]
|
||||||
|
- microblog: [[https://espial.esy.fun/u:yogsototh/notes][espial.esy.fun]]
|
||||||
|
|
||||||
* Who am I?
|
* Who am I?
|
||||||
:PROPERTIES:
|
:PROPERTIES:
|
||||||
|
|
|
@ -8,7 +8,6 @@
|
||||||
|
|
||||||
@@html:<nav>
|
@@html:<nav>
|
||||||
<a href="/index.html">Home</a> |
|
<a href="/index.html">Home</a> |
|
||||||
<a href="/archive.html">Posts</a> |
|
|
||||||
<a href="/slides.html">Slides</a> |
|
<a href="/slides.html">Slides</a> |
|
||||||
<a href="/about-me.html">About</a>
|
<a href="/about-me.html">About</a>
|
||||||
<span class="details">
|
<span class="details">
|
||||||
|
|
|
@ -1,64 +0,0 @@
|
||||||
#+TITLE: Yann Esposito's Website
|
|
||||||
#+KEYWORDS: programming
|
|
||||||
#+AUTHOR: Yann Esposito
|
|
||||||
#+EMAIL: yann@esposito.host
|
|
||||||
#+LANGUAGE: en
|
|
||||||
#+LANG: en
|
|
||||||
#+OPTIONS: H:5
|
|
||||||
#+STARTUP: showeverything
|
|
||||||
#+MACRO: br @@html:<br/>@@
|
|
||||||
#+MACRO: pemail @@html: <a href="mailto:yann@esposito.host">Yann Esposito <yann@esposito.host></a>@@
|
|
||||||
|
|
||||||
|
|
||||||
@@html:<nav>
|
|
||||||
<a href="/index.html">Home</a> |
|
|
||||||
<a href="/archive.html">Posts</a> |
|
|
||||||
<a href="/slides.html">Slides</a> |
|
|
||||||
<a href="/about-me.html">About</a>
|
|
||||||
<span class="details">
|
|
||||||
(<a href="https://gitea.esy.fun/yogsototh">code</a>
|
|
||||||
<a href="https://espial.esy.fun/u:yogsototh">bookmarks</a>
|
|
||||||
<a href="https://espial.esy.fun/u:yogsototh/notes">notes</a>)
|
|
||||||
</span>
|
|
||||||
</nav>@@
|
|
||||||
|
|
||||||
I'm a functional programmer, working remotely for Cisco.{{{br}}}
|
|
||||||
I work in Clojure and use Haskell/Purescript during the weekends.
|
|
||||||
|
|
||||||
- [[file:archive.org][blog posts]]
|
|
||||||
- [[https://her.esy.fun/rss.xml][RSS]]
|
|
||||||
- [[file:slides.org][talks slides]]
|
|
||||||
|
|
||||||
** About this website
|
|
||||||
|
|
||||||
That website was created with the following constraints in mind by order of
|
|
||||||
priority:
|
|
||||||
|
|
||||||
1. *Respect Privacy*; no tracker of any sort (no ads, no google analytics, no
|
|
||||||
referrer for all external links, etc...)
|
|
||||||
2. *javascript free*; no js at all (math is rendered with MathML).
|
|
||||||
3. *Accessibility*; should be easy to read on a text browser so people with
|
|
||||||
disabilities could easily consume it.
|
|
||||||
4. *RSS*; you should be able to get informed when I add a new blog post.
|
|
||||||
5. *Frugal*; try to minimize the resources needed to visit my website; no
|
|
||||||
javascript, no web-font, not too much CSS magic, not much images or really
|
|
||||||
compressed one. Theme switcher to have a dark-mode (no js involved).
|
|
||||||
** My Internet Identity
|
|
||||||
|
|
||||||
| email | {{{pemail}}} |
|
|
||||||
| gpg | [[file:files/publickey.txt][CB420F8005F1A662]] |
|
|
||||||
|
|
||||||
| | self-hosted | web |
|
|
||||||
|----------------+-----------------+----------------------|
|
|
||||||
| code | [[https://gitea.esy.fun/yogsototh][gitea.esy.fun]] | [[https://github.com/yogsototh][github/yogsototh]] |
|
|
||||||
| my bookmarks | [[https://espial.esy.fun/u:yogsototh][espial.esy.fun]] | [[https://pinboard.in/u:yogsototh][pinboard/u:yogsototh]] |
|
|
||||||
| micro-blog | [[https://espial.esy.fun/u:yogsototh/notes][espial.esy.fun]] | [[https://twitter.com/yogsototh][twitter/@yogsototh]] |
|
|
||||||
| hn | . . . . . . . . | [[https://news.ycombinator.com/user?id=yogsototh][yogsototh]] |
|
|
||||||
| lobste.rs | . . . . . . . . | [[https://lobste.rs/u/yogsototh][/u/yogsototh]] |
|
|
||||||
| reddit | . . . . . . . . | [[https://reddit.com/u/yogsototh][/u/yogsototh]] |
|
|
||||||
| stack overflow | . . . . . . . . | [[https://stackoverflow.com/users/40569/yogsototh][yogsototh]] |
|
|
||||||
|
|
||||||
** Gemini
|
|
||||||
|
|
||||||
- [[gemini://her.esy.fun][gemlog]]
|
|
||||||
- [[gemini://her.esy.fun/gem-atom.xml][gemini atom]]
|
|
|
@ -1,6 +1,5 @@
|
||||||
<nav>
|
<nav>
|
||||||
<a href="/index.html">Home</a> |
|
<a href="/index.html">Home</a> |
|
||||||
<a href="/archive.html">Posts</a> |
|
|
||||||
<a href="/slides.html">Slides</a> |
|
<a href="/slides.html">Slides</a> |
|
||||||
<a href="/about-me.html">About</a>
|
<a href="/about-me.html">About</a>
|
||||||
<span class="details"> (<a href="https://gitea.esy.fun/yogsototh">code</a>
|
<span class="details"> (<a href="https://gitea.esy.fun/yogsototh">code</a>
|
||||||
|
|
Loading…
Reference in a new issue