Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 71 additions & 3 deletions frontend/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,78 @@
import type { Metadata } from "next";
import type { Metadata, Viewport } from "next";
import "./globals.css";

export const metadata: Metadata = {
title: "hadiscover - Discover Home Assistant Automations",
title: "hadiscover - Discover Home Assistant Automations from the Community",
description:
"Search and explore powerful Home Assistant automations from the community. Find triggers, actions, and blueprints shared on GitHub.",
"Search and explore powerful Home Assistant automations from the community. Find triggers, actions, and blueprints shared on GitHub. Discover real-world automation examples to enhance your smart home.",
keywords: [
"Home Assistant",
"automations",
"smart home",
"YAML",
"GitHub",
"home automation",
"triggers",
"blueprints",
"IoT",
"search engine",
],
authors: [{ name: "DevSecNinja" }],
creator: "DevSecNinja",
publisher: "hadiscover",
metadataBase: new URL("https://hadiscover.com"),
alternates: {
canonical: "https://hadiscover.com",
},
openGraph: {
type: "website",
locale: "en_US",
url: "https://hadiscover.com",
title: "hadiscover - Discover Home Assistant Automations",
description:
"Search and explore powerful Home Assistant automations from the community. Find triggers, actions, and blueprints shared on GitHub.",
siteName: "hadiscover",
// Note: Add og-image.png to public directory for social media previews
// images: [
// {
// url: "/og-image.png",
// width: 1200,
// height: 630,
// alt: "hadiscover - Home Assistant Automation Discovery",
// },
// ],
},
twitter: {
card: "summary_large_image",
title: "hadiscover - Discover Home Assistant Automations",
description:
"Search and explore powerful Home Assistant automations from the community. Find triggers, actions, and blueprints shared on GitHub.",
// Note: Add og-image.png to public directory for Twitter card images
// images: ["/og-image.png"],
creator: "@DevSecNinja",
},
robots: {
index: true,
follow: true,
googleBot: {
index: true,
follow: true,
"max-video-preview": -1,
"max-image-preview": "large",
"max-snippet": -1,
},
},
manifest: "/site.webmanifest",
};

export const viewport: Viewport = {
width: "device-width",
initialScale: 1,
maximumScale: 5,
themeColor: [
{ media: "(prefers-color-scheme: light)", color: "#ffffff" },
{ media: "(prefers-color-scheme: dark)", color: "#0a0a0f" },
],
};

export default function RootLayout({
Expand Down
64 changes: 56 additions & 8 deletions frontend/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,61 @@ export default function Home() {
}
};

// JSON-LD structured data for SEO
const jsonLd = {
"@context": "https://schema.org",
"@type": "WebSite",
name: "hadiscover",
description:
"Search engine for discovering Home Assistant automations from the community",
url: "https://hadiscover.com",
potentialAction: {
"@type": "SearchAction",
target: {
"@type": "EntryPoint",
urlTemplate: "https://hadiscover.com/?q={search_term_string}",
},
"query-input": "required name=search_term_string",
},
provider: {
"@type": "Organization",
name: "DevSecNinja",
url: "https://github.com/DevSecNinja",
},
};

const softwareApplicationJsonLd = {
"@context": "https://schema.org",
"@type": "SoftwareApplication",
name: "hadiscover",
applicationCategory: "SearchApplication",
operatingSystem: "Web",
offers: {
"@type": "Offer",
price: "0",
priceCurrency: "USD",
},
description:
"Search and explore powerful Home Assistant automations from the community. Find triggers, actions, and blueprints shared on GitHub.",
url: "https://hadiscover.com",
author: {
"@type": "Person",
name: "DevSecNinja",
url: "https://github.com/DevSecNinja",
},
};

return (
<div
className="min-h-screen relative overflow-hidden"
style={{
backgroundColor: isDark ? "transparent" : "#ffffff",
}}
>
{/* Theme Toggle Button */}
<>
{/* JSON-LD structured data is now intended to be rendered from a server component
(e.g., layout.tsx) to ensure it is included in the initial HTML response. */}
<div
className="min-h-screen relative overflow-hidden"
style={{
backgroundColor: isDark ? "transparent" : "#ffffff",
}}
>
{/* Theme Toggle Button */}
<button
type="button"
onClick={toggleTheme}
Expand Down Expand Up @@ -2072,6 +2119,7 @@ Here's my automation YAML:
)}
</footer>
</div>
</div>
</div>
</>
);
}
6 changes: 6 additions & 0 deletions frontend/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Allow: /

# Sitemap
Sitemap: https://hadiscover.com/sitemap.xml
17 changes: 17 additions & 0 deletions frontend/public/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "hadiscover - Home Assistant Automation Discovery",
"short_name": "hadiscover",
"description": "Search and discover Home Assistant automations from the community",
"start_url": "/",
"display": "standalone",
"background_color": "#0a0a0f",
"theme_color": "#0a0a0f",
"orientation": "portrait-primary",
"icons": [
{
"src": "/favicon.ico",
"sizes": "any",
"type": "image/x-icon"
}
]
}
13 changes: 13 additions & 0 deletions frontend/public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Note: Update lastmod date regularly or implement dynamic sitemap generation -->
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<url>
<loc>https://hadiscover.com/</loc>
<lastmod>2024-12-01</lastmod>
<changefreq>daily</changefreq>
<priority>1.0</priority>
</url>
</urlset>