From b4ce2107d460a20734460908660c407cb9f8c350 Mon Sep 17 00:00:00 2001 From: Nitrrine Date: Sun, 3 Nov 2024 14:28:03 +0500 Subject: [PATCH] Replace if-else statement with ternary operator for title in default layout --- src/layouts/Default.astro | 204 +++++++++++++++++++------------------- src/pages/index.astro | 180 ++++++++++++++++++--------------- 2 files changed, 203 insertions(+), 181 deletions(-) diff --git a/src/layouts/Default.astro b/src/layouts/Default.astro index a13ed57..54d2e75 100644 --- a/src/layouts/Default.astro +++ b/src/layouts/Default.astro @@ -1,107 +1,109 @@ --- -import "../components/Logotype.astro" -import Logotype from "../components/Logotype.astro" -import VitalLink from "../components/VitalLink.astro" -import { MessageSquare, Github } from "lucide-astro" -import "../styles/global.css" -import SizeAwareLogo from "../components/SizeAwareLogo.astro" -let { title } = Astro.props -if (title === "" || title === undefined) { - title = "Vital" -} else { - title += " | Vital" -} +import "../components/Logotype.astro"; +import Logotype from "../components/Logotype.astro"; +import VitalLink from "../components/VitalLink.astro"; +import { MessageSquare, Github } from "lucide-astro"; +import "../styles/global.css"; +import SizeAwareLogo from "../components/SizeAwareLogo.astro"; + +const { title } = Astro.props; --- - - {title} - - - - - - - - - - - - - - - - - - - -
-
- -
-
- - + + {title ? title + " | Vital" : "Vital"} + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+ + diff --git a/src/pages/index.astro b/src/pages/index.astro index bee46b9..ca8b9fa 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,86 +1,106 @@ --- -import Button from "../components/Button.astro" -import Logo from "../components/Logo.astro" -import VitalLink from "../components/VitalLink.astro" -import Default from "../layouts/Default.astro" +import Button from "../components/Button.astro"; +import Logo from "../components/Logo.astro"; +import VitalLink from "../components/VitalLink.astro"; +import Default from "../layouts/Default.astro"; --- -
-
-
- Vital - Vital is a modpack designed as an alternative to Essential (and OptiFine). It includes the majority of - Essential and OptiFine's features, including but not limited to: world hosting, cosmetics, many resource pack - features, shaders, and a major improvement in rendering and logic performance. -
- - -
-
-
- NotEssential - NotEssential is a website which links to mods that can substitute Essential's features. +
+
+
+ Vital + Vital is a modpack designed as an alternative to Essential (and OptiFine). It includes the majority + of Essential and OptiFine's features, including but not limited to: world hosting, cosmetics, many + resource pack features, shaders, and a major improvement in rendering and logic performance. +
+ + +
+
+
+ NotEssential + NotEssential is a website which links to mods that can substitute Essential's features. -
- - - -
-
-
-
- Ward - Ward is a simple text manipulator for the web. Made to do silly translations for NotEssential. -
- - -
-
-
- Translator - A Python script that can help you convert and manipulate your text in many different ways. -
- - -
-
-
-
- Bulb - Bulb is a work in progress. Watch this space. -
-
-
+
+ + + +
+
+
+
+ Ward + Ward is a simple text manipulator for the web. Made to do silly translations for NotEssential. +
+ + +
+
+
+ Translator + A Python script that can help you convert and manipulate your text in many different ways. +
+ + +
+
+
+
+ Bulb + Bulb is a work in progress. Watch this space. +
+
+