This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
import Link from "next/link";
|
||||
import Image from "next/image";
|
||||
import { useEffect, useState } from "react";
|
||||
import { usePathname } from "next/navigation";
|
||||
import { AnimatePresence, motion } from "framer-motion";
|
||||
|
||||
const links = [
|
||||
@@ -16,7 +15,6 @@ const links = [
|
||||
export function Navbar() {
|
||||
const [scrolled, setScrolled] = useState(false);
|
||||
const [open, setOpen] = useState(false);
|
||||
const pathname = usePathname();
|
||||
|
||||
useEffect(() => {
|
||||
const onScroll = () => setScrolled(window.scrollY > 20);
|
||||
@@ -25,10 +23,6 @@ export function Navbar() {
|
||||
return () => window.removeEventListener("scroll", onScroll);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
setOpen(false);
|
||||
}, [pathname]);
|
||||
|
||||
useEffect(() => {
|
||||
if (open) {
|
||||
const prev = document.body.style.overflow;
|
||||
@@ -130,6 +124,7 @@ export function Navbar() {
|
||||
>
|
||||
<Link
|
||||
href={link.href}
|
||||
onClick={() => setOpen(false)}
|
||||
className="block py-3 font-display text-2xl tracking-wider text-foreground hover:text-accent transition-colors"
|
||||
>
|
||||
{link.label.toUpperCase()}
|
||||
|
||||
@@ -4,6 +4,7 @@ import type { Metadata } from "next";
|
||||
import { MDXRemote } from "next-mdx-remote/rsc";
|
||||
import remarkGfm from "remark-gfm";
|
||||
import { getAdjacentPosts, getAllPosts, getPost } from "@/lib/devblog";
|
||||
import { SITE_URL, LOGO_URL } from "@/lib/site";
|
||||
|
||||
type Props = { params: Promise<{ slug: string }> };
|
||||
|
||||
@@ -15,7 +16,7 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
|
||||
const { slug } = await params;
|
||||
const post = getPost(slug);
|
||||
if (!post) return {};
|
||||
const url = `https://highlandgamesstudio.com/devblog/${post.slug}`;
|
||||
const url = `${SITE_URL}/devblog/${post.slug}`;
|
||||
return {
|
||||
title: post.title,
|
||||
description: post.excerpt,
|
||||
@@ -109,7 +110,7 @@ export default async function DevblogPost({ params }: Props) {
|
||||
if (!post) notFound();
|
||||
|
||||
const { newer, older } = getAdjacentPosts(slug);
|
||||
const url = `https://highlandgamesstudio.com/devblog/${post.slug}`;
|
||||
const url = `${SITE_URL}/devblog/${post.slug}`;
|
||||
const jsonLd = {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "BlogPosting",
|
||||
@@ -126,7 +127,7 @@ export default async function DevblogPost({ params }: Props) {
|
||||
name: "Highland Games Studio",
|
||||
logo: {
|
||||
"@type": "ImageObject",
|
||||
url: "https://highlandgamesstudio.com/image/Studio/Logo Flat.png",
|
||||
url: LOGO_URL,
|
||||
},
|
||||
},
|
||||
mainEntityOfPage: { "@type": "WebPage", "@id": url },
|
||||
|
||||
+2
-1
@@ -53,7 +53,8 @@ export default function Error({
|
||||
ON THE PATH.
|
||||
</h1>
|
||||
<p className="text-lg text-foreground-muted leading-relaxed max-w-xl mx-auto mb-4">
|
||||
Something went wrong on our side. The team has been notified.
|
||||
Something went wrong on our side. Try again, or head back to base
|
||||
camp.
|
||||
</p>
|
||||
{error.digest && (
|
||||
<p className="text-xs tracking-widest text-foreground-muted mb-12 uppercase">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getAllPosts } from "@/lib/devblog";
|
||||
import { SITE_URL } from "@/lib/site";
|
||||
|
||||
const SITE_URL = "https://highlandgamesstudio.com";
|
||||
const SITE_TITLE = "Highland Games Studio — Devblog";
|
||||
const SITE_DESCRIPTION =
|
||||
"Behind-the-scenes updates, design decisions, and milestones from Highland Games Studio.";
|
||||
|
||||
@@ -4,6 +4,7 @@ import { notFound } from "next/navigation";
|
||||
import type { Metadata } from "next";
|
||||
import { games, getGame } from "@/lib/games";
|
||||
import { getPostsByGame } from "@/lib/devblog";
|
||||
import { SITE_URL } from "@/lib/site";
|
||||
|
||||
function formatDate(date: string) {
|
||||
return new Date(date).toLocaleDateString("en-US", {
|
||||
@@ -51,9 +52,9 @@ export default async function GamePage({ params }: Props) {
|
||||
publisher: {
|
||||
"@type": "Organization",
|
||||
name: "Highland Games Studio",
|
||||
url: "https://highlandgamesstudio.com",
|
||||
url: SITE_URL,
|
||||
},
|
||||
url: `https://highlandgamesstudio.com/games/${game.slug}`,
|
||||
url: `${SITE_URL}/games/${game.slug}`,
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
+4
-3
@@ -3,6 +3,7 @@ import { Bebas_Neue, Inter } from "next/font/google";
|
||||
import "./globals.css";
|
||||
import { Navbar } from "./components/Navbar";
|
||||
import { Footer } from "./components/Footer";
|
||||
import { SITE_URL, LOGO_URL } from "@/lib/site";
|
||||
|
||||
const bebas = Bebas_Neue({
|
||||
variable: "--font-bebas",
|
||||
@@ -22,7 +23,7 @@ export const metadata: Metadata = {
|
||||
},
|
||||
description:
|
||||
"Indie game studio crafting survival adventures. Where summits become worlds.",
|
||||
metadataBase: new URL("https://highlandgamesstudio.com"),
|
||||
metadataBase: new URL(SITE_URL),
|
||||
openGraph: {
|
||||
title: "Highland Games Studio",
|
||||
description: "Where summits become worlds.",
|
||||
@@ -47,8 +48,8 @@ const organizationJsonLd = {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Organization",
|
||||
name: "Highland Games Studio",
|
||||
url: "https://highlandgamesstudio.com",
|
||||
logo: "https://highlandgamesstudio.com/image/Studio/Logo Flat.png",
|
||||
url: SITE_URL,
|
||||
logo: LOGO_URL,
|
||||
description:
|
||||
"Indie game studio crafting survival adventures. Where summits become worlds.",
|
||||
slogan: "Where summits become worlds",
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
import type { MetadataRoute } from "next";
|
||||
|
||||
const SITE_URL = "https://highlandgamesstudio.com";
|
||||
import { SITE_URL } from "@/lib/site";
|
||||
|
||||
export default function robots(): MetadataRoute.Robots {
|
||||
return {
|
||||
|
||||
+1
-2
@@ -1,8 +1,7 @@
|
||||
import type { MetadataRoute } from "next";
|
||||
import { games } from "@/lib/games";
|
||||
import { getAllPosts } from "@/lib/devblog";
|
||||
|
||||
const SITE_URL = "https://highlandgamesstudio.com";
|
||||
import { SITE_URL } from "@/lib/site";
|
||||
|
||||
export default function sitemap(): MetadataRoute.Sitemap {
|
||||
const now = new Date();
|
||||
|
||||
Reference in New Issue
Block a user