robertodr / totaltrash.xyz

Record Pijul SHA

By Roberto Di Remigio on March 9, 2019
This patch is not signed.
9EdqYMtD1AVmfmFDrxS4EERswiCRkftboJUwnbSXXoXgpHsYGQFMRjNYPn4GkLAwjJqQ9L1UYkutEibNpVFMgeK5
This patch is in the following branches:
master
In file .pijulignore
6
7
8
9
10
11
css/style.css
serve-totaltrash.xyz
cv/auto/

# Contains the SHA
.pijulinfo
In file Makefile
1
2

3
4
5
6
7
PIJULSHA := $(shell find .pijul/patches -type f -exec stat -c "%y %n" '{}' + | sort -r | head -n 1 | cut -d ' ' -f4 | xargs basename --suffix '.sig')

build: css/style.css
get-pijul-info:
	echo $(PIJULSHA) > .pijulinfo

build: get-pijul-info css/style.css
	stack build ${SOPTS}
In file app/Main.hs
24
25

26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44

45
46
47
48
49
50
51
52


53
54
55
56
57
58
59
60

61
62


63
64
65
66
67
68
69
70
71
72


73
74
75
main :: IO ()
main = do
  let lthmsCtx = mkLthmsCtx "1234567890abcdefghilmnopqrstuvz"
  piHash <- readFile ".pijulinfo"
  let totalTrashCtx = mkTotalTrashCtx piHash
  hakyll $ do
    match
      ("vendor/**" .||. "images/**" .||. "CNAME" .||. "favicon.png" .||.
       "css/style.css" .||.
       "keybase.txt" .||.
       "googlebdd3afcf40d8a945.html" .||.
       "robots.txt" .||.
       "sitemap.xml") $ do
      route idRoute
      compile copyFileCompiler
    match "templates/**" $ compile templateCompiler
    match "assets/*.bib" $ compile biblioCompiler
    match "assets/*.csl" $ compile cslCompiler
    match "index.html" $ do
      route idRoute
      compile $ do
        posts <- loadAll "blog/**" >>= recentFirst
        let ctx = listField "blog" postCtx (return posts) <> lthmsCtx
        let ctx = listField "blog" postCtx (return posts) <> totalTrashCtx
        getResourceBody >>= applyAsTemplate ctx >>=
          loadAndApplyTemplate "templates/default.html" ctx >>=
          relativizeUrls
    match "blog/**" $ do
      route articleRoute
      compile $
        pandocBiblioCompiler' >>= saveSnapshot "content" >>=
        loadAndApplyTemplate "templates/page.html" lthmsCtx >>=
        loadAndApplyTemplate "templates/default.html" lthmsCtx >>=
        loadAndApplyTemplate "templates/page.html" totalTrashCtx >>=
        loadAndApplyTemplate "templates/default.html" totalTrashCtx >>=
        relativizeUrls
    create ["rss"] $ do
      route idRoute
      compile $ do
        let feedCtx = defaultContext <> bodyField "description"
        posts <- loadAllSnapshots "blog/**" "content" >>= recentFirst
        renderRss lthmsFeed feedCtx posts
        renderRss totalTrashFeed feedCtx posts

lthmsFeed :: FeedConfiguration
lthmsFeed =
totalTrashFeed :: FeedConfiguration
totalTrashFeed =
  FeedConfiguration
    { feedTitle = "~totaltrash"
    , feedDescription = "It's total trash."
    , feedAuthorName = "Roberto Di Remigio"
    , feedAuthorEmail = "roberto.diremigio@gmail.com"
    , feedRoot = "totaltrash.xyz"
    }

mkLthmsCtx :: String -> Context String
mkLthmsCtx hash = constField "long" hash
mkTotalTrashCtx :: String -> Context String
mkTotalTrashCtx hash = constField "long" hash
                  <> constField "short" (take 7 hash)
13
14
15

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

37
38
39
40
41
42
43
44
45
46
47









48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69

70
71
    <script src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-MML-AM_CHTML' async />
     <script defer src="https://use.fontawesome.com/releases/v5.7.2/js/all.js" integrity="sha384-0pzryjIRos8mFBWMzSSZApWtPl/5++eIfzYmTgBBmXYdhvxPc+XcFEk+zJwDgWbP" crossorigin="anonymous"></script>
    <link rel="stylesheet" href="/vendor/normalize.css" />
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
    <link rel="stylesheet" href="/css/style.css" />
    <title>
      totaltrash.xyz
      $if(title)$
      – $title$
      $endif$
    </title>
  </head>
  <body>
    <main>
      <article>
        $body$
      </article>

    <aside>
      <h1>
      $title$
      </h1>

      <div class="abstract">
        $if(abstract)$
        <i class="fa fa-angle-double-right fa-3x fa-pull-left" aria-hidden="true"></i>
        <i class="fas fa-angle-double-right fa-3x fa-pull-left" aria-hidden="true"></i>
        $abstract$
        $endif$
      </div>

      <nav id="toc">
      </nav>

      <hr />

      <ul class="fa-ul">
        <li> <i class="fa-li fa fa-rss"></i> Want to be kept
        posted? <a href="/rss">There is a RSS feed </a> for that! </li>
        <li> <i class="fa-li fa fa-crow"></i> The source of this website
        is available on the Pijul Nest <a href="https://nest.pijul.com/robertodr/totaltrash.xyz">under the
        terms of the AGPLv3</a>.
        Found a mistake? <a href="mailto:roberto.diremigio@gmail.com">Shoot an
        email</a>!  (with <a href="https://man.sr.ht/git.sr.ht/send-email.md">a
        patch</a>
        maybe?)</li>
          <li><span class="fa-li" ><i class="fas fa-rss"></i></span>
              Want to be kept posted? <a href="/rss">There is a RSS feed </a> for that!
          </li>
          <li><span class="fa-li" ><i class="fas fa-crow"></i></span>
              The source of this website is available on the Pijul Nest <a
              href="https://nest.pijul.com/robertodr/totaltrash.xyz">under the
              terms of the AGPLv3</a>. Found a mistake? <a
              href="mailto:roberto.diremigio@gmail.com">Shoot an email</a>! (with
              <a href="https://man.sr.ht/git.sr.ht/send-email.md">a patch</a>
              maybe?)
          </li>
      </ul>
    </aside>
    <aside>
     <img src="/images/me-by-ilsignorm.png" width="300px">
    </aside>
    </main>

    <footer>
      <p>
        <i class="fas fa-crow"></i>
        <a href="https://nest.pijul.com/robertodr/totaltrash.xyz:master/patches/$long$">
           https://nest.pijul.com/robertodr/totaltrash.xyz@$short$
          @$short$
        </a>