絶対パスのベースパスは環境変数で設定する
This commit is contained in:
parent
0424002525
commit
7e10f5cb8d
4 changed files with 10 additions and 11 deletions
|
@ -3,4 +3,7 @@ PUBLIC_HOSTNAME = 'moris.day'
|
|||
|
||||
# Post
|
||||
POST_DIR = '/home/user/BlogPosts'
|
||||
PUBLIC_POST_REPO = 'https://github.com/moris/Posts'
|
||||
PUBLIC_POST_REPO = 'https://github.com/moris/Posts'
|
||||
|
||||
# Base Path
|
||||
PUBLIC_BASEPATH = '/blog'
|
|
@ -2,13 +2,12 @@
|
|||
const { data } = $props();
|
||||
import Postgrid from './grid.svelte'
|
||||
|
||||
import { base } from '$app/paths';
|
||||
import { PUBLIC_HOSTNAME } from '$env/static/public';
|
||||
import { PUBLIC_HOSTNAME, PUBLIC_BASEPATH } from '$env/static/public';
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>記事一覧 | moris.day Blog</title>
|
||||
<link rel="canonical" href="https://{PUBLIC_HOSTNAME}{base}/0/" />
|
||||
<link rel="canonical" href="https://{PUBLIC_HOSTNAME}{PUBLIC_BASEPATH}/0/" />
|
||||
</svelte:head>
|
||||
|
||||
|
||||
|
|
|
@ -5,14 +5,13 @@
|
|||
import Share from './share.svelte'
|
||||
import Profile from './profile.svelte'
|
||||
import Metadata from './metadata.svelte'
|
||||
import { base } from '$app/paths';
|
||||
import { PUBLIC_HOSTNAME, PUBLIC_POST_REPO } from '$env/static/public';
|
||||
import { PUBLIC_HOSTNAME, PUBLIC_BASEPATH, PUBLIC_POST_REPO } from '$env/static/public';
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
import '$lib/components/Markdown/rainbow.css';
|
||||
import '$lib/components/Markdown/Markdown.css';
|
||||
|
||||
const baseURL = `https://${PUBLIC_HOSTNAME}${base}`
|
||||
const baseURL = `https://${PUBLIC_HOSTNAME}${PUBLIC_BASEPATH}`
|
||||
const canonical = `${baseURL}/post/${data.id}/`
|
||||
const thumbnail = data.metadata.thumbnail
|
||||
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
export const prerender = true
|
||||
|
||||
import { base } from '$app/paths';
|
||||
|
||||
import Metadatas from '$lib/server/Metadatas';
|
||||
import { PUBLIC_HOSTNAME } from '$env/static/public';
|
||||
import { PUBLIC_HOSTNAME, PUBLIC_BASEPATH } from '$env/static/public';
|
||||
|
||||
/** @type {import('./$types').RequestHandler} */
|
||||
export async function GET() {
|
||||
|
@ -16,7 +14,7 @@ export async function GET() {
|
|||
for (let post of metalist){
|
||||
|
||||
let meta = post.metadata
|
||||
let link = `https://${PUBLIC_HOSTNAME}${base}/post/${post.postId}.md`
|
||||
let link = `https://${PUBLIC_HOSTNAME}${PUBLIC_BASEPATH}/post/${post.postId}.md`
|
||||
|
||||
i++
|
||||
items += `
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue