move views to views folder

This commit is contained in:
2022-10-12 17:04:26 -06:00
parent 07dd08698c
commit e13348c8ae
10 changed files with 39 additions and 11 deletions

17
views/blog_index.eml.ml Normal file
View File

@@ -0,0 +1,17 @@
let render ~posts =
let open Database in
<div>
<h3>Blog</h3>
I have an <a href="/blog/rss.xml">RSS feed</a> too.
<br>
</div>
% posts |> List.iter begin fun (post : Blog_post.t) ->
<div class="link-wrapper">
<a href="/blog/<%s post.slug %>">
<%s post.title %>
</a>
<i>
<%s post.date %>
</i>
</div>
% end;

12
views/dune Normal file
View File

@@ -0,0 +1,12 @@
(library
(name views)
(public_name rawleydotxyz.views)
(libraries dream lwt database)
(preprocess
(pps lwt_ppx)))
(rule
(targets index.ml layout.ml post_layout.ml blog_index.ml)
(deps index.eml.ml layout.eml.ml post_layout.eml.ml blog_index.eml.ml)
(action
(run dream_eml %{deps} --workspace %{workspace_root})))

19
views/index.eml.ml Normal file
View File

@@ -0,0 +1,19 @@
let render () =
<h3>Welcome!</h3>
<p>
Hi, I'm Rawley. I'm a software developer and self-proclaimed systems administrator
from Saskatchewan, Canada. I am experienced with a wide variety of technologies, including
but not limited to OCaml, Clojure, Scheme, GNU/Linux, OpenBSD, C/C++,
and Java. I am particularily interested in functional programming and
programming language theory.
</p>
<p>
All of my personal projects are <a href="https://www.gnu.org/philosophy/philosophy.html">Free Software</a> and can be
found on <a href="https://git.rawley.xyz">my git server</a> or, on my <a href="https://github.com/rawleyfowler">github</a>.
I spend most of my free time working on personal projects,
writing blog posts, or listening to bluegrass music.
To top it all off, I am a free software advocate, digital minimalist, and a full time husband.
</p>
<p>
If you need to contact me, please send me an email.
</p>

44
views/layout.eml.ml Normal file
View File

@@ -0,0 +1,44 @@
let render body =
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Rawley.xyz, Rawley Fowler's blog and personal website">
<title>rawley.xyz</title>
<link href="/static/index.css" rel="stylesheet">
</head>
<body>
<header>
<h1>
<a href="/">/home/rawley.xyz</a>
</h1>
<nav>
<li>
<a href="/blog">blog</a>
</li>
<li>
<a href="/resume">resume</a>
</li>
<li>
<a href="/philosophy">philosophy</a>
</li>
<li>
<a href="/web-ring">web ring</a>
</li>
</nav>
</header>
<main>
<%s! body %>
</main>
<footer>
<hr>
<p>
Copyright &copy; Rawley Fowler 2022
</p>
<p>
<b>Disclaimer</b>: All opinions on this site, are that of my own. They do not reflect the opinions of
any of my employers; past, present, or future.
</p>
</footer>
</body>
</html>

48
views/post_layout.eml.ml Normal file
View File

@@ -0,0 +1,48 @@
let render ~title ~tags ~body =
let combine_tags lst =
List.fold_left (fun t a -> t ^ " " ^ a) "" lst
in
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="<%s combine_tags tags %>">
<title><%s title %></title>
<link href="/static/index.css" rel="stylesheet">
</head>
<body>
<header>
<h1>
<a href="/">/home/rawley.xyz</a>
</h1>
<nav>
<li>
<a href="/blog">blog</a>
</li>
<li>
<a href="/resume">resume</a>
</li>
<li>
<a href="/philosophy">philosophy</a>
</li>
<li>
<a href="/web-ring">web ring</a>
</li>
</nav>
</header>
<main>
<h2><%s title %></h2>
<%s! body %>
</main>
<footer>
<hr>
<p>
Copyright &copy; Rawley Fowler 2022
</p>
<p>
<b>Disclaimer</b>: All opinions on this site, are that of my own. They do not reflect the opinions of
any of my employers; past, present, or future.
</p>
</footer>
</body>
</html>