fix: 相対リンクの修正

This commit is contained in:
moris 2024-11-30 21:48:25 +09:00
parent 647558d4fd
commit 25c1f9fe2c
8 changed files with 28 additions and 8 deletions

View File

@ -9,7 +9,7 @@
{#each data.posts as post}
{#if post.metadata.published}
<div class="post">
<a style='text-decoration: none;' href="./post/{post.postId}" tabindex="0">
<a style='text-decoration: none;' href="../post/{post.postId}" tabindex="0">
<Postgrid id={post.postId} {...post.metadata}></Postgrid>
</a>
</div>
@ -23,9 +23,9 @@
</div>
<div class='paging'>
<a href='{data.pageNo==0? "":Number(data.pageNo)-1}' style:visibility={data.pageNo==0? 'hidden':''}></a>
<a href='../{data.pageNo==0? "":Number(data.pageNo)-1}' style:visibility={data.pageNo==0? 'hidden':''}></a>
<span>{data.pageNo}</span><span>/</span><span>{data.lastPage}</span>
<a href='{data.pageNo==data.lastPage? "":Number(data.pageNo)+1}' style:visibility={data.pageNo==data.lastPage? 'hidden':''}></a>
<a href='../{data.pageNo==data.lastPage? "":Number(data.pageNo)+1}' style:visibility={data.pageNo==data.lastPage? 'hidden':''}></a>
</div>
</div>

View File

@ -4,6 +4,6 @@
{#each data.cats as cat}
<div>
<a href="./category/{cat}">{cat}</a>
<a href="{cat}">{cat}</a>
</div>
{/each}

View File

@ -0,0 +1,11 @@
import Metadatas from "$lib/server/Metadatas";
export async function load({params}) {
const cat = params.slug
const metalist = await Metadatas()
const result = metalist.filter((meta)=>meta.metadata.category == cat).map((meta)=>meta.postId)
return {posts: result}
}

View File

@ -0,0 +1,8 @@
<script>
import { base } from '$app/paths'
const { data } = $props();
</script>
{#each data.posts as post}
<div><a href="{base}/post/{post}">{post}</a></div>
{/each}

View File

@ -70,7 +70,7 @@
<div class="data">
<div><a target="_blank" href="https://git.moris.day/moris/test-sub/commits/branch/main/Posts/{data.id}.md">History</a></div>
<div class="spacer"></div>
<div><a target="_blank" href="{data.id}/raw">Raw file</a></div>
<div><a target="_blank" href="raw">Raw file</a></div>
</div>
</article>

View File

@ -35,7 +35,7 @@
</a>
</div>
<div class="rss">
<a href="/blog/feed.rss" target="_blank" aria-label="rss配信" type="application/rss+xml">
<a href="/blog/feed.rss" aria-label="rss配信" type="application/rss+xml">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M200-120q-33 0-56.5-23.5T120-200q0-33 23.5-56.5T200-280q33 0 56.5 23.5T280-200q0 33-23.5 56.5T200-120Zm480 0q0-117-44-218.5T516-516q-76-76-177.5-120T120-680v-120q142 0 265 53t216 146q93 93 146 216t53 265H680Zm-240 0q0-67-25-124.5T346-346q-44-44-101.5-69T120-440v-120q92 0 171.5 34.5T431-431q60 60 94.5 139.5T560-120H440Z"/></svg>
</a>
</div>

View File

@ -4,6 +4,6 @@
{#each data.tags as tag}
<div>
<a href="./tag/{tag}">{tag}</a>
<a href="{tag}">{tag}</a>
</div>
{/each}

View File

@ -1,7 +1,8 @@
<script>
import { base } from '$app/paths'
const { data } = $props();
</script>
{#each data.posts as post}
<a href="{post}}">{post}</a>
<div><a href="{base}/post/{post}">{post}</a></div>
{/each}