diff --git a/package.json b/package.json index 919c846..f82fc11 100755 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "remeda": "^2.2.0", "rxjs": "^7.8.1", "shiki": "^1.7.0", + "smol-toml": "^1.3.0", "svelte-inview": "^4.0.2", "ts-pattern": "^5.2.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3c0e96e..d4149ce 100755 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -47,6 +47,9 @@ importers: shiki: specifier: ^1.7.0 version: 1.7.0 + smol-toml: + specifier: ^1.3.0 + version: 1.3.0 svelte-inview: specifier: ^4.0.2 version: 4.0.2(svelte@4.2.18) @@ -1422,6 +1425,10 @@ packages: resolution: {integrity: sha512-ZA6oR3T/pEyuqwMgAKT0/hAv8oAXckzbkmR0UkUosQ+Mc4RxGoJkRmwHgHufaenlyAgE1Mxgpdcrf75y6XcnDg==} engines: {node: '>=14.16'} + smol-toml@1.3.0: + resolution: {integrity: sha512-tWpi2TsODPScmi48b/OQZGi2lgUmBCHy6SZrhi/FdnnHiU1GwebbCfuQuxsC3nHaLwtYeJGPrDZDIeodDOc4pA==} + engines: {node: '>= 18'} + sorcery@0.11.0: resolution: {integrity: sha512-J69LQ22xrQB1cIFJhPfgtLuI6BpWRiWu1Y3vSsIwK/eAScqJxd/+CJlUuHQRdX2C9NGFamq+KqNywGgaThwfHw==} hasBin: true @@ -2916,6 +2923,8 @@ snapshots: slash@5.1.0: {} + smol-toml@1.3.0: {} + sorcery@0.11.0: dependencies: '@jridgewell/sourcemap-codec': 1.4.15 diff --git a/src/content/plugins.toml b/src/content/plugins.toml new file mode 100644 index 0000000..416ffcb --- /dev/null +++ b/src/content/plugins.toml @@ -0,0 +1,103 @@ +# - name: Name of the plugin +# - tagline: Very concise description of the plugin +# - url: Link to the Github repository +# - logo: Relative link to the logo placed in the `/static/plugins-data/logos/` directory (without the `/static/` though) +# - tags: Tags for the plugin. Capitalized +# - featured: Whether the plugin is featured at the top. A maximum of 4 is shown +# - weight: Determines the sort order. A higher weight comes first. + +# Please only use darkmode images/videos. +# Do not use yellow and yellowish colors, unless nesssecary. + + +[[plugins]] +name = "Borders++" +url = "https://github.com/hyprwm/hyprland-plugins" +category = "Design" +tagline = "Extra window borders" +logo = "/plugins-data/logos/Borders-plus-plus-logo.svg" +featured = true + +[[plugins]] +name = "CSGO Vulkan Fix" +url = "https://github.com/hyprwm/hyprland-plugins" +category = "Miscellaneous" +tagline = "CSGO custom resolutions fix" + + +[[plugins]] +name = "dwindle-autogroup" +url = "https://github.com/ItsDrike/hyprland-dwindle-autogroup" +category = "Layout" +tagline = "Dwindle mode auto-grouping" +featured = false + + +[[plugins]] +name = "hy3" +url = "https://github.com/outfoxxed/hy3" +category = "Layout" +tagline = "i3 / Sway like layout" +logo = "/plugins-data/logos/hy3-logo.svg" +banner = "/plugins-data/hy3_banner.mp4" +featured = true + + +[[plugins]] +name = "Hyprbars" +url = "https://github.com/hyprwm/hyprland-plugins" +category = "Design" +tagline = "Bring back title bars" +logo = "/plugins-data/logos/hyprbars-logo.svg" +featured = true + + +[[plugins]] +name = "Hyprtrails" +url = "https://github.com/hyprwm/hyprland-plugins" +category = "Design" +tagline = "Smooth window trails" +logo = "/plugins-data/logos/hyprtrails-logo.svg" +featured = true + + +[[plugins]] +name = "Hyprwinwrap" +url = "https://github.com/hyprwm/hyprland-plugins" +category = "Quality of Life" +tagline = "Any app as wallpaper" +logo = "/plugins-data/logos/hyprwinwrap-logo.svg" +featured = true + +[[plugins]] +name = "hyprgrass" +url = "https://github.com/horriblename/hyprgrass" +category = "Quality of Life" +tagline = "Touch gestures" +featured = false + + +[[plugins]] +name = "hyprNStack" +url = "https://github.com/zakk4223/hyprNStack" +category = "Layout" +tagline = "N-Stack tiling" + +[[plugins]] +name = "hyprland-virtual-desktops" +url = "https://github.com/levnikmyskin/hyprland-virtual-desktops" +category = "Layout" +tagline = "Virtual desktops" + + +[[plugins]] +name = "hypr-darkwindow" +url = "https://github.com/micha4w/Hypr-DarkWindow" +category = "Design" +tagline = "Invert window colors" + +[[plugins]] +name = "hyprexpo" +url = "https://github.com/hyprwm/hyprland-plugins" +category = "Design" +tagline = "Workspaces overview" diff --git a/src/content/plugins/borders-plus-plus.md b/src/content/plugins/borders-plus-plus.md deleted file mode 100644 index 7f7d629..0000000 --- a/src/content/plugins/borders-plus-plus.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -name: Borders++ -url: https://github.com/hyprwm/hyprland-plugins -category: Design -tagline: Extra window borders -logo: /plugins-data/logos/Borders-plus-plus-logo.svg -featured: true -# banner: /imgs/profile_pictures/chan_1.webp -# weight: 100 ---- diff --git a/src/content/plugins/csgo-vulkan-fix.md b/src/content/plugins/csgo-vulkan-fix.md deleted file mode 100644 index 16b856b..0000000 --- a/src/content/plugins/csgo-vulkan-fix.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -name: CSGO Vulkan Fix -url: https://github.com/hyprwm/hyprland-plugins -category: Miscellaneous -tagline: CSGO custom resolutions fix ---- diff --git a/src/content/plugins/dwindle-autogroup.md b/src/content/plugins/dwindle-autogroup.md deleted file mode 100644 index fc46ab5..0000000 --- a/src/content/plugins/dwindle-autogroup.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -name: dwindle-autogroup -url: https://github.com/ItsDrike/hyprland-dwindle-autogroup -category: Layout -tagline: Auto-grouping for dwindle mode -featured: false ---- diff --git a/src/content/plugins/hy3.md b/src/content/plugins/hy3.md deleted file mode 100644 index bff0271..0000000 --- a/src/content/plugins/hy3.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -name: hy3 -url: https://github.com/outfoxxed/hy3 -category: Layout -tagline: i3 / Sway like layout -logo: /plugins-data/logos/hy3-logo.svg -banner: /plugins-data/hy3_banner.mp4 -featured: true ---- - -### Features - -- i3 like tiling -- Node based window manipulation (you can interact with multiple windows at once) -- Greatly improved tabbed node groups over base hyprland -- Optional autotiling - -Additional features may be suggested in the repo issues or the [matrix room](https://matrix.to/#/#hy3:outfoxxed.me). - -### Demo - - diff --git a/src/content/plugins/hyprbars.md b/src/content/plugins/hyprbars.md deleted file mode 100644 index c80e329..0000000 --- a/src/content/plugins/hyprbars.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: Hyprbars -url: https://github.com/hyprwm/hyprland-plugins -category: Design -tagline: Bring back title bars -logo: /plugins-data/logos/hyprbars-logo.svg -featured: true ---- diff --git a/src/content/plugins/hyprtrails.md b/src/content/plugins/hyprtrails.md deleted file mode 100644 index b0aec40..0000000 --- a/src/content/plugins/hyprtrails.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: Hyprtrails -url: https://github.com/hyprwm/hyprland-plugins -category: Design -tagline: Smooth window trails -logo: /plugins-data/logos/hyprtrails-logo.svg -featured: true ---- diff --git a/src/content/plugins/hyprwinwrap.md b/src/content/plugins/hyprwinwrap.md deleted file mode 100644 index 333ed81..0000000 --- a/src/content/plugins/hyprwinwrap.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -name: Hyprwinwrap -url: https://github.com/hyprwm/hyprland-plugins -category: Quality of Life -tagline: Any app as wallpaper -logo: /plugins-data/logos/hyprwinwrap-logo.svg -featured: true ---- diff --git a/src/content/plugins/readme.md b/src/content/plugins/readme.md deleted file mode 100644 index 003567b..0000000 --- a/src/content/plugins/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -# Frontmatter - -The `.md` files can have the following meta data: - -- name: Name of the plugin -- tagline: Very concise description of the plugin -- url: Link to the Github repository -- docs: Link to the documentation. Optional -- website: Link to the website. Optional -- logo: Relative link to the logo placed in the `/static/plugins-data/logos/` directory (without the `/static/` though) -- tags: Tags for the plugin. Capitalized -- featured: Whether the plugin is featured at the top. A maximum of 4 is shown -- weight: Determines the sort order. A higher weight comes first. - -## Banner - -Please only use darkmode images/videos. -Do not use yellow and yellowish colors, unless nesssecary. diff --git a/src/lib/components/Title.svelte b/src/lib/components/Title.svelte deleted file mode 100755 index 773903e..0000000 --- a/src/lib/components/Title.svelte +++ /dev/null @@ -1,26 +0,0 @@ - - -
- {#if $$slots.pre} -

- -

- {/if} - -

- No title given!!! -

- - {#if $$slots.subtitle} -

- -

- {/if} - - -
diff --git a/src/lib/components/Title/TitleHeading.svelte b/src/lib/components/Title/TitleHeading.svelte new file mode 100755 index 0000000..469a82e --- /dev/null +++ b/src/lib/components/Title/TitleHeading.svelte @@ -0,0 +1,3 @@ +

+ No title given!!! +

diff --git a/src/lib/components/Title/TitlePre.svelte b/src/lib/components/Title/TitlePre.svelte new file mode 100644 index 0000000..5bbbb19 --- /dev/null +++ b/src/lib/components/Title/TitlePre.svelte @@ -0,0 +1,3 @@ +

+ +

diff --git a/src/lib/components/Title/TitleSubtile.svelte b/src/lib/components/Title/TitleSubtile.svelte new file mode 100644 index 0000000..9c2f71b --- /dev/null +++ b/src/lib/components/Title/TitleSubtile.svelte @@ -0,0 +1,3 @@ +

+ +

diff --git a/src/lib/components/Title/TitleWrapper.svelte b/src/lib/components/Title/TitleWrapper.svelte new file mode 100755 index 0000000..d769286 --- /dev/null +++ b/src/lib/components/Title/TitleWrapper.svelte @@ -0,0 +1,27 @@ + + +
+ + + No title given!!! + + + + +
diff --git a/src/routes/api/plugins/+server.js b/src/routes/api/plugins/+server.js index 61ed0f0..08e271a 100644 --- a/src/routes/api/plugins/+server.js +++ b/src/routes/api/plugins/+server.js @@ -1,27 +1,23 @@ import { json } from '@sveltejs/kit' +import path from 'path' +import { parse } from 'smol-toml' +import { readFile } from 'node:fs/promises' /** Get the plugins of the `content/plugins/` directory */ async function getPlugins() { - const plugins = Object.entries(import.meta.glob('/src/content/plugins/*.md', { eager: true })) - .flatMap(([path, { metadata }]) => { - const slug = path.split('/').at(-1)?.replace('.md', '') - - // Filter out the `readme.md` - if (slug === 'readme') return [] - - if (!slug || !path) { - console.error(`Invalid file ${path} ${JSON.stringify({ ...metadata, slug })}`) - return [] - } - - return { slug, ...metadata } - }) - .sort( - (a, b) => - (b.featured ?? 0) - (a.featured ?? 0) || - (b.weight ?? 0) - (a.weight ?? 0) || - ((b.logo && 1) ?? 0) - ((a.logo && 1) ?? 0) || - ((b.banner && 1) ?? 0) - ((a.banner && 1) ?? 0) + const plugins = await readFile( + path.join(import.meta.dirname, '../../../content/plugins.toml'), + 'utf-8' + ) + .then(parse) + .then(({ plugins }) => + plugins.sort( + (a, b) => + (b.featured ?? 0) - (a.featured ?? 0) || + (b.weight ?? 0) - (a.weight ?? 0) || + ((b.logo && 1) ?? 0) - ((a.logo && 1) ?? 0) || + ((b.banner && 1) ?? 0) - ((a.banner && 1) ?? 0) + ) ) return plugins diff --git a/src/routes/hall_of_fame/+page.svelte b/src/routes/hall_of_fame/+page.svelte index bbc9473..b1bcff3 100644 --- a/src/routes/hall_of_fame/+page.svelte +++ b/src/routes/hall_of_fame/+page.svelte @@ -1,5 +1,7 @@ -
+
- <span slot="pre">TLDR</span> - <span slot="title">Features</span> + <TitlePre slot="pre">TLDR</TitlePre> + <TitleHeading slot="title" class="">Features</TitleHeading> import { animateIn } from '$lib/Helper.mjs' import Button from '$lib/components/Button.svelte' - import Title from '$lib/components/Title.svelte' + import TitleHeading from '$lib/components/Title/TitleHeading.svelte' + import TitlePre from '$lib/components/Title/TitlePre.svelte' + import Title from '$lib/components/Title/TitleWrapper.svelte' import FameRicePreview from './FameRicePreview.svelte'
- <span slot="pre"> Memorials of the ricing legends </span> - <span slot="title">Hall of Fame</span> + <TitlePre>Memorials of the ricing legends</TitlePre> + <TitleHeading slot="title" class="">Hall of Fame</TitleHeading>
diff --git a/src/routes/home-slices/InstallSlice.svelte b/src/routes/home-slices/InstallSlice.svelte index f2bf32f..2202ed3 100644 --- a/src/routes/home-slices/InstallSlice.svelte +++ b/src/routes/home-slices/InstallSlice.svelte @@ -6,14 +6,17 @@ import suseLogo from '$lib/images/logos/opensuse.svg' import DistroOption from './DistroOption.svelte' import Button from '$lib/components/Button.svelte' - import Title from '$lib/components/Title.svelte' + import Title from '$lib/components/Title/TitleWrapper.svelte' import amongus from '$lib/images/amongus/green.webp' import CommandButton from '$lib/components/CommandButton.svelte' + import TitleHeading from '$lib/components/Title/TitleHeading.svelte' + import TitleSubtile from '$lib/components/Title/TitleSubtile.svelte'
- - <span slot="title">Install now</span><span slot="subtitle"> For your favourite distro </span> + <Title> + <TitleHeading slot="title" class="">Install now</TitleHeading> + <TitleSubtile slot="subtitle" class="">For yor favourite distro</TitleSubtile>
diff --git a/src/routes/home-slices/NewsSlice.svelte b/src/routes/home-slices/NewsSlice.svelte index a5a4337..0073e45 100644 --- a/src/routes/home-slices/NewsSlice.svelte +++ b/src/routes/home-slices/NewsSlice.svelte @@ -1,14 +1,16 @@
- - <span slot="pre">Read while it's fresh</span> - <span slot="title">Latest news</span> + <Title> + <TitlePre>Read while it's fresh!</TitlePre> + <TitleHeading slot="title" class="">Latest news</TitleHeading>
    diff --git a/src/routes/news/+page.svelte b/src/routes/news/+page.svelte index 2641571..6e5bbad 100644 --- a/src/routes/news/+page.svelte +++ b/src/routes/news/+page.svelte @@ -1,8 +1,10 @@ - {''} + Hyprland News
     
    -		
    -			<span slot="title">News</span><span slot="subtitle">
    -				Fresh updates straight from the oven
    -			</span>
    +		<Title>
    +			<TitleHeading slot="title" class="">News</TitleHeading>
    +			<TitleSubtile>Fresh updates straight from the oven</TitleSubtile>
     		
     	
    @@ -106,7 +107,7 @@ } .spinner-wrapper { - @apply mb-4 flex items-center justify-center bg-gradient-to-tr from-blue-500/0 to-cyan-500 bg-clip-text text-transparent animate-in fade-in-0; + @apply mb-4 flex items-center justify-center bg-gradient-to-tr from-blue-500/0 to-cyan-500 bg-clip-text text-transparent animate-in fade-in-0; animation-duration: 2000ms; font-size: min(1vh, 1rem); /* There are 36 rows */ diff --git a/src/routes/news/[slug]/+page.svelte b/src/routes/news/[slug]/+page.svelte index feff4f0..020a43e 100644 --- a/src/routes/news/[slug]/+page.svelte +++ b/src/routes/news/[slug]/+page.svelte @@ -1,6 +1,7 @@ @@ -40,11 +42,10 @@
    - - <span slot="pre">Plugins</span> - <span slot="title">Unlock full power</span><span slot="subtitle"> - Easily load up plugins and customize everything - </span> + <Title> + <TitlePre>Plugins</TitlePre> + <TitleHeading slot="title" class="">Unlock full power</TitleHeading> + <TitleSubtile>Easily load up plugins and customize everything</TitleSubtile> @@ -54,7 +55,10 @@ aria-hidden="true" class="letter-logo -ml-4 flex items-center justify-center bg-gradient-to-tr from-primary via-sky-400 to-blue-400 bg-clip-text text-center text-6xl font-bold leading-none text-transparent" > - {plugin.name[0]} + {plugin.name + .replace(/[-\.\_]/g, '') + .replace(/^hypr-?(land)?/i, '')[0] + ?.toUpperCase()}
{/if} @@ -125,7 +129,7 @@ } .logo-container:not(.banner) { @container (max-width: theme(screens.md)) { - @apply flex shrink-[2] grow items-center justify-center max-2xl:@2xl:mx-0 max-2xl:@2xl:block max-2xl:@2xl:h-auto max-2xl:@2xl:grow-0; + @apply flex shrink-[2] grow items-center justify-center max-2xl:@2xl:mx-0 max-2xl:@2xl:block max-2xl:@2xl:h-auto max-2xl:@2xl:grow-0; } } diff --git a/src/routes/plugins/[slug]/+page.js b/src/routes/plugins/[slug]/+page.js deleted file mode 100644 index f98030d..0000000 --- a/src/routes/plugins/[slug]/+page.js +++ /dev/null @@ -1,19 +0,0 @@ -import { error } from '@sveltejs/kit' - -export async function load({ params, fetch }) { - try { - const post = await import(`../../../content/plugins/${params.slug}.md`) - const other = await fetch('/api/plugins') - .then((response) => response.json()) - .then((news) => news.filter((entry) => entry.slug !== params.slug).slice(0, 4)) - - return { - content: post.default, - meta: post.metadata, - other - } - } catch (errorMessage) { - console.error(errorMessage) - error(404, `Could not find ${params.slug}`) - } -} diff --git a/src/routes/plugins/[slug]/+page.svelte b/src/routes/plugins/[slug]/+page.svelte deleted file mode 100644 index d63bb1f..0000000 --- a/src/routes/plugins/[slug]/+page.svelte +++ /dev/null @@ -1,188 +0,0 @@ - - - - {title} - - - {#if meta.logo} - - {/if} - - -
- - Back to all plugins - - {#if meta.banner || meta.logo} - - {/if} - - -
-
- - {#if meta.logo && meta.banner} - {'Logo - {/if} -

- {meta.name} -

-
- -
-
-

- {meta.tagline} -

- - -
- Trust the plugin source before installing! - - Installation is done via hyprpm ↗ - -
-
-
- - -
- - - - - -
-
-
- - -
- -
-
- - -{#if data.other.length > 0} -
- <span slot="title">More plugins</span> - - {#each data.other as plugin} - - {/each} - - - -
-{/if} - -