mirror of
https://github.com/thiloho/archtika.git
synced 2025-11-22 10:51:36 +01:00
Add base template for website preview route
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
Light accent color:
|
||||
Dark accent color:
|
||||
<input
|
||||
type="color"
|
||||
name="accent-color-dark"
|
||||
|
||||
@@ -50,12 +50,13 @@ export const load = async ({ params, fetch, cookies, url, parent }) => {
|
||||
});
|
||||
|
||||
const articles = await articlesData.json();
|
||||
const { website } = await parent();
|
||||
const { website, home } = await parent();
|
||||
|
||||
return {
|
||||
totalArticleCount,
|
||||
articles,
|
||||
website
|
||||
website,
|
||||
home
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
>
|
||||
<input type="hidden" name="id" value={id} />
|
||||
|
||||
<button type="submit">Permanently delete article</button>
|
||||
<button type="submit">Delete article</button>
|
||||
</form>
|
||||
</Modal>
|
||||
</div>
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
<WebsiteEditor
|
||||
id={data.website.id}
|
||||
title={data.website.title}
|
||||
previewContent={data.article.main_content}
|
||||
previewContent={data.article.main_content ||
|
||||
"Put some markdown content in main content to see a live preview here"}
|
||||
>
|
||||
<section>
|
||||
<h2>Edit article</h2>
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import { randomUUID } from "node:crypto";
|
||||
import { mkdir, writeFile } from "node:fs/promises";
|
||||
import { extname, join, relative } from "node:path";
|
||||
|
||||
export const load = async ({ parent }) => {
|
||||
const { website } = await parent();
|
||||
|
||||
return {
|
||||
website
|
||||
};
|
||||
};
|
||||
|
||||
export const actions = {
|
||||
publishWebsite: async ({ fetch }) => {
|
||||
console.log("test");
|
||||
}
|
||||
};
|
||||
|
||||
const generateWebsiteOutput = async () => {};
|
||||
@@ -0,0 +1,27 @@
|
||||
<script lang="ts">
|
||||
import { enhance } from "$app/forms";
|
||||
import WebsiteEditor from "$lib/components/WebsiteEditor.svelte";
|
||||
|
||||
const { data } = $props();
|
||||
</script>
|
||||
|
||||
<WebsiteEditor
|
||||
id={data.website.id}
|
||||
title={data.website.title}
|
||||
previewContent="https://aurora.thilohohlt.com"
|
||||
fullPreview={true}
|
||||
>
|
||||
<section>
|
||||
<h2>Publish website</h2>
|
||||
|
||||
<p>
|
||||
The preview area on this page allows you to see exactly how your website will look when it is
|
||||
is published. If you are happy with the results, click the button below and your website will
|
||||
be published on the Internet.
|
||||
</p>
|
||||
|
||||
<form method="POST" action="?/publishWebsite" use:enhance>
|
||||
<button type="submit">Publish</button>
|
||||
</form>
|
||||
</section>
|
||||
</WebsiteEditor>
|
||||
Reference in New Issue
Block a user