Skip to content

Commit

Permalink
feat: update privacy and imprint pages
Browse files Browse the repository at this point in the history
- loads from strapi markdown
- uses tailwind typography plugin for style
  • Loading branch information
m-krebs committed Oct 3, 2024
1 parent 8b21c09 commit fc2e8ba
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 5 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
"@sveltejs/enhanced-img": "^0.3.8",
"@sveltejs/kit": "^2.6.1",
"@sveltejs/vite-plugin-svelte": "^3.1.2",
"@tailwindcss/typography": "^0.5.15",
"autoprefixer": "^10.4.16",
"flowbite": "^2.2.1",
"flowbite-svelte": "^0.44.20",
"marked": "^14.1.2",
"postcss": "^8.4.31",
"postcss-load-config": "^4.0.2",
"prettier-plugin-svelte": "^3.1.2",
Expand Down
13 changes: 12 additions & 1 deletion src/routes/datenschutz/+page.svelte
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
<div>datenschutz</div>
<script lang="ts">
import type { PageData } from "./$types";
import { marked } from "marked";
export let data: PageData;
let privacyMarkdown = data.privacy;
</script>

<article class="prose prose-stone dark:prose-invert max-w-5xl mx-auto mt-10">
{@html marked.parse(privacyMarkdown)}
</article>
7 changes: 7 additions & 0 deletions src/routes/datenschutz/+page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { PageLoad } from "./$types";
import { strapiFetch } from "$lib/utils/api";

export const load: PageLoad = async ({ fetch }) => {
const privacyFetch = await strapiFetch(fetch, "api/privacy?populate=*");
return { privacy: privacyFetch.data.privacy };
};
15 changes: 12 additions & 3 deletions src/routes/impressum/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<div>
Impressum
</div>
<script lang="ts">
import type { PageData } from "./$types";
import { marked } from "marked";
export let data: PageData;
let imprintMarkdown = data.imprint;
</script>

<article class="prose prose-stone dark:prose-invert max-w-5xl mx-auto mt-10">
{@html marked.parse(imprintMarkdown)}
</article>
7 changes: 7 additions & 0 deletions src/routes/impressum/+page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import type { PageLoad } from "./$types";
import { strapiFetch } from "$lib/utils/api";

export const load: PageLoad = async ({ fetch }) => {
const imprintFetch = await strapiFetch(fetch, "api/imprint?populate=*");
return { imprint: imprintFetch.data.imprint };
};
3 changes: 2 additions & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { fontFamily } from "tailwindcss/defaultTheme";
import tailwindcssAnimate from "tailwindcss-animate";
import typography from "@tailwindcss/typography";

/** @type {import('tailwindcss').Config} */
const config = {
Expand Down Expand Up @@ -34,7 +35,7 @@ const config = {
},
},
},
plugins: [tailwindcssAnimate],
plugins: [tailwindcssAnimate, typography],
};

export default config;

0 comments on commit fc2e8ba

Please sign in to comment.