94 lines
2.6 KiB
Svelte
94 lines
2.6 KiB
Svelte
<script lang="ts">
|
|
import FlashMessages from "../components/FlashMessages.svelte";
|
|
import BaseFooter from "./base/BaseFooter.svelte";
|
|
import BaseHeader from "./base/BaseHeader.svelte";
|
|
import CommonScripts from "./CommonScripts.svelte";
|
|
import {locals} from '../../ts/stores.js';
|
|
|
|
export let title: string;
|
|
export let h1: string = title;
|
|
export let description: string;
|
|
export let previewImageUrl: string | undefined = undefined;
|
|
export let refresh_after: number | undefined = undefined;
|
|
export let noHeader: boolean = false;
|
|
export let noH1: boolean = false;
|
|
export let noFooter: boolean = false;
|
|
|
|
export let noLogoLabel = false;
|
|
export let noLoginLink = false;
|
|
</script>
|
|
|
|
<CommonScripts/>
|
|
|
|
<style lang="scss">
|
|
@import "../../scss/vars";
|
|
@import "../../scss/helpers";
|
|
|
|
main {
|
|
@include container;
|
|
flex-grow: 1;
|
|
}
|
|
|
|
.flash-messages {
|
|
@include container;
|
|
}
|
|
</style>
|
|
|
|
<svelte:head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
|
|
<title>{title || 'Undefined title'}</title>
|
|
|
|
<!-- Open Graph / Facebook -->
|
|
<meta property="og:type" content="website">
|
|
<meta property="og:title" content={title}>
|
|
<meta property="og:url" content="{$locals.app.public_url + $locals.url}">
|
|
<meta property="twitter:title" content={title}>
|
|
<meta property="twitter:url" content={$locals.app.public_url + $locals.url}>
|
|
{#if description}
|
|
<meta name="description" content={description}>
|
|
<meta property="og:description" content={description}>
|
|
<meta property="twitter:description" content={description}>
|
|
{/if}
|
|
{#if previewImageUrl}
|
|
<meta property="og:image" content={previewImageUrl}>
|
|
<meta property="twitter:card" content="summary_large_image">
|
|
<meta property="twitter:image" content={previewImageUrl}>
|
|
{/if}
|
|
|
|
<link rel="shortcut icon" type="image/png" href="/img/logox1024.png">
|
|
<link rel="shortcut icon" type="image/png" href="/img/logox128.png">
|
|
<link rel="shortcut icon" type="image/svg" href="/img/logo.svg">
|
|
|
|
{#if refresh_after}
|
|
<meta http-equiv="refresh" content={refresh_after}>
|
|
{/if}
|
|
|
|
<link rel="stylesheet" href="/css/layout.css">
|
|
</svelte:head>
|
|
|
|
{#if !noHeader}
|
|
<BaseHeader {noLogoLabel} {noLoginLink}/>
|
|
{/if}
|
|
|
|
<div class="flash-messages">
|
|
<FlashMessages/>
|
|
</div>
|
|
|
|
<main>
|
|
{#if h1 && !noH1}
|
|
<h1>{h1}</h1>
|
|
{/if}
|
|
{#if $$slots.subtitle}
|
|
<p>
|
|
<slot name="subtitle"/>
|
|
</p>
|
|
{/if}
|
|
<slot/>
|
|
</main>
|
|
|
|
{#if !noFooter}
|
|
<BaseFooter/>
|
|
{/if}
|