Add routes and templates for archives

This commit is contained in:
2020-12-22 16:54:57 -08:00
parent 15f29e1b8f
commit 0e39a2e401
3 changed files with 4 additions and 5 deletions
+1 -2
View File
@@ -3,7 +3,7 @@ const Database = require('better-sqlite3')
const page = require('../../page')
const ds = require('../../index')
const db = new Database('./main.db')
const db = ds.db()
module.exports.GET = async (req, res) => {
/*
@@ -17,7 +17,6 @@ module.exports.GET = async (req, res) => {
// year-month
const [year, month] = period.split(/-/)
const articles = await ds.getArticlesByYearMonth(db, year, month)
console.log(year, month, articles)
const out = await page.render('ad-year-month', { year, month, articles })
send(res, 200, out)
} else {
+2 -2
View File
@@ -7,8 +7,8 @@
<section id="ad-year-month" style="margin-top: 5%" >
<div class="container">
<div class="row">
<div class="two columns" >
<h2><%- year %></h2>
<div class="two columns clean" >
<h2><a href="/ad/<%- year %>"><%- year %></a></h2>
</div>
<div class="ten columns" >
<% let last = '' %>
+1 -1
View File
@@ -4,7 +4,7 @@
–––––––––––––––––––––––––––––––––––––––––––––––––– -->
<%- include('_search') %>
<section id="ad-year" style="margin-top: 5%" >
<section id="ad-year" class="clean" style="margin-top: 5%" >
<div class="container">
<div class="row">
<div class="two columns" >