Browse Source

Initial commit

Thorn Avery 6 months ago
commit
b1b9a4243e
21 changed files with 590 additions and 0 deletions
  1. 24
    0
      .gitignore
  2. 5
    0
      ChangeLog.md
  3. 30
    0
      LICENSE
  4. 73
    0
      README.md
  5. 2
    0
      Setup.hs
  6. 34
    0
      about.md
  7. 9
    0
      archive.md
  8. 9
    0
      contact.md
  9. 138
    0
      css/default.css
  10. 12
    0
      default.nix
  11. 10
    0
      humans.txt
  12. 12
    0
      index.html
  13. 42
    0
      posts/things-i-like.md
  14. 27
    0
      rf.cabal
  15. 4
    0
      rf.nix
  16. 106
    0
      site.hs
  17. 2
    0
      templates/archive.html
  18. 32
    0
      templates/default.html
  19. 1
    0
      templates/post-item.html
  20. 7
    0
      templates/post-list.html
  21. 11
    0
      templates/post.html

+ 24
- 0
.gitignore View File

@@ -0,0 +1,24 @@
1
+dist
2
+dist-*
3
+cabal-dev
4
+*.o
5
+*.hi
6
+*.chi
7
+*.chs.h
8
+*.dyn_o
9
+*.dyn_hi
10
+.hpc
11
+.hsenv
12
+.cabal-sandbox/
13
+cabal.sandbox.config
14
+*.prof
15
+*.aux
16
+*.hp
17
+*.eventlog
18
+.stack-work/
19
+cabal.project.local
20
+cabal.project.local~
21
+.HTF/
22
+.ghc.environment.*
23
+_site/
24
+_cache/

+ 5
- 0
ChangeLog.md View File

@@ -0,0 +1,5 @@
1
+# Revision history for rf
2
+
3
+## 0.1.0.0  -- 2018-08-18
4
+
5
+* First version, counting from when I got around to putting it on git.

+ 30
- 0
LICENSE View File

@@ -0,0 +1,30 @@
1
+Copyright (c) 2018, Shaun Kerr
2
+
3
+All rights reserved.
4
+
5
+Redistribution and use in source and binary forms, with or without
6
+modification, are permitted provided that the following conditions are met:
7
+
8
+    * Redistributions of source code must retain the above copyright
9
+      notice, this list of conditions and the following disclaimer.
10
+
11
+    * Redistributions in binary form must reproduce the above
12
+      copyright notice, this list of conditions and the following
13
+      disclaimer in the documentation and/or other materials provided
14
+      with the distribution.
15
+
16
+    * Neither the name of Shaun Kerr nor the names of other
17
+      contributors may be used to endorse or promote products derived
18
+      from this software without specific prior written permission.
19
+
20
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ 73
- 0
README.md View File

@@ -0,0 +1,73 @@
1
+# Regular Flolloping
2
+
3
+tA's Blog
4
+
5
+## Getting Started
6
+
7
+What you need to get the generator up and running.
8
+
9
+### Prerequisites
10
+
11
+Assumes you have Cabal and Nix.  
12
+Nix can be installed with:  
13
+```
14
+curl https://nixos.org/nix/install | sh
15
+```  
16
+And Cabal can be installed with your package manager of choice.
17
+
18
+### Installing
19
+
20
+Enter the build environment
21
+
22
+```
23
+nix-shell --attr env rf.nix
24
+```
25
+
26
+Compile the generator
27
+
28
+```
29
+cabal build
30
+```
31
+
32
+Generate the site
33
+
34
+```
35
+cabal run site clean
36
+cabal run site build
37
+```
38
+
39
+And test it out
40
+
41
+```
42
+cabal run site watch
43
+```
44
+
45
+The site will now be avaliable at `localhost:8000`
46
+
47
+## Deployment
48
+
49
+Site will be completely static, so simply point your server to the `_site` directory
50
+
51
+## Built With
52
+
53
+* [Hakyll](https://jaspervdj.be) - The web framework used
54
+* [Nix](https://nixos.org) - Package Management
55
+* [Cabal](https://cabal.readthedocs.io) - Build System
56
+
57
+## Versioning
58
+
59
+Is very airy fairy and mainly based on what I think constitutes major / minor updates.
60
+
61
+## Authors
62
+
63
+* **Shaun Kerr** - [tA](https://github.com/techieAgnostic)
64
+
65
+## License
66
+
67
+This project is licensed under the BSD3 License - see the [LICENSE.md](LICENSE.md) file for details
68
+
69
+## Acknowledgments
70
+
71
+* Hakyll for having an incredible default, of which 90% was kept
72
+* Douglas Adam's for providing the name
73
+* You, for reading this :)

+ 2
- 0
Setup.hs View File

@@ -0,0 +1,2 @@
1
+import Distribution.Simple
2
+main = defaultMain

+ 34
- 0
about.md View File

@@ -0,0 +1,34 @@
1
+---
2
+title: About
3
+---
4
+
5
+what is **Regular Flolloping**?  
6
+
7
+# jokingly
8
+**Regular Flolloping** is:
9
+
10
+* my blog
11
+* filled with armchair psychology
12
+* filled with bad opinions on tech
13
+* something mattresses need to do
14
+
15
+# technically
16
+**Regular Flolloping** is:
17
+
18
+* powered by [Hakyll](https://jaspervdj.be/hakyll/)
19
+* running on [Digital Ocean](https://www.digitalocean.com/)
20
+* sourced from [GitHub](https://github.com)
21
+* probably badly written
22
+
23
+# pretensiously
24
+**Regular Flolloping** is **Layer 03** of the [Protocol Seven System](https://p7.co.nz)
25
+
26
+**Layer 03**, also known as **Psyche**
27
+
28
+the complexities of the human brain through the medium of text,  
29
+a carefully and oft not-so-carefully curated mask for the identity that is **tA**,  
30
+a slight variation of common knowledge,  
31
+yet of more importance than the content,  
32
+the characterisation of the reaction to said knowledge
33
+
34
+> If you use Psyche as a processor, you're missing the point. ~ *layer03::Psyche*

+ 9
- 0
archive.md View File

@@ -0,0 +1,9 @@
1
+you access archives and find:
2
+
3
+* An [SSL Endorsement](https://netrunnerdb.com/en/card/21038)
4
+* A [Degree Mill](https://netrunnerdb.com/en/card/21055)
5
+* A [15 Minutes](https://netrunnerdb.com/en/card/09004)
6
+
7
+and make me very sad.
8
+
9
+you also find all of this junk:

+ 9
- 0
contact.md View File

@@ -0,0 +1,9 @@
1
+---
2
+title: Contact
3
+---
4
+
5
+* email me at [s@p7.co.nz](mailto:s@p7.co.nz)
6
+* come chill at **#scoots** on [ServerChan](https://p7.co.nz/layer08/)
7
+* if you see a **tA**, **techieAgnostic** or anything in the form of **t\*A\*** on irc its probably me
8
+* i hang out on [Ocean Lounge](https://discord.gg/0oqynmoeGIUO49rW) a fair bit
9
+* if you're an [urbit](https://urbit.org) i'm occasionally on as **~bannum-magtus**

+ 138
- 0
css/default.css View File

@@ -0,0 +1,138 @@
1
+html {
2
+  font-size: 62.5%;
3
+}
4
+
5
+body {
6
+  font-size: 1.6rem;
7
+  color: #000;
8
+}
9
+
10
+header {
11
+  border-bottom: 0.2rem solid #000;
12
+}
13
+
14
+nav {
15
+  text-align: right;
16
+}
17
+
18
+nav a {
19
+  font-size: 1.8rem;
20
+  font-weight: bold;
21
+  color: black;
22
+  text-decoration: none;
23
+  text-transform: uppercase;
24
+}
25
+
26
+footer {
27
+  margin-top: 3rem;
28
+  padding: 1.2rem 0;
29
+  border-top: 0.2rem solid #000;
30
+  font-size: 1.2rem;
31
+  color: #555;
32
+}
33
+
34
+h1 {
35
+  font-size: 2.4rem;
36
+}
37
+
38
+h2 {
39
+  font-size: 2rem;
40
+}
41
+
42
+article .header {
43
+  font-size: 1.4rem;
44
+  font-style: italic;
45
+  color: #555;
46
+}
47
+
48
+.logo a {
49
+  font-weight: bold;
50
+  font-size: 3.4rem;
51
+  color: #000;
52
+  text-decoration: none;
53
+}
54
+
55
+@media (max-width: 319px) {
56
+  body {
57
+    width: 90%;
58
+    margin: 0;
59
+    padding: 0 5%;
60
+  }
61
+  header {
62
+    margin: 4.2rem 0;
63
+  }
64
+  nav {
65
+    margin: 0 auto 3rem;
66
+    text-align: center;
67
+  }
68
+  footer {
69
+    text-align: center;
70
+  }
71
+  .logo {
72
+    text-align: center;
73
+    margin: 1rem auto 3rem;
74
+  }
75
+  .logo a {
76
+  }
77
+  nav a {
78
+    display: block;
79
+    line-height: 1.6;
80
+  }
81
+}
82
+
83
+@media (min-width: 320px) {
84
+  body {
85
+    width: 90%;
86
+    margin: 0;
87
+    padding: 0 5%;
88
+  }
89
+  header {
90
+    margin: 4.2rem 0;
91
+  }
92
+  nav {
93
+    margin: 0 auto 3rem;
94
+    text-align: center;
95
+  }
96
+  footer {
97
+    text-align: center;
98
+  }
99
+  .logo {
100
+    text-align: center;
101
+    margin: 1rem auto 3rem;
102
+  }
103
+  .logo a {
104
+  }
105
+  nav a {
106
+    display: inline;
107
+    margin: 0 0.6rem;
108
+  }
109
+}
110
+
111
+@media (min-width: 640px) {
112
+  body {
113
+    width: 60rem;
114
+    margin: 0 auto;
115
+    padding: 0;
116
+  }
117
+  header {
118
+    margin: 0 0 3rem;
119
+    padding: 1.2rem 0;
120
+  }
121
+  nav {
122
+    margin: 0 auto 3rem;
123
+    text-align: center;
124
+  }
125
+  footer {
126
+    text-align: center;
127
+  }
128
+  .logo {
129
+    text-align: center;
130
+    margin: 1rem auto 3rem;
131
+  }
132
+  .logo a {
133
+  }
134
+  nav a {
135
+    display: inline;
136
+    margin: 0 0.6rem;
137
+  }
138
+}

+ 12
- 0
default.nix View File

@@ -0,0 +1,12 @@
1
+{ mkDerivation, base, filepath, hakyll, stdenv }:
2
+mkDerivation {
3
+  pname = "rf";
4
+  version = "0.1.0.0";
5
+  src = ./.;
6
+  isLibrary = false;
7
+  isExecutable = true;
8
+  executableHaskellDepends = [ base filepath hakyll ];
9
+  homepage = "regularflolloping.com";
10
+  description = "tA's blog";
11
+  license = stdenv.lib.licenses.bsd3;
12
+}

+ 10
- 0
humans.txt View File

@@ -0,0 +1,10 @@
1
+==
2
+= humans.txt for regularflolloping.com
3
+==
4
+
5
+my name is shaun and i am a human
6
+i usually go by either tA, techieAgnostic, or some name of the form t*A*
7
+my email is s@p7.co.nz and it is functioning at least 30% of the time
8
+i made this site with help from the people who made hakyll
9
+
10
+i hope we can be friends

+ 12
- 0
index.html View File

@@ -0,0 +1,12 @@
1
+---
2
+title: Home
3
+---
4
+
5
+<p>please don't laugh at me i really like swatch internet time</p>
6
+
7
+<p>here are some recent (for a very liberal definition of the word) posts:</p>
8
+
9
+<h2>"Recent" Posts</h2>
10
+$partial("templates/post-list.html")$
11
+
12
+<p>…or for a chance to nab seven agenda points, check the <a href="/archive/index.html">archives</a>.</p>

+ 42
- 0
posts/things-i-like.md View File

@@ -0,0 +1,42 @@
1
+---
2
+title: Things I Like
3
+published: 2018-08-17
4
+---
5
+
6
+howdy one and all, to my inaugural post.  
7
+what follows is a list of potentially somewhat obscure feelings, that instill a subtle, non-zero amount of joy in me, without reaching levels for me to register them as good feelings.
8
+
9
+without further ado:
10
+
11
+## lowercase letters
12
+
13
+much, i imagine, to the disgust of my english teacher mother, i really enjoy writing entirely in lowercase when i can. i believe it started on irc as a homestuck style (yet subtle enough to not give away being trash) quirk for some sense of identity that was seperate to having an actual personality.
14
+
15
+## using the (y) emoji outside of facebook
16
+
17
+on facebook, using `(y)` will produce a thumbs up emoji that is different to the current readily and easily avaliable one, so already it's pretty nice. theres something completely different about using it outside of facebook. i once met someone on discord who did the same thing. i have not talked to them since, nor can i remember their name, but i consider them a friend in the same way i consider anyone who uses dvorak a friend
18
+
19
+## the jazzy bit in the middle of Fluff's Travels by Phish
20
+
21
+shouldn't really need an explanation, [Fluffhead // Fluff's Travels](https://www.youtube.com/watch?v=Q54O03orQ4s) is such a good two piece and the jazz bit is the best part.
22
+
23
+## the following dialog from "The Point (1971)"
24
+
25
+>"if everything has a point, then i must have one too"  
26
+>"he's got a point there!"
27
+
28
+## swatch internet time in my shell prompt
29
+
30
+one day there'll be enough of us to make swatch beats a standard, until then i'll just await the day my pebble battery dies and i have to go back to a normal watch
31
+
32
+## people you know not noticing you in public
33
+
34
+all the upsides of being a social person and realising you know a lot more people than you think you do, but with none of the downsides of actually having to talk to people and take your headphones off
35
+
36
+## half-assed projects
37
+
38
+...of which this post is included. one day i'll finish something and maintain it, but until then theres something comfy about looking into `~/projects` and finding about seven variations on `ta_sdl_game_engine` dating back to highschool
39
+
40
+---
41
+
42
+hopefully you enjoyed these half assed ramblings. until next time, peace out, ima' bounce, and carry on my dudes.xvid.h264.mkv

+ 27
- 0
rf.cabal View File

@@ -0,0 +1,27 @@
1
+-- Initial rf.cabal generated by cabal init.  For further documentation, 
2
+-- see http://haskell.org/cabal/users-guide/
3
+
4
+name:                rf
5
+version:             0.1.0.0
6
+synopsis:            tA's blog
7
+-- description:         
8
+homepage:            regularflolloping.com
9
+license:             BSD3
10
+license-file:        LICENSE
11
+author:              Shaun Kerr
12
+maintainer:          s@p7.co.nz
13
+-- copyright:           
14
+category:            Web
15
+build-type:          Simple
16
+extra-source-files:  ChangeLog.md
17
+cabal-version:       >=1.10
18
+
19
+executable site
20
+  main-is:             site.hs
21
+  -- other-modules:       
22
+  -- other-extensions:    
23
+  build-depends:       base >=4.10 && <4.11
24
+                     , hakyll
25
+                     , filepath
26
+  -- hs-source-dirs:      
27
+  default-language:    Haskell2010

+ 4
- 0
rf.nix View File

@@ -0,0 +1,4 @@
1
+let
2
+   pkgs = import <nixpkgs> { };
3
+in
4
+   pkgs.haskellPackages.callPackage ./default.nix { }

+ 106
- 0
site.hs View File

@@ -0,0 +1,106 @@
1
+{-# LANGUAGE OverloadedStrings #-}
2
+
3
+import Hakyll
4
+import Data.Monoid (mappend)
5
+import Data.List (sortBy,isSuffixOf)
6
+import System.FilePath.Posix (takeBaseName,takeDirectory,(</>))
7
+import GHC.IO.Encoding
8
+
9
+main :: IO ()
10
+main = do 
11
+   setLocaleEncoding utf8
12
+   hakyll $ do
13
+      match "humans.txt" $ do
14
+         route idRoute
15
+         compile copyFileCompiler
16
+
17
+      match "images/*" $ do
18
+         route   idRoute
19
+         compile copyFileCompiler
20
+
21
+      match "css/*" $ do
22
+         route   idRoute
23
+         compile compressCssCompiler
24
+
25
+      match (fromList ["about.md", "contact.md"]) $ do
26
+         route $ cleanRoute
27
+         compile $ pandocCompiler
28
+            >>= loadAndApplyTemplate "templates/default.html" defaultContext
29
+            >>= relativizeUrls
30
+            >>= cleanIndexUrls
31
+
32
+      match "archive.md" $ do
33
+         route $ cleanRoute
34
+         compile $ pandocCompiler
35
+            >>= loadAndApplyTemplate "templates/archive.html" defaultContext
36
+            >>= relativizeUrls
37
+            >>= cleanIndexUrls
38
+
39
+         compile $ do
40
+            posts <- recentFirst =<< loadAll "posts/*"
41
+            let archiveCtx =
42
+                  listField "posts" postCtx (return posts) `mappend`
43
+                  constField "title" "Archives"            `mappend`
44
+                  defaultContext
45
+            pandocCompiler
46
+               >>= loadAndApplyTemplate "templates/archive.html" archiveCtx
47
+               >>= loadAndApplyTemplate "templates/default.html" archiveCtx
48
+               >>= relativizeUrls
49
+               >>= cleanIndexUrls
50
+
51
+      match "posts/*" $ do
52
+         route $ cleanRoute
53
+         compile $ pandocCompiler
54
+            >>= loadAndApplyTemplate "templates/post.html"    postCtx
55
+            >>= loadAndApplyTemplate "templates/default.html" postCtx
56
+            >>= relativizeUrls
57
+            >>= cleanIndexUrls
58
+            >>= cleanIndexHtmls
59
+
60
+      create ["archive/index.html"] $ do
61
+         route idRoute
62
+
63
+      match "index.html" $ do
64
+         route idRoute
65
+         compile $ do
66
+            posts <- recentFirst =<< loadAll "posts/*"
67
+            let indexCtx =
68
+                  listField "posts" postCtx (return posts) `mappend`
69
+                  constField "title" "Home"                `mappend`
70
+                  defaultContext
71
+
72
+            getResourceBody
73
+               >>= applyAsTemplate indexCtx
74
+               >>= loadAndApplyTemplate "templates/default.html" indexCtx
75
+               >>= relativizeUrls
76
+               >>= cleanIndexUrls
77
+               >>= cleanIndexHtmls
78
+
79
+      match "templates/*" $ compile templateBodyCompiler
80
+
81
+postCtx :: Context String
82
+postCtx =
83
+   dateField "date" "%B %e, %Y" `mappend`
84
+   defaultContext
85
+
86
+cleanRoute :: Routes
87
+cleanRoute = customRoute createIndexRoute
88
+   where
89
+      createIndexRoute ident =
90
+         takeDirectory p </> takeBaseName p </> "index.html"
91
+            where p = toFilePath ident
92
+
93
+cleanIndexUrls :: Item String -> Compiler (Item String)
94
+cleanIndexUrls = return . fmap (withUrls cleanIndex)
95
+
96
+cleanIndexHtmls :: Item String -> Compiler (Item String)
97
+cleanIndexHtmls = return . fmap (replaceAll pattern replacement)
98
+   where
99
+      pattern = "/index.html"
100
+      replacement = const "/"
101
+
102
+cleanIndex :: String -> String
103
+cleanIndex url
104
+    | idx `isSuffixOf` url = take (length url - length idx) url
105
+    | otherwise            = url
106
+   where idx = "index.html"

+ 2
- 0
templates/archive.html View File

@@ -0,0 +1,2 @@
1
+$body$
2
+$partial("templates/post-list.html")$

+ 32
- 0
templates/default.html View File

@@ -0,0 +1,32 @@
1
+<!doctype html>
2
+<html lang="en">
3
+    <head>
4
+        <meta charset="utf-8">
5
+        <meta http-equiv="x-ua-compatible" content="ie=edge">
6
+        <meta name="viewport" content="width=device-width, initial-scale=1">
7
+        <title>rf - $title$</title>
8
+        <link rel="stylesheet" href="/css/default.css" />
9
+    </head>
10
+    <body>
11
+        <header>
12
+            <div class="logo">
13
+                <a href="/">Regular Flolloping</a>
14
+            </div>
15
+            <nav>
16
+                <a href="/">Home</a>
17
+                <a href="/about/">About</a>
18
+                <a href="/contact/">Contact</a>
19
+                <a href="/archive/">Archive</a>
20
+            </nav>
21
+        </header>
22
+
23
+        <main role="main">
24
+            <h1>$title$</h1>
25
+            $body$
26
+        </main>
27
+
28
+        <footer>
29
+            powered by <a href="http://jaspervdj.be/hakyll">Hakyll</a>
30
+        </footer>
31
+    </body>
32
+</html>

+ 1
- 0
templates/post-item.html View File

@@ -0,0 +1 @@
1
+<li><a href="$url$">$title$</a> ~ $published$</li>

+ 7
- 0
templates/post-list.html View File

@@ -0,0 +1,7 @@
1
+<ul>
2
+    $for(posts)$
3
+        <li>
4
+            <a href="$url$">$title$</a> - $date$
5
+        </li>
6
+    $endfor$
7
+</ul>

+ 11
- 0
templates/post.html View File

@@ -0,0 +1,11 @@
1
+<article>
2
+    <section class="header">
3
+        Posted on $date$
4
+        $if(author)$
5
+            by $author$
6
+        $endif$
7
+    </section>
8
+    <section>
9
+        $body$
10
+    </section>
11
+</article>

Loading…
Cancel
Save