ベースパスの取り扱いを変更

This commit is contained in:
moris 2025-03-09 10:57:39 +09:00
parent 91e1ce82d6
commit 9d89d02e4c
7 changed files with 9 additions and 15 deletions

View file

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

View file

@ -3,10 +3,9 @@
import { goto } from "$app/navigation";
import { onMount } from "svelte";
import { base } from '$app/paths'
onMount(() => {
goto(`${base}/post/${data.id}`)
goto(data.id)
})
</script>

View file

@ -102,7 +102,7 @@
<div class="meta">
<div class="category">
<span class="txt">Category:</span>
<a class="tag" href='/blog/category/{data.metadata.category}'>{data.metadata.category}</a>
<a class="tag" href='../../category/{data.metadata.category}'>{data.metadata.category}</a>
</div>
{#if data.metadata.tags.length}
@ -111,7 +111,7 @@
<div class="tags">
<span class="txt">Tag:</span>
{#each data.metadata.tags as tag}
<a class='tag' href='/blog/tag/{tag}'>{tag}</a>
<a class='tag' href='../../tag/{tag}'>{tag}</a>
{/each}
</div>
{/if}

View file

@ -6,8 +6,6 @@
export let share: shareobj;
import { base } from '$app/paths'
let copyed = false;
function copylink() {
@ -42,7 +40,7 @@
</a>
</div>
<div class="rss">
<a href="{base}/feed.rss" target="_blank" aria-label="rss配信">
<a href="../../feed.rss" target="_blank" aria-label="rss配信">
<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

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

View file

@ -1,10 +1,9 @@
<script lang="ts">
const { data } = $props();
import { base } from '$app/paths';
</script>
<ul>
{#each data.codes as code}
<li><a href="{base}/code/{code}">{code}</a></li>
<li><a href="{code}">{code}</a></li>
{/each}
</ul>

View file

@ -1,6 +1,6 @@
export const prerender = true
import path from 'node:path';
import { base } from '$app/paths';
import Metadatas from '$lib/server/Metadatas';
import { PUBLIC_HOSTNAME } from '$env/static/public';
@ -16,7 +16,7 @@ export async function GET() {
for (let post of metalist){
let meta = post.metadata
let link = `https://${PUBLIC_HOSTNAME}/blog/post/${path.basename(post.postId, '.md')}`
let link = `https://${PUBLIC_HOSTNAME}${base}/post/${post.postId}.md`
i++
items += `