removed archive

This commit is contained in:
Yann Esposito (Yogsototh) 2020-11-22 10:31:04 +01:00
parent d5a574ba0e
commit 5de898d7a2
Signed by untrusted user who does not match committer: yogsototh
GPG Key ID: 7B19A4C650D59646
7 changed files with 75 additions and 97 deletions

View File

@ -113,13 +113,10 @@ getBlogpostFromMetas path toc pandoc@(Pandoc meta _) = do
inlineToTxt (Str t) = t
inlineToTxt _ = ""
sortByPostDate :: [BlogPost] -> [BlogPost]
sortByPostDate =
sortBy (\a b-> compare (postDate b) (postDate a))
build :: FilePath -> FilePath
build = (</>) siteDir
@ -145,7 +142,7 @@ buildRules = do
let asset = dropDirectory1 out
case (takeExtension asset) of
".html" -> do
if out == siteDir </> "archive.html"
if out == siteDir </> "index.html"
then buildArchive getPosts getTemplate out
else genHtmlAction getPost getTemplate out
".pdf" -> do
@ -157,7 +154,7 @@ buildRules = do
fileExists <- doesFileExist (srcDir </> asset)
if fileExists
then copyFileChanged (srcDir </> asset) out
else if out == siteDir </> "archive.gmi"
else if out == siteDir </> "index.gmi"
then buildGeminiArchive getPosts out
else genGeminiAction out
".jpg" -> compressImage asset
@ -169,6 +166,11 @@ buildRules = do
needAll
command_[] "engine/pre-deploy.sh" []
welcomeTxt :: Text
welcomeTxt = toS $ T.intercalate "\n" $
[ "Welcome to my small place on the Internet."
]
buildArchive
:: (() -> Action [BlogPost])
-> (FilePath -> Action Template) -> [Char] -> Action ()
@ -178,9 +180,9 @@ buildArchive getPosts getTemplate out = do
need $ css <> map postSrc posts
let
title :: Text
title = "#+title: Posts"
title = "#+title: Yann Esposito's blog"
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)
bp <- case eitherResult of
Left _ -> fail "BAD"
@ -198,6 +200,18 @@ buildArchive getPosts getTemplate out = do
]
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
:: (() -> Action [BlogPost])
-> [Char] -> Action ()
@ -206,9 +220,12 @@ buildGeminiArchive getPosts out = do
need $ map postSrc posts
let
title :: Text
title = "# Posts"
title = "# Yann Esposito's 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)
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>@@"
, ""
, "| 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)) <> " |"
, "| 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]]) |"
@ -382,7 +400,7 @@ allGeminiAction :: Action ()
allGeminiAction = do
allOrgFiles <- getDirectoryFiles srcDir ["//*.org"]
let allGeminiFiles = map (-<.> "gmi") allOrgFiles
need (map build $ allGeminiFiles <> ["archive.gmi"])
need (map build $ allGeminiFiles <> ["index.gmi"])
compressImage :: FilePath -> Action ()
compressImage img = do
@ -400,15 +418,16 @@ compressImage img = do
, "-quality","85"
, "-define","filter:blur=0.75"
, "-filter","Gaussian"
, "-ordered-dither","o4x4,4"
-- , "-ordered-dither","o4x4,4"
, dst ]
needFast :: Action ()
needFast = do
allAssets <- filter (/= ".DS_Store") <$> getDirectoryFiles srcDir ["**"]
need (map build $ allAssets <> ["archive.html"])
need (map build $ allAssets <> ["index.html"])
allHtmlAction
allGeminiAction
fastRule :: Rules ()
fastRule =

View File

@ -6,5 +6,21 @@ src="$1"
dst="$2"
./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#^\* *\n##' > "$dst"
perl -pe 's#^email:\s+yann\@esposito.host\s*#$&=> /files/publickey.txt gpg\n#g;' | \
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"

View File

@ -6,15 +6,17 @@ BEGIN { IGNORECASE=1; }
/^#\+(BEGIN|END)_SRC ?/i { gsub(/#\+(BEGIN|END)_SRC ?/,"```"); }
/^#\+(BEGIN|END)_[^ ]* ?/i { gsub(/#\+(BEGIN|END)_([^ ]*) ?/,"______"); }
/^#\+(macro|lang|language|options|startup):/ { skip=1; }
/{{{br}}}/ { gsub(/{{{br}}}/,""); }
/{{{pemail}}}/ { gsub(/{{{pemail}}}/,"yann@esposito.host"); }
/^#\+TITLE: / { gsub(/^#[^:]*: /,"# "); }
/^ *:[a-zA-Z_0-9]*:/ { skip=1; }
/^\* / { gsub(/^\* /,"# "); }
/^\*\* / { gsub(/^\*\* /,"## "); }
/^\*\*\* / { gsub(/^\*\*\* /,"### "); }
/^#\+(macro|lang|language|options|startup):/ { skip=1; }
/{{{br}}}/ { gsub(/{{{br}}}/,""); }
/{{{pemail}}}/ { gsub(/{{{pemail}}}/,"yann@esposito.host"); }
/@@html:/ { htmlskip = 1; }
!skip && /^#\+([^:]*):/ {
@ -29,3 +31,4 @@ BEGIN { IGNORECASE=1; }
print;
}
/@@/ && !/@@html:/ { htmlskip = 0; }
/@@$/ { htmlskip = 0; }

View File

@ -9,7 +9,6 @@
@@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">
@ -20,13 +19,13 @@
</nav>@@
#+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
myself against most real-time notifications.
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.
@ -44,17 +43,24 @@ This will certainly be the best way for me to notice you among notifications.
#+MACRO: pemail @@html: <a href="&#109;&#97;&#105;&#x6C;&#116;&#111;&#x3A;&#x79;&#x61;&#x6E;&#x6E;&#64;&#x65;&#x73;&#112;&#x6F;&#x73;&#105;&#x74;&#x6F;&#x2E;&#x68;&#x6F;&#x73;&#x74;">&#x59;&#x61;&#x6E;&#x6E;&#x20;&#x45;&#x73;&#x70;&#x6F;&#115;&#x69;&#116;&#x6F; &lt;&#x79;&#x61;&#x6E;&#x6E;&#64;&#x65;&#x73;&#112;&#x6F;&#x73;&#105;&#x74;&#x6F;&#x2E;&#x68;&#x6F;&#x73;&#x74;&gt;</a>@@
| email | {{{pemail}}} |
| gpg | [[file:files/publickey.txt][CB420F8005F1A662]] |
- email: {{{pemail}}}
- gpg: [[file:files/publickey.txt][CB420F8005F1A662]]
| | self-hosted | web |
|----------------+------------------+----------------------|
| programs | [[https://gitea.esy.fun/yogsototh][gitea.esy.fun]] | [[https://github.com/yogsototh][github/yogsototh]] |
| bookmarks | [[https://espial.esy.fun/u:yogsototh][espial.esy.fun]] | [[https://pinboard.in/u:yogsototh][pinboard/u:yogsototh]] |
| 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]] |
| reddit | . . . . . . . . | [[https://reddit.com/u/yogsototh][/u/yogsototh]] |
| stack overflow | . . . . . . . . | [[https://stackoverflow.com/users/40569/yogsototh][yogsototh]] |
** Social
:PROPERTIES:
:CUSTOM_ID: social
:END:
- github: [[https://github.com/yogsototh][github/yogsototh]]
- my bookmarks: [[https://pinboard.in/u:yogsototh][pinboard/u: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?
:PROPERTIES:

View File

@ -8,7 +8,6 @@
@@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">

View File

@ -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="&#109;&#97;&#105;&#x6C;&#116;&#111;&#x3A;&#x79;&#x61;&#x6E;&#x6E;&#64;&#x65;&#x73;&#112;&#x6F;&#x73;&#105;&#x74;&#x6F;&#x2E;&#x68;&#x6F;&#x73;&#x74;">&#x59;&#x61;&#x6E;&#x6E;&#x20;&#x45;&#x73;&#x70;&#x6F;&#115;&#x69;&#116;&#x6F; &lt;&#x79;&#x61;&#x6E;&#x6E;&#64;&#x65;&#x73;&#112;&#x6F;&#x73;&#105;&#x74;&#x6F;&#x2E;&#x68;&#x6F;&#x73;&#x74;&gt;</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]]

View File

@ -1,6 +1,5 @@
<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>