Browse Source

Add routes and templates for archives

master
Perception 4 months ago
parent
commit
0e39a2e401
3 changed files with 4 additions and 5 deletions
  1. +1
    -2
      routes/ad/:period.js
  2. +2
    -2
      templates/ad-year-month.ejs
  3. +1
    -1
      templates/ad-year.ejs

+ 1
- 2
routes/ad/:period.js 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
templates/ad-year-month.ejs 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
templates/ad-year.ejs 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" >


Loading…
Cancel
Save