Compare commits
No commits in common. "a5f89d33af942c43c7c0c272b3908d1d7da2dda3" and "258280730b4a6e2a2897a75cbce7090615718c2f" have entirely different histories.
a5f89d33af
...
258280730b
3 changed files with 12 additions and 18 deletions
|
@ -1,12 +0,0 @@
|
|||
import type { MetadataRoute } from "next";
|
||||
|
||||
export default function robots(): MetadataRoute.Robots {
|
||||
return {
|
||||
rules: {
|
||||
userAgent: "*",
|
||||
allow: "/",
|
||||
disallow: "/unsubscribe"
|
||||
},
|
||||
sitemap: `${process.env.NEXT_PUBLIC_WEBSITE_URL}/sitemap.xml`
|
||||
};
|
||||
}
|
|
@ -6,6 +6,12 @@ import { toHTML } from "@portabletext/to-html";
|
|||
export const dynamic = "force-static";
|
||||
|
||||
export async function GET() {
|
||||
// Define the site URL based on the environment
|
||||
const SITE_URL =
|
||||
process.env.NODE_ENV === "production"
|
||||
? `${process.env.NEXT_PUBLIC_WEBSITE_URL}`
|
||||
: "http://localhost:3000";
|
||||
|
||||
const postsQuery = `*[_type == 'blog'] | order(_createdAt desc) {
|
||||
title,
|
||||
"slug": slug.current,
|
||||
|
@ -19,9 +25,9 @@ export async function GET() {
|
|||
const feed = new RSS({
|
||||
title: "SVR.JS Blog",
|
||||
description: "Explore the latest blog posts from SVR.JS",
|
||||
feed_url: `${process.env.NEXT_PUBLIC_WEBSITE_URL}/rss.xml`,
|
||||
site_url: `${process.env.NEXT_PUBLIC_WEBSITE_URL}`,
|
||||
image_url: `${process.env.NEXT_PUBLIC_WEBSITE_URL}/metadata/svrjs-cover.png`,
|
||||
feed_url: `${SITE_URL}/rss.xml`,
|
||||
site_url: `${SITE_URL}`,
|
||||
image_url: `${SITE_URL}/metadata/svrjs-cover.png`,
|
||||
language: "en-US",
|
||||
pubDate: new Date().toUTCString()
|
||||
});
|
||||
|
@ -30,12 +36,12 @@ export async function GET() {
|
|||
feed.item({
|
||||
title: post.title,
|
||||
description: toHTML(post.content),
|
||||
url: `${process.env.NEXT_PUBLIC_WEBSITE_URL}/blog/${post.slug}`,
|
||||
url: `${SITE_URL}/blog/${post.slug}`,
|
||||
date: new Date(post._createdAt).toUTCString(),
|
||||
enclosure: {
|
||||
url: post.titleImage
|
||||
? urlFor(post.titleImage).url()
|
||||
: `${process.env.NEXT_PUBLIC_WEBSITE_URL}/blog-missing.png`
|
||||
: `${SITE_URL}/blog-missing.png`
|
||||
},
|
||||
author: "SVR.JS"
|
||||
});
|
||||
|
|
|
@ -81,7 +81,7 @@ const Newsletter = () => {
|
|||
aria-label="Email Information"
|
||||
onSubmit={(e) => e.preventDefault()}
|
||||
>
|
||||
<div className="group flex items-center gap-x-4 pl-1 md:pl-4 pr-1 rounded-[9px] bg-accent/80 hover:bg-accent shadow-outline-gray hover:shadow-transparent focus-within:bg-accent focus-within:!shadow-outline-gray-focus transition-all duration-300">
|
||||
<div className="group flex items-center gap-x-4 pl-4 pr-1 rounded-[9px] bg-accent/80 hover:bg-accent shadow-outline-gray hover:shadow-transparent focus-within:bg-accent focus-within:!shadow-outline-gray-focus transition-all duration-300">
|
||||
<Mail className="hidden sm:inline w-6 h-6 text-[#4B4C52] group-focus-within:text-secondary-foreground group-hover:text-secondary-foreground transition-colors duration-300" />
|
||||
<Input
|
||||
value={input}
|
||||
|
|
Loading…
Reference in a new issue