Skip to content

Commit

Permalink
feat: routes are now taking only the end of the posts path
Browse files Browse the repository at this point in the history
example: /data/posts/my_post.md -> /posts/my_post
  • Loading branch information
TayzenDev committed Nov 18, 2024
1 parent df9b1aa commit 6dfe16f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion blog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ export class Article {
postsFolder: string,
name: string,
content: string,
routeBase: string = postsFolder,
routeBase: string = path.basename(postsFolder),
defaultAuthors?: string[],
title?: string,
html?: string,
Expand Down
2 changes: 1 addition & 1 deletion server.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import type { SmallblogConfig } from "./types.ts";
export function createServer(config: SmallblogConfig) {
const server = new Hono();

const postsRoute = path.join("/", config.postsFolder);
const postsRoute = path.basename(path.join("/", config.postsFolder));
const faviconIsUrl = isUrl(config.favicon || "");

const customPages = getArticles(config.pagesFolder, "/")
Expand Down

0 comments on commit 6dfe16f

Please sign in to comment.