diff --git a/functions/index.ts b/functions/index.ts new file mode 100644 index 00000000..342b0b97 --- /dev/null +++ b/functions/index.ts @@ -0,0 +1,19 @@ +interface Env { + ASSETS: { + fetch(request: Request): Promise; + }; +} + +export const onRequest: PagesFunction = async (context) => { + if (context.request.method !== "GET" && context.request.method !== "HEAD") { + return new Response(null, { + status: 405, + headers: { Allow: "GET, HEAD" }, + }); + } + + const url = new URL(context.request.url); + url.pathname = "/home/"; + + return context.env.ASSETS.fetch(new Request(url, context.request)); +}; diff --git a/public/_routes.json b/public/_routes.json new file mode 100644 index 00000000..76018dbe --- /dev/null +++ b/public/_routes.json @@ -0,0 +1,5 @@ +{ + "version": 1, + "include": ["/", "/api/contact"], + "exclude": [] +} diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index a122e3ef..07f2fafd 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -5,6 +5,7 @@ interface LayoutProps { image?: string; twitterCardType?: string; schema?: Record | Record[]; + canonicalPath?: string; } const { @@ -13,10 +14,11 @@ const { image, twitterCardType = "summary", schema, + canonicalPath, } = Astro.props as LayoutProps; const socialImageUrl = image ? new URL(image, Astro.site) : null; -const canonicalUrl = Astro.site ? new URL(Astro.url.pathname, Astro.site) : null; +const canonicalUrl = Astro.site ? new URL(canonicalPath ?? Astro.url.pathname, Astro.site) : null; const siteDescription = "Operately helps teams run goals, projects, and weekly execution with built-in workflows. Use Operately Cloud or self-host it in minutes."; const siteSchema = canonicalUrl ? [ diff --git a/src/pages/_index/HomePage.astro b/src/pages/_index/HomePage.astro new file mode 100644 index 00000000..3c83f719 --- /dev/null +++ b/src/pages/_index/HomePage.astro @@ -0,0 +1,85 @@ +--- +import BaseLayout from "../../layouts/BaseLayout.astro"; + +const pageTitle = "Operately: Open Source Goal & Project Management for Startups"; +const pageDescription = + "Operately helps teams run goals, projects, and weekly execution with built-in workflows. Use Operately Cloud or self-host it in minutes."; + +import Hero from "./Hero.astro"; +import Intro from "./Intro.astro"; +import Goals from "./Goals.astro"; +import Projects from "./Projects.astro"; +import Alfred from "./Alfred.astro"; +import Security from "../_features/Security.astro"; +import CTA from "../_features/CTA.astro"; + +import { getLatestRelease } from "../../utils/releases"; + +const latestRelease = await getLatestRelease(); + +const schema = [ + { + "@context": "https://schema.org", + "@type": "Organization", + "@id": "https://operately.com/#organization", + name: "Operately", + url: "https://operately.com/", + logo: "https://operately.com/favicon.svg", + sameAs: [ + "https://github.com/operately/operately", + "https://www.linkedin.com/company/92810497/", + "https://x.com/operately", + "https://www.youtube.com/@operately", + ], + }, + { + "@context": "https://schema.org", + "@type": "WebSite", + "@id": "https://operately.com/#website", + name: "Operately", + url: "https://operately.com/", + description: pageDescription, + publisher: { + "@id": "https://operately.com/#organization", + }, + }, + { + "@context": "https://schema.org", + "@type": "SoftwareApplication", + "@id": "https://operately.com/#software", + name: "Operately", + applicationCategory: "BusinessApplication", + operatingSystem: "Web", + url: "https://operately.com/", + description: pageDescription, + image: "https://operately.com/images/social/card-summary-large.png", + publisher: { + "@id": "https://operately.com/#organization", + }, + offers: { + "@type": "Offer", + price: "0", + priceCurrency: "USD", + }, + }, +]; +--- + + +
+ + + + + + + +
+
diff --git a/src/pages/home.astro b/src/pages/home.astro new file mode 100644 index 00000000..f66e108a --- /dev/null +++ b/src/pages/home.astro @@ -0,0 +1,5 @@ +--- +import HomePage from "./_index/HomePage.astro"; +--- + + diff --git a/src/pages/index.astro b/src/pages/index.astro index 9fc9a16f..f66e108a 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -1,84 +1,5 @@ --- -import BaseLayout from "../layouts/BaseLayout.astro"; - -const pageTitle = "Operately: Open Source Goal & Project Management for Startups"; -const pageDescription = - "Operately helps teams run goals, projects, and weekly execution with built-in workflows. Use Operately Cloud or self-host it in minutes."; - -import Hero from "./_index/Hero.astro"; -import Intro from "./_index/Intro.astro"; -import Goals from "./_index/Goals.astro"; -import Projects from "./_index/Projects.astro"; -import Alfred from "./_index/Alfred.astro"; -import Security from "./_features/Security.astro"; -import CTA from "./_features/CTA.astro"; - -import { getLatestRelease } from "../utils/releases"; - -const latestRelease = await getLatestRelease(); - -const schema = [ - { - "@context": "https://schema.org", - "@type": "Organization", - "@id": "https://operately.com/#organization", - name: "Operately", - url: "https://operately.com/", - logo: "https://operately.com/favicon.svg", - sameAs: [ - "https://github.com/operately/operately", - "https://www.linkedin.com/company/92810497/", - "https://x.com/operately", - "https://www.youtube.com/@operately", - ], - }, - { - "@context": "https://schema.org", - "@type": "WebSite", - "@id": "https://operately.com/#website", - name: "Operately", - url: "https://operately.com/", - description: pageDescription, - publisher: { - "@id": "https://operately.com/#organization", - }, - }, - { - "@context": "https://schema.org", - "@type": "SoftwareApplication", - "@id": "https://operately.com/#software", - name: "Operately", - applicationCategory: "BusinessApplication", - operatingSystem: "Web", - url: "https://operately.com/", - description: pageDescription, - image: "https://operately.com/images/social/card-summary-large.png", - publisher: { - "@id": "https://operately.com/#organization", - }, - offers: { - "@type": "Offer", - price: "0", - priceCurrency: "USD", - }, - }, -]; +import HomePage from "./_index/HomePage.astro"; --- - -
- - - - - - - -
-
+