aboutsummaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/blog.ejs49
-rw-r--r--views/error.ejs8
-rw-r--r--views/index.ejs8
-rw-r--r--views/page.ejs20
-rw-r--r--views/pageinfo.ejs83
-rw-r--r--views/partials/head.ejs14
-rw-r--r--views/partials/header.ejs12
-rw-r--r--views/partials/navbar.ejs7
-rw-r--r--views/purge.ejs26
-rw-r--r--views/rebuild.ejs23
10 files changed, 75 insertions, 175 deletions
diff --git a/views/blog.ejs b/views/blog.ejs
new file mode 100644
index 0000000..238c935
--- /dev/null
+++ b/views/blog.ejs
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <%- include('partials/head') %>
+ <link rel="stylesheet" href="/css/blog.css">
+</head>
+<body>
+ <div id="main-container">
+ <%- include('partials/navbar') %>
+ <div id="content-container">
+ <% if (index) { %>
+ <div id="content">
+ <h1>Blog</h1>
+ <div class="blog-post-header">
+ <span class="blog-post-title monospace">title</span>
+ <span class="monospace">date</span>
+ </div>
+ <% for (const blog of blogs) { %>
+ <a class="blog-post" href="/<%= blog.route %>">
+ <span class="blog-post-title">
+ <%= blog.metadata.title %>
+ </span>
+ <span class="blog-post-date monospace">
+ <%= blog.metadata.date?.toISOString().substring(0, 10) %>
+ </span>
+ </a>
+ <% } %>
+ </div>
+ <% } else { %>
+ <div id="content">
+ <div id="back-container">
+ <div id="back-header">
+ <a href="/blog" class="monospace">&larr; blog posts</a>
+ </div>
+ </div>
+ <div id="title" class="monospace">
+ <h1><%= page.metadata.title %></h1>
+ <span><%= page.metadata.date?.toDateString() %></span>
+ </div>
+ <%- page.html %>
+ <div id="back-footer">
+ <a href="/blog" class="monospace">&larr; blog posts</a>
+ </div>
+ </div>
+ <% } %>
+ </div>
+ </div>
+</body>
+</html>
diff --git a/views/error.ejs b/views/error.ejs
index 88e1a27..838da5b 100644
--- a/views/error.ejs
+++ b/views/error.ejs
@@ -1,17 +1,15 @@
<!DOCTYPE html>
<html>
<head>
- <title>Error: <%= code %></title>
+ <title>Page not found</title>
<link rel="stylesheet" href="/css/globalstyles.css">
</head>
<body>
<div id="main-container">
- <%- include('partials/header') %>
+ <%- include('partials/navbar') %>
<div id="content-container">
- <%- include('partials/navbar') %>
<div id="content">
- <h1>An error occurred (<%= code %>)</h1>
- <p>Go <a href="/">home</a>?</p>
+ <h1>Page not found</h1>
</div>
</div>
</div>
diff --git a/views/index.ejs b/views/index.ejs
index f47b830..e638ad4 100644
--- a/views/index.ejs
+++ b/views/index.ejs
@@ -1,16 +1,14 @@
<!DOCTYPE html>
<html>
<head>
- <title><%= title %></title>
- <link rel="stylesheet" href="/css/globalstyles.css">
+ <%- include('partials/head') %>
</head>
<body>
<div id="main-container">
- <%- include('partials/header') %>
+ <%- include('partials/navbar') %>
<div id="content-container">
- <%- include('partials/navbar') %>
<div id="content">
- <%- page %>
+ <%- content %>
</div>
</div>
</div>
diff --git a/views/page.ejs b/views/page.ejs
deleted file mode 100644
index 2bd4262..0000000
--- a/views/page.ejs
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title><%= title %></title>
- <link rel="stylesheet" href="/css/globalstyles.css">
-</head>
-<body>
- <div id="main-container">
- <%- include('partials/header') %>
- <div id="content-container">
- <%- include('partials/navbar') %>
- <div id="content">
- <%- content %>
- <hr>
- <span class=footer><a href="https://github.com/LMBishop/website">GitHub</a> | <a href="/<%= path %>.wiki">View raw</a> | Page built: <%= buildTime %> | <a href="/special/info/<%= path %>">Page info</a></span>
- </div>
- </div>
- </div>
-</body>
-</html>
diff --git a/views/pageinfo.ejs b/views/pageinfo.ejs
deleted file mode 100644
index c0ba59d..0000000
--- a/views/pageinfo.ejs
+++ /dev/null
@@ -1,83 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Page information for <%= standardName %></title>
- <link rel="stylesheet" href="/css/globalstyles.css">
-</head>
-<body>
- <div id="main-container">
- <%- include('partials/header') %>
- <div id="content-container">
- <%- include('partials/navbar') %>
- <div id="content">
- <h1>Information for page <%= standardName %></h1>
- <table>
- <tr>
- <td>Standard name</td>
- <td><%= standardName %></td>
- </tr>
- <tr>
- <td>Display title</td>
- <td><%= displayTitle ?? '-' %></td>
- </tr>
- <tr>
- <td>Last build</td>
- <td><%- (buildTime != 0) ? new Date(buildTime) : '-' %></td>
- </tr>
- <tr>
- <td>Primary</td>
- <td><%= primary ?? false %></td>
- </tr>
- <tr>
- <td>Show title</td>
- <td><%= showTitle ?? false %></td>
- </tr>
- <tr>
- <td>Sort order</td>
- <td><%- sortOrder ?? '-' %></td>
- </tr>
- <tr>
- <td>Dependencies</td>
- <td>
- <% if (dependencies.size === 0) { %>
- <%- '-' %>
- <% } else { %>
- <% dependencies.forEach(e => { %>
- <%- `${e}<br>` %>
- <% }); %>
- <%}%>
- </td>
- </tr>
- <tr>
- <td>Pages which depend on this page</td>
- <td>
- <% if (dependents.size === 0) { %>
- <%- '-' %>
- <% } else { %>
- <% dependents.forEach(e => { %>
- <%- `${e}<br>` %>
- <% }); %>
- <%}%>
- </td>
- </tr>
- <tr>
- <td>Errors</td>
- <td>
- <% if (errors.length === 0) { %>
- <%- '-' %>
- <% } else { %>
- <% errors.forEach(e => { %>
- <%- `${e.identifier}: ${e.message}<br>` %>
- <% }); %>
- <%}%>
- </td>
- </tr>
- </table>
- <p><a href="/special/purge/<%= standardName %>">Purge this page?</a></p>
- <hr>
- <span class=footer><a href="https://github.com/LMBishop/website">GitHub</a> | <a href="/<%= path %>">View original</a></span>
- </div>
- </div>
- </div>
-</body>
-</html>
diff --git a/views/partials/head.ejs b/views/partials/head.ejs
new file mode 100644
index 0000000..d66fe97
--- /dev/null
+++ b/views/partials/head.ejs
@@ -0,0 +1,14 @@
+<title>Leonardo Bishop</title>
+<link rel="stylesheet" href="/css/globalstyles.css">
+
+<% if (typeof stylesheets == 'object') { %>
+ <% for (const sheet of stylesheets) { %>
+<link rel="stylesheet" href="<%= sheet %>">
+ <% } %>
+<% } %>
+
+<% if (typeof scripts == 'object') { %>
+ <% for (const script of scripts) { %>
+<script src="<%= script %>"></script>
+ <% } %>
+<% } %>
diff --git a/views/partials/header.ejs b/views/partials/header.ejs
deleted file mode 100644
index bd11ce0..0000000
--- a/views/partials/header.ejs
+++ /dev/null
@@ -1,12 +0,0 @@
-<pre class="website-name">
-
-<!--
-██╗ ███╗ ███╗██████╗ ██╗███████╗██╗ ██╗ ██████╗ ██████╗
-██║ ████╗ ████║██╔══██╗██║██╔════╝██║ ██║██╔═══██╗██╔══██╗
-██║ ██╔████╔██║██████╔╝██║███████╗███████║██║ ██║██████╔╝
-██║ ██║╚██╔╝██║██╔══██╗██║╚════██║██╔══██║██║ ██║██╔═══╝
-███████╗██║ ╚═╝ ██║██████╔╝██║███████║██║ ██║╚██████╔╝██║
-╚══════╝╚═╝ ╚═╝╚═════╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝
-
- -->
-</pre>
diff --git a/views/partials/navbar.ejs b/views/partials/navbar.ejs
index ff0c84d..3dbeb6a 100644
--- a/views/partials/navbar.ejs
+++ b/views/partials/navbar.ejs
@@ -1,3 +1,8 @@
<div id="navbar">
- <%- navbar %>
+ <h2>Leonardo Bishop</h2>
+ <a href="/">home</a>
+ <a href="/now">now</a>
+ <a href="/blog">blog</a>
+ <!-- <a href="/spotify">spotify</a> -->
+ <a href="/contact">contact</a>
</div>
diff --git a/views/purge.ejs b/views/purge.ejs
deleted file mode 100644
index df48073..0000000
--- a/views/purge.ejs
+++ /dev/null
@@ -1,26 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Purge page</title>
- <link rel="stylesheet" href="/css/globalstyles.css">
- <script src="https://code.jquery.com/jquery-3.6.0.min.js" ntegrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
- <script src="/scripts/purge.js"></script>
-</head>
-<body>
- <div id="main-container">
- <%- include('partials/header') %>
- <div id="content-container">
- <%- include('partials/navbar') %>
- <div id="content">
- <h1>Purge page</h1>
- <span id="response"></span>
- <p>Are you sure you wish to purge the page <span class="highlight"><%= page %></span>?</p>
- <p>The last build time for this page was <span class="highlight"><%= buildTime %></span> (<span class="highlight"><%= buildTimeRelative %></span> minutes ago).</p>
- <button id="confirm" data-page="<%= page %>">Confirm</button>
- <hr>
- <span class=footer><a href="https://github.com/LMBishop/website">GitHub</a> | <a href="/<%= page %>">View original</a></span>
- </div>
- </div>
- </div>
-</body>
-</html>
diff --git a/views/rebuild.ejs b/views/rebuild.ejs
deleted file mode 100644
index 9f9cfaa..0000000
--- a/views/rebuild.ejs
+++ /dev/null
@@ -1,23 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Rebuild</title>
- <link rel="stylesheet" href="/css/globalstyles.css">
- <script src="https://code.jquery.com/jquery-3.6.0.min.js" ntegrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
- <script src="/scripts/rebuild.js"></script>
-</head>
-<body>
- <div id="main-container">
- <%- include('partials/header') %>
- <div id="content-container">
- <%- include('partials/navbar') %>
- <div id="content">
- <h1>Rebuild</h1>
- <span id="response"></span>
- <p>Are you sure you wish to rebuild the page directory?</p>
- <button id="confirm">Confirm</button>
- </div>
- </div>
- </div>
-</body>
-</html>