Skip to content

Commit

Permalink
update site.
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-br committed May 17, 2024
1 parent 83f7307 commit 084de6b
Show file tree
Hide file tree
Showing 10 changed files with 266 additions and 157 deletions.
110 changes: 106 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,115 @@
title: Home
---

<h2>Welcome</h2>
<!-- <h2>Welcome</h2>
<p>Welcome to my blog!</p>
<p>I've reproduced a list of recent posts here for your reading pleasure:</p>
<p>I've reproduced a list of recent posts here for your reading pleasure:</p> -->

<h2>Posts</h2>
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
<header class="text-center mb-12">
<h1 class="text-5xl font-bold text-white">Timothy Williams</h1>
<p class="mt-4 text-xl text-gray-400">I am a software developer interested in distributed systems, services, queues, and CQRS. I also love Markov chains and algorithms and data structures.</p>
</header>

<main>
<section class="mb-12">
<h2 class="text-3xl font-bold text-white mb-6">Projects</h2>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6">
<!-- Projects in cards -->
<div class="bg-gray-800 p-6 rounded-md shadow-md hover:shadow-lg">
<a href="https://github.com/tim-br/hview" class="text-blue-400 hover:text-blue-600 font-semibold">HView</a>
<p class="text-gray-400 mt-2">Inspired by LiveView, a Haskell library for dynamic HTML updates via JSON. In πρῶτο-ἄλφα (proto-alpha phase).</p>
</div>
<div class="bg-gray-800 p-6 rounded-md shadow-md hover:shadow-lg">
<a href="https://github.com/tim-br/hs-tic-tac-toe" class="text-blue-400 hover:text-blue-600 font-semibold">Haskell Tic Tac Toe</a>
<p class="text-gray-400 mt-2">$snippet$</p>
</div>
<div class="bg-gray-800 p-6 rounded-md shadow-md hover:shadow-lg">
<a href="https://github.com/tim-br/nauths-site" class="text-blue-400 hover:text-blue-600 font-semibold">nauths</a>
<p class="text-gray-400 mt-2">GitHub repository for personal portfolio site, built using Hakyll static site generator.</p>
</div>
<div class="bg-gray-800 p-6 rounded-md shadow-md hover:shadow-lg">
<a href="https://counter.nauths.io" class="text-blue-400 hover:text-blue-600 font-semibold">Multi Tenant Distributed Counter</a>
</div>
<div class="bg-gray-800 p-6 rounded-md shadow-md hover:shadow-lg">
<a href="https://view.clearsettleengine.nauths.io" class="text-blue-400 hover:text-blue-600 font-semibold">Clear Settle Engine</a>
</div>
<div class="bg-gray-800 p-6 rounded-md shadow-md hover:shadow-lg">
<a href="https://github.com/tim-br/n-queens" class="text-blue-400 hover:text-blue-600 font-semibold">N-Queens Implementation</a>
<p class="text-gray-400 mt-2">This repository contains an n-queens implementation in prolog. A demo can be viewed <a href="https://asciinema.org/a/b0YimrR8IbYlh2qw9RDrzxwtd" target="_blank" class="text-blue-400 hover:text-blue-600 font-semibold">here</a>.</p>
</div>
<div class="bg-gray-800 p-6 rounded-md shadow-md hover:shadow-lg">
<a href="https://github.com/tim-br/binary-trees-pl" class="text-blue-400 hover:text-blue-600 font-semibold">Prolog Binary Trees</a>
<p class="text-gray-400 mt-2">This repository contains prolog code to generate binary trees and write them to an svg file.</p>
</div>
<div class="bg-gray-800 p-6 rounded-md shadow-md hover:shadow-lg">
<a href="https://myjwt.nauths.io" class="text-blue-400 hover:text-blue-600 font-semibold">Login App with Auth0</a>
<p class="text-gray-400 mt-2">Simple app in which you can login with jwt.</p>
</div>
</div>
</section>

<section class="mb-12">
<h2 class="text-3xl font-bold text-white mb-6">Skills</h2>
<div class="flex flex-wrap justify-center gap-4">
<!-- Skills displayed as tags -->
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">JavaScript</span>
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">React</span>
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">Kubernetes</span>
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">Elixir</span>
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">Python</span>
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">Prolog</span>
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">Unix</span>
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">Git</span>
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">AWS</span>
</div>
</section>

<section class="mb-12">
<h2 class="text-3xl font-bold text-white mb-6">Learning</h2>
<div class="flex flex-wrap justify-center gap-4">
<!-- Currently learning skills -->
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">Rust</span>
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">Golang</span>
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">Haskell</span>
</div>
</section>

<section class="mb-12">
<h2 class="text-3xl font-bold text-white mb-6">Interests</h2>
<div class="flex flex-wrap justify-center gap-4">
<!-- Interests -->
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">Programming</span>
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">Ἑλληνίζειν</span>
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">ποίησις</span>
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">Italian</span>
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">Jump Rope</span>
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">Swimming</span>
<span class="bg-gray-800 text-white px-4 py-2 rounded-md">Dance</span>
</div>
</section>


<section class="mb-12">
<h2 class="text-3xl font-bold text-white mb-6">Posts</h2>
$partial("templates/post-list.html")$
</section>

<section class="mb-12">
<h2 class="text-3xl font-bold text-white mb-6">Links</h2>
<ul class="space-y-4">
<li>
<a href="https://cs.stanford.edu/~knuth/" class="text-blue-400 hover:text-blue-600 font-semibold">Donald E. Knuth Homepage</a>
</li>
</ul>
</section>
</main>
</div>


<!-- <h2>Posts</h2>
$partial("templates/post-list.html")$
<p>…or you can find more in the <a href="/archive.html">archives</a>.</p>
<p>…or you can find more in the <a href="/archive.html">archives</a>.</p> -->
16 changes: 0 additions & 16 deletions posts/2015-08-23-example.markdown

This file was deleted.

10 changes: 10 additions & 0 deletions posts/2024-05-16-first_post.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
title: First Post
---

<br>

χαῖρε. Welcome to my first post. I intend to explore various topics in Typescript and even compare it to Haskell.
<br>
<br>
I am currently interested in generics so I hope to publish a few posts related to this topic shortly.
68 changes: 42 additions & 26 deletions site.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ main = hakyll $ do
compile copyFileCompiler

-- Route and compile HTML files
match "web-content/index.html" $ do
route idRoute
compile $ do
snippet <- loadBody "web-content/snippet.md"
let indexContext = constField "snippet" snippet `mappend` defaultContext
getResourceBody
>>= applyAsTemplate indexContext
>>= loadAndApplyTemplate "templates/default.html" indexContext
>>= relativizeUrls
-- match "web-content/index.html" $ do
-- route $ constRoute "index.html"
-- compile $ do
-- snippet <- loadBody "web-content/snippet.md"
-- let indexContext = constField "snippet" snippet `mappend` defaultContext
-- getResourceBody
-- >>= applyAsTemplate indexContext
-- >>= loadAndApplyTemplate "templates/default.html" indexContext
-- >>= relativizeUrls
-- Route and compile HTML files
match "web-content/**/*.html" $ do
route idRoute
Expand All @@ -53,24 +53,24 @@ main = hakyll $ do
-- route idRoute
-- compile copyFileCompiler

-- match "css/*" $ do
-- route idRoute
-- compile compressCssCompiler
match "css/*" $ do
route idRoute
compile compressCssCompiler

-- match (fromList ["about.rst", "contact.markdown"]) $ do
-- route $ setExtension "html"
-- compile $ pandocCompiler
-- >>= loadAndApplyTemplate "templates/default.html" defaultContext
-- >>= relativizeUrls

-- match "posts/*" $ do
-- route $ setExtension "html"
-- compile $ pandocCompiler
-- >>= loadAndApplyTemplate "templates/post.html" postCtx
-- >>= loadAndApplyTemplate "templates/default.html" postCtx
-- >>= relativizeUrls
match "posts/*" $ do
route $ setExtension "html"
compile $ pandocCompiler
>>= loadAndApplyTemplate "templates/post.html" postCtx
>>= loadAndApplyTemplate "templates/default.html" postCtx
>>= relativizeUrls

-- create ["archive.html"] $ do
-- create ["posts/index.html"] $ do -- Changed from "archive.html" to "posts/index.html"
-- route idRoute
-- compile $ do
-- posts <- recentFirst =<< loadAll "posts/*"
Expand All @@ -84,21 +84,37 @@ main = hakyll $ do
-- >>= loadAndApplyTemplate "templates/default.html" archiveCtx
-- >>= relativizeUrls


-- match "index.html" $ do
-- create ["archive.html"] $ do
-- route idRoute
-- compile $ do
-- posts <- recentFirst =<< loadAll "posts/*"
-- let indexCtx =
-- let archiveCtx =
-- listField "posts" postCtx (return posts) `mappend`
-- constField "title" "Home" `mappend`
-- constField "title" "Archives" `mappend`
-- defaultContext

-- getResourceBody
-- >>= applyAsTemplate indexCtx
-- >>= loadAndApplyTemplate "templates/default.html" indexCtx
-- makeItem ""
-- >>= loadAndApplyTemplate "templates/archive.html" archiveCtx
-- >>= loadAndApplyTemplate "templates/default.html" archiveCtx
-- >>= relativizeUrls


match "index.html" $ do
route idRoute
compile $ do
snippet <- loadBody "web-content/snippet.md"
posts <- recentFirst =<< loadAll "posts/*"
let indexCtx =
listField "posts" postCtx (return posts) `mappend`
constField "title" "Home" `mappend`
constField "snippet" snippet `mappend`
defaultContext

getResourceBody
>>= applyAsTemplate indexCtx
>>= loadAndApplyTemplate "templates/default.html" indexCtx
>>= relativizeUrls

-- match "templates/*" $ compile templateCompiler


Expand Down
6 changes: 5 additions & 1 deletion templates/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
<title>$title$</title>
<link rel="stylesheet" href="/css/style.css">
</head>
<body>
<body class="font-sans bg-gray-900 text-gray-200">
$body$
</body>

<footer class="text-center text-gray-400 text-sm mt-12">
<p>Site generated with <a href="http://github.com/jaspervdj/hakyll">hakyll</a></p>
</footer>
</html>
6 changes: 3 additions & 3 deletions templates/post-list.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ul>
<ul class="space-y-4">
$for(posts)$
<li>
<a href="$url$">$title$</a> - $date$
<a href="$url$" class="text-blue-400 hover:text-blue-600 font-semibold">$title$</a> - $date$
</li>
$endfor$
</ul>
</ul>
7 changes: 5 additions & 2 deletions update_web.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
DEPLOYMENT_LABEL="app=caddy"
CONTAINER_NAME="caddy"
DESTINATION_PATH="/usr/share/caddy/"
SOURCE_PATH="./_site/web-content"
SOURCE_PATH="./_site/"

# Check if the source directory exists and is not empty
if [ ! -d "$SOURCE_PATH" ] || [ -z "$(ls -A $SOURCE_PATH)" ]; then
Expand All @@ -27,5 +27,8 @@ if ! kubectl cp ./ $POD_NAME:$DESTINATION_PATH -c $CONTAINER_NAME; then
exit 1
fi
popd
kubectl exec $POD_NAME -c $CONTAINER_NAME -- ls -la $DESTINATION_PATH
kubectl exec $POD_NAME -c $CONTAINER_NAME -- grep bg /usr/share/caddy/style.css
STYLE=style.css

echo "Files successfully copied to $POD_NAME:$DESTINATION_PATH"
echo "Files successfully copied to $POD_NAME:$DESTINATION_PATH"
Loading

0 comments on commit 084de6b

Please sign in to comment.