From c98260efece99915bafa4d29b5d5497827b322a3 Mon Sep 17 00:00:00 2001 From: Levente Orban Date: Fri, 10 Oct 2025 10:06:34 +0200 Subject: [PATCH 01/11] feat: add an option to remove the landing page --- .env.example | 2 ++ README.md | 13 ++++++++++++- src/lib/components/Navbar.svelte | 15 +++++++++------ src/routes/+page.server.ts | 11 +++++++++++ 4 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 src/routes/+page.server.ts diff --git a/.env.example b/.env.example index d5add05..11996ca 100644 --- a/.env.example +++ b/.env.example @@ -13,3 +13,5 @@ DATABASE_URL="postgres://cactoide:cactoide_password@localhost:5432/cactoide_data APP_VERSION=latest PORT=3000 HOSTNAME=0.0.0.0 + +PUBLIC_LANDING_INFO=true diff --git a/README.md b/README.md index 914e3c4..82f90ec 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,18 @@ Your app will be available at `http://localhost:5173`. You can use the Makefile Use the `database/seed.sql` if you want to populate your database with dummy data. -### i18n +### Options + +#### 1. Landing page option + +Supports a conditional landing page display based on the `PUBLIC_LANDING_INFO` environment variable. If you don't want to show your users the cactoide landing page, just use the `PUBLIC_LANDING_INFO=false` variable. This will automatically remove the landing home page and redirect users to the `/discover` page. + +This is useful for: + +- Creating a minimal discovery-focused experience +- Customizing the user journey based on deployment environment + +#### 2. i18n There is no proper i18n implemented, we have an `/i18n` folder with specific languages. To use an existing translation, just rename the language code JSON file to `messages.json` and you are ready to go. If you would like to add a new translation (which is really appreciated), just create a new `.json` file and add the translations from the `messages.json`. diff --git a/src/lib/components/Navbar.svelte b/src/lib/components/Navbar.svelte index 49d956c..e056062 100644 --- a/src/lib/components/Navbar.svelte +++ b/src/lib/components/Navbar.svelte @@ -2,6 +2,7 @@ import { page } from '$app/stores'; import { goto } from '$app/navigation'; import { t } from '$lib/i18n/i18n.js'; + import { PUBLIC_LANDING_INFO } from '$env/static/public'; // Check if current page is active const isActive = (path: string): boolean => { @@ -24,12 +25,14 @@
- + {#if PUBLIC_LANDING_INFO !== 'false'} + + {/if}