Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions content/artists.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"heathcliff": {
"displayName": "Heathcliff",
"links": {
"ig": "https://www.instagram.com/heathcliff.mp3",
"soundcloud": "https://soundcloud.com/heathcliffdotmp3"
}
}
}
10 changes: 5 additions & 5 deletions edge/components/css.edge
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,10 @@
}

#site-header h1 {
font-size: 1rem;
font-size: 1.6rem;
}
#site-header p {
font-size: 0.8rem;
font-size: 1.2rem;
text-align: right;
}

Expand Down Expand Up @@ -219,17 +219,17 @@
<style>
/* ticket style */

section#stops {
section#events {
margin-top: 3rem;
}

section#stops section.sheet {
section#events section.sheet {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}

section#stops section.sheet h2 {
section#events section.sheet h2 {
font-size: 2rem;
margin-bottom: 1.5rem;
}
Expand Down
2 changes: 1 addition & 1 deletion edge/components/edition.edge
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
@!component('../components/header', { doc })
@end
<section id="content" class="content-font">
<h2 class="header-font"><a href="./{{doc.frontmatter.slug}}">{{ doc.frontmatter.title}}</a></h2>
<h2 class="header-font"><a href="./edition/{{doc.frontmatter.slug}}">{{ doc.frontmatter.title}}</a></h2>
{{{ doc.content }}}
</section>
{{-- we check if the heading is true because that cascades
Expand Down
File renamed without changes.
7 changes: 7 additions & 0 deletions edge/components/events/past.edge
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@pushOnceTo('past')
@let(subtitle = 'events/past')
@!component('../components/header', { subtitle })
@end
@pushTo('past')
@!component('../components/event', { doc })
@end
7 changes: 7 additions & 0 deletions edge/components/events/thisWeek.edge
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@pushOnceTo('this-week')
@let(subtitle = 'events/this week')
@!component('../components/header', { subtitle })
@end
@pushTo('this-week')
@!component('../components/event', { doc })
@end
7 changes: 7 additions & 0 deletions edge/components/events/upcoming.edge
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@pushOnceTo('upcoming')
@let(subtitle = 'events/upcoming')
@!component('../components/header', { subtitle })
@end
@pushTo('upcoming')
@!component('../components/event', { doc })
@end
7 changes: 5 additions & 2 deletions edge/components/header.edge
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
<header id="site-header">
<h1 class="header-font"><a href="/">backspin</a></h1>
@if(doc)
@if(doc.frontmatter.index)
<p class="content-font">^edition {{ doc.frontmatter.index }}</p>
@if(doc.frontmatter.index)
<p class="content-font">edition {{ doc.frontmatter.index }}</p>
@end
@end
@if(subtitle)
<p class="content-font">{{ subtitle }}</p>
@end
</header>
6 changes: 0 additions & 6 deletions edge/components/stops/past.edge

This file was deleted.

6 changes: 0 additions & 6 deletions edge/components/stops/thisWeek.edge

This file was deleted.

6 changes: 0 additions & 6 deletions edge/components/stops/upcoming.edge

This file was deleted.

52 changes: 52 additions & 0 deletions edge/templates/events.edge
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{{-- forgive the Date() crimes I've committed in this file --}}
@let(exists = {
nextWeek: false,
upcoming: false,
past: false
})

{{-- loop over our absolute paths and render them to each of the above stacks where appropriate --}}
@each(event in await events)
@let(doc = await $markdown.render({
file: event,
}))
@if(dateCompare.withinNextWeek(doc.frontmatter.date))
@assign(exists.nextWeek = true)
@!component('../components/events/thisWeek', { doc })
@elseif(dateCompare.beyondNextWeek(doc.frontmatter.date))
@assign(exists.upcoming = true)
@!component('../components/events/upcoming', { doc })
@elseif(dateCompare.isDateBefore(doc.frontmatter.date, new Date().toISOString()))
@assign(exists.past = true)
@!component('../components/events/past', { doc })
@end
@end

@include('../partials/head')
<section id="events">
@stack('debug')
@if(exists.nextWeek)
<section class="sheet">
@end
@stack('this-week')
@if(exists.nextWeek)
</section>
@end
@if(exists.upcoming)
<section class="sheet">
@end
@stack('upcoming')
@if(exists.upcoming)
</section>
@end
@if(exists.past)
<section class="sheet">
@end
@stack('past')
@if(exists.past)
</section>
@end
@!component('../components/signup', { prompt: true })
</section>
@include('../partials/foot')

8 changes: 4 additions & 4 deletions edge/templates/mailer.edge
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
<section id="edition">
@!component('../components/edition', { edition, heading: true })
</section>
<section id="stops">
<section id="events">
@stack('this-week')
@each(stop in await stops)
@each(event in await events)
@let(doc = await $markdown.render({
file: stop,
file: event,
}))
@if(dateCompare.withinNextWeek(doc.frontmatter.date))
@pushOnceTo('this-week')
<h2 class="header-font">*This Week</h2>
@end
@pushTo('this-week')
@!component('../components/stop', { doc })
@!component('../components/event', { doc })
@end
@end
@end
Expand Down
29 changes: 0 additions & 29 deletions edge/templates/stops.edge

This file was deleted.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"type": "module",
"scripts": {
"check": "tsc --noEmit --erasableSyntaxOnly --allowImportingTsExtensions",
"start": "node --env-file-if-exists=.env ./src/index.ts",
"dev": "npm run check && npm run start | pino-pretty",
"update": "npx npm-check-updates -u"
"start": "node --env-file-if-exists=.env ./src/index.ts | pino-pretty",
"dev": "npm run check && portless backspin npm run start",
"update": "npx npm-check-updates -u",
"portless:config": "portless proxy start --https"
},
"author": "Tierney Cyren <hello@bnb.im>",
"license": "MIT",
Expand All @@ -23,6 +24,7 @@
"@types/luxon": "^3.7.1",
"@types/node": "^25.5.0",
"pino-pretty": "^13.1.3",
"portless": "^0.7.2",
"typescript": "^6.0.2"
}
}
12 changes: 5 additions & 7 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@ server.get('/edition/:slug', async (request: any, reply: any) => {
return reply
});

server.get('/stops/', async (request: any, reply: any) => {
server.get('/events/', async (request: any, reply: any) => {
const data = {
metadata: {
title: 'backspin.nyc',
description: 'backspin is a non-exhaustive newsletter about nightlife and electronic dance music in New York City, authored by Heathcliff'
},
stops: await getAbsolutePathsOfMarkdown('stops')
events: await getAbsolutePathsOfMarkdown('events')
}

reply.view('stops.edge', data)
reply.view('events.edge', data)
return reply
});

Expand All @@ -103,17 +103,15 @@ server.get('/health', async (request, reply) => {

// run the server
const start = async () => {
const port = Number(process.env.SERVER_PORT);
const host = String(process.env.SERVER_HOSTNAME);
const port = Number(process.env.PORT);
const host = String(process.env.HOST);

try {
await server.listen({ port, host });
} catch (err) {
server.log.error(err)
process.exit(1)
}

server.log.info(`Server listening on http://localhost:${port}`)
}

start();
Loading