Merge pull request #6 from archtika/devel

Serve routes without .html file extension
This commit is contained in:
Thilo Hohlt
2024-09-07 18:23:22 +02:00
committed by GitHub
7 changed files with 11 additions and 11 deletions

View File

@@ -70,7 +70,7 @@
"/" = {
root = "/var/www/archtika-websites";
index = "index.html";
tryFiles = "$uri $uri/ $uri/index.html =404";
tryFiles = "$uri $uri/ $uri.html $uri/index.html index.html =404";
extraConfig = ''
autoindex on;
'';

View File

@@ -169,7 +169,7 @@ in
"/previews/" = {
alias = "/var/www/archtika-websites/previews/";
index = "index.html";
tryFiles = "$uri $uri/ $uri/index.html =404";
tryFiles = "$uri $uri/ $uri.html $uri/index.html index.html =404";
};
"/api/" = {
proxyPass = "http://localhost:${toString cfg.apiPort}/";
@@ -190,7 +190,7 @@ in
"/" = {
alias = "/var/www/archtika-websites/$subdomain/";
index = "index.html";
tryFiles = "$uri $uri/ $uri/index.html =404";
tryFiles = "$uri $uri/ $uri.html $uri/index.html index.html =404";
};
};
};

View File

@@ -28,7 +28,7 @@
<Head {title} {favicon} nestingLevel={1} {metaDescription} />
<Nav {logoType} {logo} />
<Nav {logoType} {logo} isIndexPage={false} />
<header>
<div class="container">

View File

@@ -48,7 +48,7 @@
<p>{article.publication_date}</p>
<p>
<strong>
<a href="./articles/{articleFileName}.html">{article.title}</a>
<a href="./articles/{articleFileName}">{article.title}</a>
</strong>
</p>
{#if article.meta_description}

View File

@@ -8,7 +8,7 @@
title: string;
favicon: string;
nestingLevel?: number;
metaDescription: string | null;
metaDescription?: string | null;
} = $props();
</script>

View File

@@ -43,7 +43,7 @@
{#each categorizedArticles[key] as { title }}
{@const articleFileName = title.toLowerCase().split(" ").join("-")}
<li>
<a href="{isIndexPage ? './articles' : '.'}/{articleFileName}.html">{title}</a>
<a href="{isIndexPage ? './articles' : '.'}/{articleFileName}">{title}</a>
</li>
{/each}
</ul>
@@ -52,7 +52,7 @@
</ul>
</section>
{/if}
<a href="../">
<a href={isIndexPage ? "." : ".."}>
{#if logoType === "text"}
<strong>{logo}</strong>
{:else}

View File

@@ -58,13 +58,13 @@ export const load: PageServerLoad = async ({ params, fetch, cookies, parent }) =
: process.env.ORIGIN
? process.env.ORIGIN
: "http://localhost:18000"
}/previews/${websiteOverview.id}/index.html`;
}/previews/${websiteOverview.id}/`;
const websiteProdUrl = dev
? `http://localhost:18000/${websiteOverview.id}/index.html`
? `http://localhost:18000/${websiteOverview.id}/`
: process.env.ORIGIN
? process.env.ORIGIN.replace("//", `//${websiteOverview.id}.`)
: `http://localhost:18000/${websiteOverview.id}/index.html`;
: `http://localhost:18000/${websiteOverview.id}/`;
return {
websiteOverview,