refactor: moves /txt/*.txt to /*.txt
This commit is contained in:
parent
e2b7c18692
commit
0672a761e3
13 changed files with 17 additions and 14 deletions
|
|
@ -19,7 +19,7 @@ export async function GET(context: APIContext) {
|
|||
...txtFiles.map(txt => ({
|
||||
title: txt.name,
|
||||
pubDate: txt.date,
|
||||
link: `/txt/${txt.name}`,
|
||||
link: `/${txt.name}`,
|
||||
description: txt.name,
|
||||
})),
|
||||
...bookmarks.map(b => ({
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ try {
|
|||
<details open>
|
||||
<summary>txt</summary>
|
||||
<pre set:html={[
|
||||
...txtFiles.slice(0, 10).map(f => formatListItem(f.date, `/txt/${f.name}`, f.name, { pinned: f.pinned })),
|
||||
...txtFiles.slice(0, 10).map(f => formatListItem(f.date, `/${f.name}`, f.name, { pinned: f.pinned })),
|
||||
...(txtFiles.length > 10 ? [`<a href="/txt/">+${txtFiles.length - 10} more</a>`] : [])
|
||||
].join('\n')} />
|
||||
</details>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ export async function GET(context: APIContext) {
|
|||
|
||||
const urls = [
|
||||
...posts.map(post => `/md/${getSlug(post.id)}`),
|
||||
...txtFiles.map(txt => `/txt/${txt}`),
|
||||
...txtFiles.map(txt => `/${txt}`),
|
||||
...bookmarks.map(b => b.data.url),
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export async function GET(context: APIContext) {
|
|||
'/md',
|
||||
...posts.map(post => `/md/${getSlug(post.id)}`),
|
||||
'/txt',
|
||||
...txtFiles.map(txt => `/txt/${txt}`),
|
||||
...txtFiles.map(txt => `/${txt}`),
|
||||
'/bookmarks',
|
||||
'/guestbook',
|
||||
].map(p => `${site}${p}`);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,6 @@ const txtFiles = getTxtFiles();
|
|||
|
||||
<details open>
|
||||
<summary>txt</summary>
|
||||
<pre set:html={txtFiles.map(f => formatListItem(f.date, `/txt/${f.name}`, f.name, { pinned: f.pinned })).join('\n')} />
|
||||
<pre set:html={txtFiles.map(f => formatListItem(f.date, `/${f.name}`, f.name, { pinned: f.pinned })).join('\n')} />
|
||||
</details>
|
||||
</Layout>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue