Skip to content

Commit

Permalink
Remove nav data from blog routes
Browse files Browse the repository at this point in the history
Signed-off-by: macdonst <[email protected]>
  • Loading branch information
macdonst committed Sep 5, 2024
1 parent 7e38cd1 commit 9c7b4bc
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
5 changes: 0 additions & 5 deletions app/api/blog/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import path from 'path'
import url from 'url'
import { readFileSync } from 'fs'
import { parseDate } from '../../lib/parseDate.mjs'
import navDataLoader from '../../docs/nav-data.mjs'

function isPublished (str) {
return process.env.DISABLE_DATE_CHECK === 'true'
Expand All @@ -26,9 +25,6 @@ export async function get (req) {
const offset = parsedOffset >= 0 ? parsedOffset : 0
const total = posts.length

const { path: activePath } = req
const navData = navDataLoader('docs', activePath)

return {
json: {
posts,
Expand All @@ -38,7 +34,6 @@ export async function get (req) {
total,
account,
activeRoute: 'blog',
navData,
},
}
}
4 changes: 0 additions & 4 deletions app/api/blog/posts/$$.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { URL } from 'url'
import { default as defaultClassMapping } from '../../markdown-class-mappings.mjs'
// import { getWebMentions } from '../../../../shared/webmentions.mjs'
import { readFileSync } from 'fs'
import navDataLoader from '../../../docs/nav-data.mjs'

/** @type {import('@enhance/types').EnhanceApiFn} */
export async function get (req) {
Expand Down Expand Up @@ -66,8 +65,6 @@ export async function get (req) {
? 'max-age=3600;'
: 'no-cache, no-store, must-revalidate, max-age=0, s-maxage=0'

const navData = navDataLoader('docs', activePath)

return {
headers: {
'cache-control': cacheControl,
Expand All @@ -83,7 +80,6 @@ export async function get (req) {
// mentions,
account,
activeRoute: 'blog',
navData,
},
}
}

0 comments on commit 9c7b4bc

Please sign in to comment.