Add routes and templates for archives
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 = '' %>
|
||||
|
||||
@@ -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" >
|
||||
|
||||
Reference in New Issue
Block a user