Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions create-redirects.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,18 @@ const template =
// This file is auto-generated. Do not edit directly.
// see: ./create-redirects.js

import { addBase } from '$lib';
import Wrapper from '$lib/components/Wrapper.svelte';

</script>

<svelte:head>
<meta http-equiv="refresh" content="0; url={addBase('{to}')}" />
<meta http-equiv="refresh" content="0; url={to}" />
<title>Redirecting...</title>
</svelte:head>

<Wrapper>
<h1>Redirecting...</h1>
<p>If you are not redirected automatically, please click <a href={addBase("{to}")}>here</a>.</p>
<p>If you are not redirected automatically, please click <a href="{to}">here</a>.</p>
</Wrapper>

<style>
Expand Down
4 changes: 1 addition & 3 deletions src/lib/components/Button.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
<script lang="ts">
import { addBase } from "$lib/index.ts";

let {
href,
children,
Expand All @@ -22,7 +20,7 @@
}
</script>

<a href={addBase(href)} class={cssClass} data-test={dataTest}>
<a href={href} class={cssClass} data-test={dataTest}>
{@render children()}
{#if arrow}
Expand Down
5 changes: 2 additions & 3 deletions src/lib/components/Carousel.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<script lang="ts">
import emblaCarouselSvelte from 'embla-carousel-svelte';
import Autoplay from 'embla-carousel-autoplay'
import { addBase } from '$lib';
import Autoplay from 'embla-carousel-autoplay'

let options = { loop: false }
let plugins = [Autoplay()]
Expand All @@ -13,7 +12,7 @@
<div class="embla__container">
{#each imgs as img}
<div class="embla__slide">
<img src={addBase(img)} alt="Carousel" />
<img src={img} alt="Carousel" />
</div>
{/each}
</div>
Expand Down
9 changes: 4 additions & 5 deletions src/lib/components/Header.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import { page } from '$app/stores';
import { addBase } from '$lib';

import { m } from '$lib/paraglide/messages.js';

Expand Down Expand Up @@ -48,8 +47,8 @@
</script>

<header data-test="site-header">
<a href={addBase('/')} class="logo-link" data-test="site-logo-link">
<img class="logo" src={addBase("/layout/header/logo.min.png")} alt="">
<a href={'/'} class="logo-link" data-test="site-logo-link">
<img class="logo" src={"/layout/header/logo.min.png"} alt="">

{#if currentUrl === '/'}
<h1 class="logotype">{m['common.scn']()}</h1>
Expand All @@ -63,15 +62,15 @@

showNav = !showNav;
}}>
<img src={addBase("/layout/nav-hamburger.svg")} alt={m['common.toggle_nav']()}>
<img src={"/layout/nav-hamburger.svg"} alt={m['common.toggle_nav']()}>
</button>
</header>

<nav class="nav" data-test="site-nav">
<div class="nav-items" class:show-nav={showNav}>
{#each navItems as {href, label}}
<a
href={addBase(href)}
href={href}
class="nav-link"
class:active={href === currentUrl}
onclick={(e) => {
Expand Down
3 changes: 1 addition & 2 deletions src/lib/components/Partners.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import { m } from '$lib/paraglide/messages.js';
import { addBase } from '$lib';
</script>

<h2>
Expand All @@ -11,4 +10,4 @@
{m['pages.home.partners.paragraphs.0']()}
</p>

<img src={addBase("/pages/home/scn-partner-logos.min.png")} loading="lazy" alt={m['pages.home.partners.alt']()} />
<img src={"/pages/home/scn-partner-logos.min.png"} loading="lazy" alt={m['pages.home.partners.alt']()} />
3 changes: 1 addition & 2 deletions src/lib/components/Socials.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import { m } from "$lib/paraglide/messages.js";
import { addBase } from "$lib";

// type can be "light" or "dark"

Expand Down Expand Up @@ -43,7 +42,7 @@
<div class={cssClass}>
{#each socials as { href, cta, src }}
<a {href} data-test={`social-${cta.toLowerCase()}`}>
<img src={addBase(src[type])} alt={cta} />
<img src={src[type]} alt={cta} />
</a>
{/each}
</div>
Expand Down
3 changes: 0 additions & 3 deletions src/lib/index.ts

This file was deleted.

16 changes: 8 additions & 8 deletions src/routes/+error.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
<script lang="ts">
import { page } from '$app/state';

import { addBase } from '$lib';

import { m } from '$lib/paraglide/messages.js';
import Wrapper from '$lib/components/Wrapper.svelte';
import PageTitle from '$lib/components/Page-Title.svelte';
Expand All @@ -19,21 +17,23 @@
description : m['pages.error.500.description'](),
cta : m['pages.error.500.cta']()
}
}
};

let { status = 404 as 404 | 500 } = $props();
</script>

<PageTitle title={errors[page.status].title} />
<PageTitle title={errors[status].title} />

<Wrapper>
<h1>
{page.status} {errors[page.status].title}
{status} {errors[status].title}
</h1>
<p>
{errors[page.status].description}
{errors[status].description}
</p>
<p>
<a href={addBase('/')} class="button">
{errors[page.status].cta}
<a href={'/'} class="button">
{errors[status].cta}
</a>
</p>
</Wrapper>
10 changes: 4 additions & 6 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import Panel from '$lib/components/Panel.svelte';
import PageTitle from '$lib/components/Page-Title.svelte';

import { addBase } from '$lib';

const overview = [
m['pages.home.overview.paragraphs.0'](),
m['pages.home.overview.paragraphs.1'](),
Expand Down Expand Up @@ -48,7 +46,7 @@
<Wrapper>
<section class="center" data-test="home-hero">
<Button
href={addBase(m['pages.home.hero.href']())}
href={m['pages.home.hero.href']()}
type="wide"
arrow={true}
dataTest="home-hero-cta"
Expand All @@ -59,7 +57,7 @@

<section data-test="home-building-image">
<img
src={addBase(m['pages.home.building.src']())}
src={m['pages.home.building.src']()}
alt={m['pages.home.building.alt']()}
/>
</section>
Expand All @@ -77,7 +75,7 @@
<div class="flex-right">
<Button
type="small"
href={addBase(m['pages.home.overview.about.href']())}
href={m['pages.home.overview.about.href']()}
arrow={true}
dataTest="home-overview-cta"
>
Expand All @@ -94,7 +92,7 @@

<div class="button-row">
{#each buttons as { href, cta, dataTest } }
<Button href={addBase(href)} arrow={true} dataTest={dataTest}>
<Button href={href} arrow={true} dataTest={dataTest}>
{cta}
</Button>
{/each}
Expand Down
5 changes: 2 additions & 3 deletions src/routes/about-us/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<script lang="ts">
import { m } from "$lib/paraglide/messages.js";
import { addBase } from "$lib";
import { m } from "$lib/paraglide/messages.js";

import Wrapper from "$lib/components/Wrapper.svelte";
import Button from "$lib/components/Button.svelte";
Expand Down Expand Up @@ -66,7 +65,7 @@
<p>{@html paragraph}</p>
{/each}

<img src={addBase(section.img.src)} alt={section.img.alt} />
<img src={section.img.src} alt={section.img.alt} />
</Panel>
</section>
{/each}
Expand Down
5 changes: 2 additions & 3 deletions src/routes/aboutUs.html/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
// This file is auto-generated. Do not edit directly.
// see: ./create-redirects.js

import { addBase } from '$lib';
import Wrapper from '$lib/components/Wrapper.svelte';

</script>

<svelte:head>
<meta http-equiv="refresh" content="0; url={addBase('/about-us')}" />
<meta http-equiv="refresh" content="0; url=/about-us" />
<title>Redirecting...</title>
</svelte:head>

<Wrapper>
<h1>Redirecting...</h1>
<p>If you are not redirected automatically, please click <a href={addBase("/about-us")}>here</a>.</p>
<p>If you are not redirected automatically, please click <a href="/about-us">here</a>.</p>
</Wrapper>

<style>
Expand Down
5 changes: 2 additions & 3 deletions src/routes/donate.html/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
// This file is auto-generated. Do not edit directly.
// see: ./create-redirects.js

import { addBase } from '$lib';
import Wrapper from '$lib/components/Wrapper.svelte';

</script>

<svelte:head>
<meta http-equiv="refresh" content="0; url={addBase('/donate')}" />
<meta http-equiv="refresh" content="0; url=/donate" />
<title>Redirecting...</title>
</svelte:head>

<Wrapper>
<h1>Redirecting...</h1>
<p>If you are not redirected automatically, please click <a href={addBase("/donate")}>here</a>.</p>
<p>If you are not redirected automatically, please click <a href="/donate">here</a>.</p>
</Wrapper>

<style>
Expand Down
9 changes: 3 additions & 6 deletions src/routes/donate/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<script lang="ts">
import { base } from '$app/paths';

import { m } from '$lib/paraglide/messages.js';
import { addBase } from '$lib';

import Button from '$lib/components/Button.svelte';
import PageTitle from '$lib/components/Page-Title.svelte';
Expand All @@ -23,7 +20,7 @@

<PageTitle title={m['pages.donate.title']()} />

<div class="wave" style="--wave-url: url({`${base}/pages/donate/upsidedown-wave.min.png`})">
<div class="wave" style="--wave-url: url(/pages/donate/upsidedown-wave.min.png)">
<Wrapper dataTest="donate-page">
<section class="text-center" data-test="donate">
<h1>{m['pages.donate.header']()}</h1>
Expand All @@ -37,9 +34,9 @@
<input type="hidden" name="currency_code" value="USD" />
<button class="paypal-button">
<!--<img id = "paypal-graphic" src = "assets/paypal button.png" alt = "paypal button">-->
<input type="image" src={addBase("/layout/paypal-button.png")} name="submit" title="Paypal donations are made to lcl@seattlecommunitynetwork.org." alt="Donate with PayPal button" />
<input type="image" src={"/layout/paypal-button.png"} name="submit" title="Paypal donations are made to lcl@seattlecommunitynetwork.org." alt="Donate with PayPal button" />
</button>
<img alt="" src={addBase("https://www.paypal.com/en_US/i/scr/pixel.gif")} width="1" height="1" />
<img alt="" src={"https://www.paypal.com/en_US/i/scr/pixel.gif"} width="1" height="1" />
</form>

{#each buttons as { href, cta }}
Expand Down
8 changes: 2 additions & 6 deletions src/routes/our-sites/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import PageTitle from "$lib/components/Page-Title.svelte";
import Button from "$lib/components/Button.svelte";

import { addBase } from "$lib";

const detailsList = [
m["pages.sites.details.list.0"](),
m["pages.sites.details.list.1"](),
Expand Down Expand Up @@ -48,7 +46,7 @@
<h2>{m["pages.sites.details.header"]()}</h2>
<p>{m["pages.sites.details.paragraphs.0"]()}</p>
<img
src={addBase(m["pages.sites.details.img.src"]())}
src={m["pages.sites.details.img.src"]()}
alt={m["pages.sites.details.img.alt"]()}
class="img-center"
/>
Expand Down Expand Up @@ -85,9 +83,7 @@
{#each locations as location}
<div class="location">
<img
src={addBase(
m[`pages.sites.locations.locations.${location}.src`](),
)}
src={m[`pages.sites.locations.locations.${location}.src`]()}
alt={m[`pages.sites.locations.locations.${location}.alt`]()}
/>

Expand Down
5 changes: 2 additions & 3 deletions src/routes/ourSites.html/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
// This file is auto-generated. Do not edit directly.
// see: ./create-redirects.js

import { addBase } from '$lib';
import Wrapper from '$lib/components/Wrapper.svelte';

</script>

<svelte:head>
<meta http-equiv="refresh" content="0; url={addBase('/our-sites')}" />
<meta http-equiv="refresh" content="0; url=/our-sites" />
<title>Redirecting...</title>
</svelte:head>

<Wrapper>
<h1>Redirecting...</h1>
<p>If you are not redirected automatically, please click <a href={addBase("/our-sites")}>here</a>.</p>
<p>If you are not redirected automatically, please click <a href="/our-sites">here</a>.</p>
</Wrapper>

<style>
Expand Down
10 changes: 9 additions & 1 deletion svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ const config = {
fallback: '404.html'
}),
paths: {
base: process.env.BASE_PATH || ''
},
prerender: {
entries: [
'*',
'/donate',
'/about-us',
'/our-sites'
],
handleUnseenRoutes: 'warn'
}
}
};
Expand Down