christopher-kapic / astro-blanding

A template for agencies/businesses to get a landing page/website built quickly using Astro, Svelte, and TailwindCSS
16 stars 4 forks source link

Astro Blanding - a landing page for businesses

Astro Blanding is the template with which I begin for my clients' websites.

With a little time to meet the requirements of a client (less than a day):

Lighthouse Report - 99 97 100 100

Get up and running (basics, required)

Features

Icons by astro-icon

Example:

---
import { Icon } from 'astro-icon'
---

<!-- Automatically fetches and inlines Material Design Icon's "account" SVG -->
<Icon viewBox="2 2 20 20" width="18" height="18" pack="fe" name="github" />

<!-- Should be this, but I think there are still some bugs in the provider -->
<Icon pack="mdi" name="account" />

Contact form

Figuring out a contact form is annoying, so I have one preconfigured. You only need to handle what happens once the form is submitted. This is done in src/pages/api/contact.ts.

OG Image Generation and Image Optimization (with lazy-loading) with Svelte component

Preconfigured API routes in the src/pages/api/ab directory (ab as an abbreviation for astro-blanding). Edit the HTML code in src/pages/api/ab/og.ts to generate custom OG images for your social links. Use the Image component from @ab/Image.svelte to have lazy-loaded images using blurhash.

You can change default cache times for images and image previews in src/config in the imageOptimization property.

The <Image /> Svelte component is inspired by NextJS's image component.

---
import Image from "@ab/Image.svelte";
---

<Image src="https://github.com/christopher-kapic/astro-blanding/raw/master/github/lighthouse.png" width="300" height="200" alt="lighthouse scores" client:only="svelte" />

<Image /> props