Skip to content

Commit 42c3584

Browse files
committed
feat: implement dynamic article detail pages with SEO metadata and add a NewsTicker component.
1 parent d86ea76 commit 42c3584

3 files changed

Lines changed: 32 additions & 32 deletions

File tree

app/posts/[title]/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,12 +223,12 @@ export default async function ArticleDetails({
223223

224224
const jsonLd = {
225225
"@context": "https://schema.org",
226-
"@type": "BlogPosting",
226+
"@type": "Article",
227227
headline: processedArticle.title,
228228
description: processedArticle.description,
229229
image: processedArticle.img ? [processedArticle.img] : [],
230230
datePublished: processedArticle.date.toISOString(),
231-
dateModified: processedArticle.date.toISOString(), // Assuming modified is same as published if not tracked
231+
dateModified: processedArticle.date.toISOString(),
232232
author: {
233233
"@type": "Person",
234234
name: processedArticle.authorName,
@@ -239,7 +239,7 @@ export default async function ArticleDetails({
239239
name: "L.A.P Docs",
240240
logo: {
241241
"@type": "ImageObject",
242-
url: "https://lap-docs.netlify.app/logos/LAP-Logo-Color.png", // Verify this path
242+
url: "https://lap-docs.netlify.app/logos/LAP-Logo-Color.png",
243243
},
244244
},
245245
mainEntityOfPage: {

components/NewsTicker/NewsTicker.tsx

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
"use client";
22

33
import gsap from "gsap";
4-
import { useEffect, useRef, useState } from "react";
5-
import { collection, onSnapshot } from "firebase/firestore";
6-
import { db } from "@/lib/firebase";
4+
import { useEffect, useRef } from "react";
75

86
export default function NewsTicker() {
97
const tickerRef = useRef<HTMLDivElement | null>(null);
10-
const [news, setNews] = useState<string[]>([]);
118

12-
useEffect(() => {
13-
// Fetch real-time updates from Firestore
14-
const unsubscribe = onSnapshot(collection(db, "news"), (snapshot) => {
15-
const newsData = snapshot.docs.map((doc) => doc.data().title);
16-
setNews(newsData);
17-
});
18-
19-
return () => unsubscribe();
20-
}, []);
9+
// Static mission statements
10+
const news = [
11+
"Welcome to LAP Docs, our mission is to provide you with the best possible tutorials that is easy to understand and follow. I hope you enjoy your stay with us and our tutorials actually help you learn something new.",
12+
"Our Motto: Simplicity in Tech",
13+
"Our Goal: Simplifying tech for everyone",
14+
];
2115

2216
useEffect(() => {
2317
const ticker = tickerRef.current;
@@ -27,7 +21,7 @@ export default function NewsTicker() {
2721

2822
gsap.to(ticker, {
2923
x: `-${tickerWidth}px`,
30-
duration: 75,
24+
duration: 75, // Faster duration for shorter text
3125
ease: "linear",
3226
repeat: -1,
3327
onRepeat: () => {
@@ -41,14 +35,14 @@ export default function NewsTicker() {
4135
<div className="flex bg-[#8a2be2] text-white py-5 max-w-[95rem] w-full mx-auto relative overflow-hidden">
4236
<div className="bg-[#8a2be2] z-10 px-6">
4337
<span className="flex gap-2 bg-[#8a2be2] font-semibold uppercase whitespace-nowrap">
44-
<p>UPDATES:</p>
38+
<p>MISSION:</p>
4539
<p className="block sm:hidden">+++</p>
4640
</span>
4741
</div>
4842
{/* News ticker container */}
4943
<div className="relative flex overflow-hidden w-full">
5044
<div ref={tickerRef} className="flex gap-4 whitespace-nowrap">
51-
{[...news, ...news].map((newsItem, index) => (
45+
{[...news, ...news, ...news, ...news].map((newsItem, index) => (
5246
<div key={index} className="text-white text-lg font-normal">
5347
<p>{newsItem} +++</p>
5448
</div>

next.config.js

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,25 @@ const nextConfig = {
66
},
77
images: {
88
remotePatterns: [
9-
{
10-
protocol: "https",
11-
hostname: "lap-docs.netlify.app",
12-
port: "",
13-
pathname: "/**",
14-
},
15-
{
16-
protocol: "https",
17-
hostname: "raw.githubusercontent.com",
18-
port: "",
19-
pathname: "/**",
20-
},
21-
],
9+
{
10+
protocol: "https",
11+
hostname: "lap-docs.netlify.app",
12+
port: "",
13+
pathname: "/**",
14+
},
15+
{
16+
protocol: "https",
17+
hostname: "raw.githubusercontent.com",
18+
port: "",
19+
pathname: "/**",
20+
},
21+
{
22+
protocol: "https",
23+
hostname: "firebasestorage.googleapis.com",
24+
port: "",
25+
pathname: "/**",
26+
},
27+
],
2228
},
2329
};
2430

0 commit comments

Comments
 (0)