Browse Source

feat: 403 解消(#168) (#187)

#168

#168

Co-authored-by: miteruzo <miteruzo@naver.com>
Reviewed-on: https://git.miteruzo.com/miteruzo/btrc-hub/pulls/187
pull/191/head
みてるぞ 2 weeks ago
parent
commit
0353961a72
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      frontend/scripts/generate-sitemap.js

+ 2
- 3
frontend/scripts/generate-sitemap.js View File

@@ -19,7 +19,6 @@ const fetchPosts = async tagName => (await axios.get (`${ API_BASE_URL }/posts`,
{ params: { ...(tagName && { tags: tagName,
match: 'all',
limit: '20' }) } })).data.posts
const fetchPostIds = async () => (await fetchPosts ()).map (post => post.id)

const fetchTags = async () => (await axios.get (`${ API_BASE_URL }/tags`)).data
const fetchTagNames = async () => (await fetchTags ()).map (tag => tag.name)
@@ -33,7 +32,7 @@ const createPostListOutlet = async tagName => `
<div class="flex gap-4"><a href="#" class="font-bold">広場</a></div>
<div class="mt-2">
<div class="flex flex-wrap gap-6 p-4">
${ (await fetchPosts (tagName)).map (post => `
${ (await fetchPosts (tagName)).slice (0, 20).map (post => `
<a class="w-40 h-40 overflow-hidden rounded-lg shadow-md hover:shadow-lg"
href="/posts/${ post.id }">
<img alt="${ post.title }"
@@ -42,7 +41,7 @@ const createPostListOutlet = async tagName => `
fetchpriority="high"
decoding="async"
class="object-none w-full h-full"
src="${ post.url }" />
src="${ post.thumbnail }" />
</a>`).join ('') }
</div>
</div>


Loading…
Cancel
Save