Compare commits

...

10 Commits

9 changed files with 45 additions and 22 deletions

View File

@ -3,6 +3,3 @@ PUBLIC_HOSTNAME = 'moris.day'
# Post
PUBLIC_POST_REPO = 'https://git.moris.day/moris/Posts'
# Access token (optional)
TOKEN = ''

View File

@ -53,7 +53,7 @@ img {
}
@media (scripting: none) {
.js {display: none;}
.js {display: none !important;}
}

View File

@ -96,6 +96,6 @@
}
@media (scripting: none) {
header{height:50px !important;}
.headerContainer{height:50px !important;}
}
</style>

View File

@ -1,5 +1,11 @@
<svelte:head>
<meta http-equiv="Refresh" content="0; URL=0" />
</svelte:head>
<script>
import { goto } from "$app/navigation";
import { onMount } from "svelte";
import { base } from '$app/paths'
onMount(() => {
goto(`${base}/0`)
})
</script>
To show posts, click <a href="/blog/0">here</a>

View File

@ -0,0 +1,9 @@
import Metas from '$lib/server/Metadatas';
export async function load(){
const postList = await Metas()
let id = postList[0].postId
return {id}
}

View File

@ -0,0 +1,7 @@
<script>
const { data } = $props();
</script>
<svelte:head>
<meta http-equiv="Refresh" content="0; URL={data.id}" />
</svelte:head>

View File

@ -6,7 +6,7 @@
import Share from './share.svelte'
import Profile from './profile.svelte'
import { base } from '$app/paths';
import { PUBLIC_HOSTNAME } from '$env/static/public';
import { PUBLIC_HOSTNAME, PUBLIC_POST_REPO } from '$env/static/public';
const baseURL = `https://${PUBLIC_HOSTNAME}${base}`
@ -68,9 +68,11 @@
</div>
<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="raw">Raw file</a></div>
{#if PUBLIC_POST_REPO}
<div><a target="_blank" href="{PUBLIC_POST_REPO}/commits/branch/main/Posts/{data.id}.md">History</a></div>
<div class="spacer"></div>
{/if}
<div><a target="_blank" href="raw.md">Raw file</a></div>
</div>
</article>
@ -80,15 +82,15 @@
<Profile></Profile>
</div>
<div>
<Share share={{url:`${baseURL}/post/${data.postId}`, title:data.metadata.title}} />
<Share share={{url:`${baseURL}/post/${data.id}`, title:data.metadata.title}} />
</div>
<div id='toc'>
<Toc toclist={data.heading}></Toc>
</div>
<div class="mi-posts">
<!--
{#if data.heading.length!=0}
<div id='toc'>
<Toc toclist={data.heading}></Toc>
</div>
{/if}
<div class="mi-posts js">
<iframe src="https://mi.moris.day/embed/user-timeline/9w7bhjzt2b5z0001?maxHeight=300&rounded=false&border=false" title="moris's posts" data-misskey-embed-id="v1_fe3a992c-ac63-42f9-9339-d657fe56462f" loading="lazy" referrerpolicy="strict-origin-when-cross-origin" style="width:100%; height:300px; border:solid #8884 1px; border-radius:8px; box-sizing:border-box"></iframe>
-->
</div>
</div>
</aside>

View File

@ -1,6 +1,8 @@
<script>
export let share;
import { base } from '$app/paths'
let copyed = false;
function copylink() {
@ -12,7 +14,7 @@
<div style="margin:4px 0 0 8px;color:#aaaa;font-size:0.85em">Share</div>
<div id="share">
<button class="link" type="button" on:click={copylink} aria-label="urlをコピー" title="copy url">
<button class="link js" type="button" on:click={copylink} aria-label="urlをコピー" title="copy url">
{#if copyed}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M620-163 450-333l56-56 114 114 226-226 56 56-282 282Zm220-397h-80v-200h-80v120H280v-120h-80v560h240v80H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h167q11-35 43-57.5t70-22.5q40 0 71.5 22.5T594-840h166q33 0 56.5 23.5T840-760v200ZM480-760q17 0 28.5-11.5T520-800q0-17-11.5-28.5T480-840q-17 0-28.5 11.5T440-800q0 17 11.5 28.5T480-760Z"/></svg>
{:else}
@ -35,7 +37,7 @@
</a>
</div>
<div class="rss">
<a href="/blog/feed.rss" aria-label="rss配信" type="application/rss+xml">
<a href="{base}/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>