Browse Source

first post draft, and index test

john melesky 8 years ago
parent
commit
bae6c1443d
4 changed files with 46 additions and 5 deletions
  1. 9 0
      about.md
  2. 21 0
      posts/2016-08-25-different-distances.md
  3. 14 2
      site.hs
  4. 2 3
      templates/default.html

+ 9 - 0
about.md

@@ -32,3 +32,12 @@ name this site is hosted on (a ".org" domain named after a longtime
 pseudonym, "phaedrusdeinus"). I don't have a strong history of
 correspondence, but I will try to get back to you.
 
+
+### About this blog
+
+This blog is generated using [Hakyll](http://jaspervdj.be/hakyll), a
+static site generator, and leans heavily on the generated sample
+site. The tags capability was added based on [this tutorial
+blog](https://javran.github.io/posts/2014-03-01-add-tags-to-your-hakyll-blog.html). I
+used emacs, git, and [gogs](http://gogs.io/) in the construction and
+maintenance of the site.

+ 21 - 0
posts/2016-08-25-different-distances.md

@@ -0,0 +1,21 @@
+---
+title: Different Measures of Distance
+tags: geometry
+description: A few different ways of calculating distance in noncontinuous 2d spaces
+---
+
+How far is it from one place to another? How does that change if
+you're on a flat plane? What if that plane has discrete distances
+(like a checkerboard, or Civ map)?
+
+### Euclidean Distance
+
+This is the go-to of distance calculations.
+
+### Manhattan Distance
+
+### Civ Distance
+
+### D&D Distance
+
+This is a bit more complex.

+ 14 - 2
site.hs

@@ -26,7 +26,7 @@ main = hakyll $ do
       >>= loadAndApplyTemplate "templates/default.html" defaultContext
       >>= relativizeUrls
 
-  tags <- buildTags "posts/*" (fromCapture "tags/*.html")
+  tags <- buildTags "posts/*.md" (fromCapture "tags/*.html")
 
   tagsRules tags $ \tag pattern -> do
     let title = "Posts tagged \"" ++ tag ++ "\""
@@ -42,7 +42,7 @@ main = hakyll $ do
         >>= loadAndApplyTemplate "templates/default.html" ctx
         >>= relativizeUrls
 
-  match "posts/*" $ do
+  match "posts/*.md" $ do
     route $ setExtension "html"
     compile $ pandocCompiler
       >>= loadAndApplyTemplate "templates/post.html"    (postCtxWithTags tags)
@@ -64,6 +64,18 @@ main = hakyll $ do
         >>= relativizeUrls
 
 
+  create ["new_index.html"] $ do
+    route idRoute
+    compile $ do
+      posts <- recentFirst =<< loadAll "posts/*"
+      let post =
+            head (return posts)
+      pandocCompiler
+        >>= loadAndApplyTemplate "templates/post.html"    (postCtxWithTags tags)
+        >>= loadAndApplyTemplate "templates/default.html" (postCtxWithTags tags)
+        >>= relativizeUrls
+
+
   match "index.html" $ do
     route idRoute
     compile $ do

+ 2 - 3
templates/default.html

@@ -4,7 +4,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
     <head>
         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-        <title>john melesky - $title$</title>
+        <title>$title$ :: john's blog</title>
         <link rel="stylesheet" type="text/css" href="/css/default.css" />
     </head>
     <body>
@@ -31,8 +31,7 @@
 
         </div>
         <div id="footer">
-            Site proudly generated by
-            <a href="http://jaspervdj.be/hakyll">Hakyll</a>
+          All content copyright 2016, john melesky, unless otherwise noted.
         </div>
     </body>
 </html>