diff --git a/src/lib/app/markdown/renderers/plugins.js b/src/lib/app/markdown/renderers/plugins.js
index a83bacf7..4dfddab7 100644
--- a/src/lib/app/markdown/renderers/plugins.js
+++ b/src/lib/app/markdown/renderers/plugins.js
@@ -104,7 +104,7 @@ export { regexes as CONTENT_REGEXES }
/**
* Convert links to local app links
*/
-export const photonify = (link) => {
+export const localizeLink = (link) => {
if (regexes.community.test(link)) {
const match = link.match(regexes.community)
if (!match) return
diff --git a/src/lib/app/markdown/renderers/plugins.test.ts b/src/lib/app/markdown/renderers/plugins.test.ts
index 67654f94..ab35b410 100644
--- a/src/lib/app/markdown/renderers/plugins.test.ts
+++ b/src/lib/app/markdown/renderers/plugins.test.ts
@@ -1,113 +1,113 @@
import { describe, it, expect } from 'vitest'
-import { photonify, CONTENT_REGEXES } from './plugins'
+import { localizeLink, CONTENT_REGEXES } from './plugins'
// ---------------------------------------------------------------------------
-// photonify() - user links
+// localizeLink() - user links
// ---------------------------------------------------------------------------
-describe('photonify - user links', () => {
+describe('localizeLink - user links', () => {
it('rewrites user link with @ to /profile/ path (no instance appended)', () => {
- const result = photonify('https://lemmy.world/u/alice@instance.com')
+ const result = localizeLink('https://lemmy.world/u/alice@instance.com')
expect(result).toBe('/profile/alice@instance.com')
})
it('rewrites user link without @ to /profile/ path with instance appended', () => {
- const result = photonify('https://lemmy.world/u/alice')
+ const result = localizeLink('https://lemmy.world/u/alice')
expect(result).toBe('/profile/alice@lemmy.world')
})
it('handles user link with dots in username', () => {
- const result = photonify('https://example.com/u/user.name')
+ const result = localizeLink('https://example.com/u/user.name')
expect(result).toBe('/profile/user.name@example.com')
})
it('handles user link with underscores in username', () => {
- const result = photonify('https://example.com/u/my_user')
+ const result = localizeLink('https://example.com/u/my_user')
expect(result).toBe('/profile/my_user@example.com')
})
})
// ---------------------------------------------------------------------------
-// photonify() - implicit user links (mailto)
+// localizeLink() - implicit user links (mailto)
// ---------------------------------------------------------------------------
-describe('photonify - implicit user links (mailto)', () => {
+describe('localizeLink - implicit user links (mailto)', () => {
it('rewrites mailto link to /profile/ path', () => {
- const result = photonify('mailto:alice@coves.social')
+ const result = localizeLink('mailto:alice@coves.social')
expect(result).toBe('/profile/alice@coves.social')
})
it('rewrites mailto link with subdomain instance', () => {
- const result = photonify('mailto:bob@lemmy.world')
+ const result = localizeLink('mailto:bob@lemmy.world')
expect(result).toBe('/profile/bob@lemmy.world')
})
it('handles username with dots and hyphens', () => {
- const result = photonify('mailto:first.last@example.org')
+ const result = localizeLink('mailto:first.last@example.org')
expect(result).toBe('/profile/first.last@example.org')
})
})
// ---------------------------------------------------------------------------
-// photonify() - community links
+// localizeLink() - community links
// ---------------------------------------------------------------------------
-describe('photonify - community links', () => {
+describe('localizeLink - community links', () => {
it('rewrites community link without @ to /c/ path with instance appended', () => {
- const result = photonify('https://lemmy.world/c/technology')
+ const result = localizeLink('https://lemmy.world/c/technology')
expect(result).toBe('/c/technology@lemmy.world')
})
it('rewrites community link with @ to /c/ path (no instance appended)', () => {
- const result = photonify('https://lemmy.world/c/tech@other.instance')
+ const result = localizeLink('https://lemmy.world/c/tech@other.instance')
expect(result).toBe('/c/tech@other.instance')
})
})
// ---------------------------------------------------------------------------
-// photonify() - post links
+// localizeLink() - post links
// ---------------------------------------------------------------------------
-describe('photonify - post links', () => {
+describe('localizeLink - post links', () => {
it('rewrites post link to /post/{instance}/{id} path', () => {
- const result = photonify('https://lemmy.world/post/12345')
+ const result = localizeLink('https://lemmy.world/post/12345')
expect(result).toBe('/post/lemmy.world/12345')
})
})
// ---------------------------------------------------------------------------
-// photonify() - comment links
+// localizeLink() - comment links
// ---------------------------------------------------------------------------
-describe('photonify - comment links', () => {
+describe('localizeLink - comment links', () => {
it('rewrites comment link to /comment/{instance}/{id} path', () => {
- const result = photonify('https://lemmy.world/comment/6789')
+ const result = localizeLink('https://lemmy.world/comment/6789')
expect(result).toBe('/comment/lemmy.world/6789')
})
})
// ---------------------------------------------------------------------------
-// photonify() - non-matching links
+// localizeLink() - non-matching links
// ---------------------------------------------------------------------------
-describe('photonify - non-matching links', () => {
+describe('localizeLink - non-matching links', () => {
it('returns undefined for a generic URL', () => {
- const result = photonify('https://example.com/some/page')
+ const result = localizeLink('https://example.com/some/page')
expect(result).toBeUndefined()
})
it('returns undefined for an empty string', () => {
- const result = photonify('')
+ const result = localizeLink('')
expect(result).toBeUndefined()
})
it('returns undefined for a plain text string', () => {
- const result = photonify('not a url')
+ const result = localizeLink('not a url')
expect(result).toBeUndefined()
})
it('returns undefined for a URL with unsupported path', () => {
- const result = photonify('https://lemmy.world/settings')
+ const result = localizeLink('https://lemmy.world/settings')
expect(result).toBeUndefined()
})
})
diff --git a/src/lib/app/theme/presets.ts b/src/lib/app/theme/presets.ts
index 74c51e82..b649992c 100644
--- a/src/lib/app/theme/presets.ts
+++ b/src/lib/app/theme/presets.ts
@@ -1,7 +1,7 @@
import { env } from '$env/dynamic/public'
import type { Theme, ThemeColors } from './theme.svelte'
-const PHOTON_DEFAULT = {
+const KELP_DEFAULT = {
slate: {
25: '252 253 254',
50: '248 250 252',
@@ -41,7 +41,7 @@ const PHOTON_DEFAULT = {
}
export function getDefaultColors(): ThemeColors {
- return env.PUBLIC_THEME ? JSON.parse(env.PUBLIC_THEME) : PHOTON_DEFAULT
+ return env.PUBLIC_THEME ? JSON.parse(env.PUBLIC_THEME) : KELP_DEFAULT
}
export function getDefaultTheme(): Theme {
@@ -55,7 +55,7 @@ export function getDefaultTheme(): Theme {
export const presets: Theme[] = [
getDefaultTheme(),
...(env.PUBLIC_THEME
- ? [{ colors: PHOTON_DEFAULT, id: -10, name: 'Mono' }]
+ ? [{ colors: KELP_DEFAULT, id: -10, name: 'Mono' }]
: []),
{
colors: {
diff --git a/src/lib/feature/user/UserLink.svelte b/src/lib/feature/user/UserLink.svelte
index f0593e8b..8cf0b670 100644
--- a/src/lib/feature/user/UserLink.svelte
+++ b/src/lib/feature/user/UserLink.svelte
@@ -26,15 +26,15 @@
):
| {
classes: string
- icon: 'photon' | IconSource
+ icon: 'kelp' | IconSource
iconClass?: string
}
| false => {
- if (badges.photon && badges.photon?.includes?.(did)) {
+ if (badges.kelp && badges.kelp?.includes?.(did)) {
return {
classes:
'bg-linear-to-r bg-clip-text text-transparent from-pink-500 to-fuchsia-500 dark:from-pink-400 dark:to-purple-400',
- icon: 'photon',
+ icon: 'kelp',
}
}
@@ -119,7 +119,7 @@
{#if badges}
{#if envBadge}
- {#if envBadge.icon == 'photon'}
+ {#if envBadge.icon == 'kelp'}
{:else}
diff --git a/src/lib/ui/sidebar/Sidebar.svelte b/src/lib/ui/sidebar/Sidebar.svelte
index f810f183..216c174c 100644
--- a/src/lib/ui/sidebar/Sidebar.svelte
+++ b/src/lib/ui/sidebar/Sidebar.svelte
@@ -124,7 +124,7 @@
{#if env.PUBLIC_XYLIGHT_MODE?.toLowerCase() == 'true'}
{$t('nav.menu.source')}
diff --git a/src/routes/go/+page.ts b/src/routes/go/+page.ts
index d0439cf9..f2c1e26c 100644
--- a/src/routes/go/+page.ts
+++ b/src/routes/go/+page.ts
@@ -1,11 +1,11 @@
-import { photonify } from '$lib/app/markdown/renderers/plugins'
+import { localizeLink } from '$lib/app/markdown/renderers/plugins'
import { redirect } from '@sveltejs/kit'
export async function load({ url }) {
const link = url.searchParams.get('localize')
if (link) {
- const localized = photonify(link)
+ const localized = localizeLink(link)
if (localized) redirect(302, localized)
else redirect(302, link)
}
diff --git a/src/routes/util/+layout.svelte b/src/routes/util/+layout.svelte
index 509b3763..6d8c3224 100644
--- a/src/routes/util/+layout.svelte
+++ b/src/routes/util/+layout.svelte
@@ -17,11 +17,11 @@
},
{
href: '/util/instance',
- name: 'Photon instance',
+ name: 'Kelp instance',
},
{
href: '/util/photonify',
- name: 'Photonify Links',
+ name: 'Localize Links',
},
{
href: '/util/placeholder',
diff --git a/src/routes/util/+page.svelte b/src/routes/util/+page.svelte
index 782e16d5..bacb2cf8 100644
--- a/src/routes/util/+page.svelte
+++ b/src/routes/util/+page.svelte
@@ -1,5 +1,5 @@
Utilities
- These are mostly for debugging purposes but you can use them to see how Photon
+ These are mostly for debugging purposes but you can use them to see how Kelp
works on the inside. (if you don't feel like reading the source code)
diff --git a/src/routes/util/instance/+page.svelte b/src/routes/util/instance/+page.svelte
index bb6094b1..d2e9e400 100644
--- a/src/routes/util/instance/+page.svelte
+++ b/src/routes/util/instance/+page.svelte
@@ -7,9 +7,9 @@
import { Header } from '$lib/ui/layout'
-
+
- photon version: {__VERSION__}
+ kelp version: {__VERSION__}
linked instance: {LINKED_INSTANCE_URL ?? 'none'}
default instance: {DEFAULT_INSTANCE_URL}
diff --git a/src/routes/util/photonify/+page.svelte b/src/routes/util/photonify/+page.svelte
index de06bd77..076e7701 100644
--- a/src/routes/util/photonify/+page.svelte
+++ b/src/routes/util/photonify/+page.svelte
@@ -1,14 +1,14 @@
-Photonify links
-Convert a link from a Lemmy post to a Photon link.
+Localize links
+Convert an external post link to a local Kelp link.
-
+
diff --git a/src/routes/util/placeholder/+page.svelte b/src/routes/util/placeholder/+page.svelte
index c26c6ee9..cd8d3350 100644
--- a/src/routes/util/placeholder/+page.svelte
+++ b/src/routes/util/placeholder/+page.svelte
@@ -9,8 +9,8 @@
Placeholders
- Photon randomly generates placeholders for use in text inputs and stuff. If
- you have "Random Placeholders" disabled in settings, they will be empty.
+ Kelp randomly generates placeholders for use in text inputs and stuff. If you
+ have "Random Placeholders" disabled in settings, they will be empty.
Posts
diff --git a/static/manifest.json b/static/manifest.json
index 4bfcc8bd..c9e5fc61 100644
--- a/static/manifest.json
+++ b/static/manifest.json
@@ -1,6 +1,6 @@
{
- "short_name": "Photon",
- "name": "Photon",
+ "short_name": "Kelp",
+ "name": "Kelp",
"start_url": "/",
"icons": [
{
@@ -20,7 +20,7 @@
"display": "standalone",
"scope": "/",
"theme_color": "#000000",
- "description": "A Svelte based web client for Lemmy.",
+ "description": "The web frontend for Coves, a forum-like social platform.",
"screenshots": [
{
"form_factor": "wide",