Skip to content

Commit 424acfd

Browse files
authored
Refactor/misc (#24)
* fix formatting * add and remove comments * add default theme * add function too websites pages
1 parent 05a364e commit 424acfd

9 files changed

Lines changed: 8 additions & 19 deletions

File tree

src/app.d.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
declare const __COMMIT_HASH__: string;
33

44
declare global {
5-
//----------------------------------------------------------------------
6-
// svelte internals
7-
//----------------------------------------------------------------------
8-
95
const __COMMIT_HASH__: string;
106

117
namespace App {

src/app.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!doctype html>
2-
<html lang="en">
2+
<html lang="en" data-theme="catppuccin">
33
<head>
44
<meta charset="utf-8" />
55
<meta name="viewport" content="width=device-width, initial-scale=1" />

src/routes/+error.svelte

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<div class="text-center">
1919
<h1 class="text-3xl font-bold text-primary">{status}</h1>
2020
<p class="mt-4 text-center text-sm text-base-content/40">{description}</p>
21+
<!-- actions -->
2122
<a href={resolve('/')} class="btn mt-6 btn-primary"> Back to home </a>
2223
{#if status !== 404}
2324
<button onclick={() => location.reload()} class="btn mt-6"> Try again </button>

src/routes/+page.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
<div class="mx-auto mt-6 flex flex-col items-center gap-4 sm:mt-20 sm:flex-row">
1111
<a class="btn btn-primary" href={resolve('/privacy-news')}> Privacy News </a>
12-
1312
<a class="btn btn-primary" href={resolve('/awesome-privacy')}> Awesome Privacy </a>
1413
<a class="btn btn-primary" href={resolve('/websites')}> Websites </a>
1514
</div>

src/routes/awesome-privacy/+layout.server.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@ import { awesomePrivacy } from '$lib/features/awesome-privacy/service';
44
import type { AwesomePrivacyData } from '$lib/features/awesome-privacy/types';
55

66
export const load: LayoutServerLoad = ({ setHeaders }) => {
7-
setHeaders({
8-
'cache-control': 'public, max-age=3600'
9-
});
7+
setHeaders({ 'cache-control': 'public, max-age=3600' });
108

119
const awesomePrivacyData = awesomePrivacy.getData();
1210

src/routes/awesome-privacy/+page.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,5 @@
1818
>
1919
</header>
2020

21-
<!-- Bento Grid -->
2221
<FeaturedCategories categories={data.categories} />
2322
</main>

src/routes/websites/+page.svelte

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
import { Heading } from '$lib/components/headings';
33
import { Link, Text } from '$lib/components/text';
44
import websites from '$lib/data/websites.json';
5+
6+
function stripProtocol(url: string): string {
7+
return url.replace(/https?:\/\//, '');
8+
}
59
</script>
610

711
<main class="mx-auto max-w-3xl px-4 py-8">
@@ -25,7 +29,7 @@
2529
class="block rounded-lg bg-base-100 px-2 py-1.5 font-semibold"
2630
external
2731
>
28-
{website.replace(/https?:\/\//, '')}
32+
{stripProtocol(website)}
2933
</Link>
3034
</li>
3135
{/each}

svelte.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ import adapter from '@sveltejs/adapter-cloudflare';
33
/** @type {import('@sveltejs/kit').Config} */
44
const config = {
55
kit: {
6-
// adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list.
7-
// If your environment is not supported, or you settled on a specific environment, switch out the adapter.
8-
// See https://svelte.dev/docs/kit/adapters for more information about adapters.
96
adapter: adapter()
107
}
118
};

tsconfig.json

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,4 @@
1313
"moduleResolution": "bundler",
1414
"types": ["@testing-library/jest-dom"]
1515
}
16-
// Path aliases are handled by https://svelte.dev/docs/kit/configuration#alias
17-
// except $lib which is handled by https://svelte.dev/docs/kit/configuration#files
18-
//
19-
// To make changes to top-level options such as include and exclude, we recommend extending
20-
// the generated config; see https://svelte.dev/docs/kit/configuration#typescript
2116
}

0 commit comments

Comments
 (0)