This is an automated email from the ASF dual-hosted git repository.

xiangfu pushed a commit to branch new-site-dev
in repository https://gitbox.apache.org/repos/asf/pinot-site.git


The following commit(s) were added to refs/heads/new-site-dev by this push:
     new 8af5f021 no-ticket - remove tags, fix sitemap (#120)
8af5f021 is described below

commit 8af5f02150285f0e8049cacf7d47226341ab7e31
Author: Gio <[email protected]>
AuthorDate: Sat Apr 20 04:17:06 2024 +0200

    no-ticket - remove tags, fix sitemap (#120)
---
 app/blog/page/[page]/page.tsx | 37 -----------------
 app/sitemap.ts                |  2 +-
 app/tag-data.json             | 96 -------------------------------------------
 app/tags/[tag]/page.tsx       | 43 -------------------
 app/tags/page.tsx             | 41 ------------------
 components/Tag.tsx            | 18 --------
 data/siteMetadata.js          |  2 +-
 layouts/ListLayout.tsx        |  4 --
 scripts/generate-sitemap.js   |  2 +-
 scripts/rss.mjs               | 24 +++++------
 10 files changed, 15 insertions(+), 254 deletions(-)

diff --git a/app/blog/page/[page]/page.tsx b/app/blog/page/[page]/page.tsx
deleted file mode 100644
index c013a04f..00000000
--- a/app/blog/page/[page]/page.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import ListLayout from '@/layouts/ListLayout';
-import { allCoreContent, sortPosts } from 'pliny/utils/contentlayer';
-import { allBlogs } from 'contentlayer/generated';
-import { genPageMetadata } from '@/app/seo';
-
-const POSTS_PER_PAGE = 5;
-
-export const metadata = genPageMetadata({ title: 'Posts', description: 'All 
posts' });
-
-export const generateStaticParams = async () => {
-    const totalPages = Math.ceil(allBlogs.length / POSTS_PER_PAGE);
-    const paths = Array.from({ length: totalPages }, (_, i) => ({ page: (i + 
1).toString() }));
-
-    return paths;
-};
-
-export default function Page({ params }: { params: { page: string } }) {
-    const posts = allCoreContent(sortPosts(allBlogs));
-    const pageNumber = parseInt(params.page as string);
-    const initialDisplayPosts = posts.slice(
-        POSTS_PER_PAGE * (pageNumber - 1),
-        POSTS_PER_PAGE * pageNumber
-    );
-    const pagination = {
-        currentPage: pageNumber,
-        totalPages: Math.ceil(posts.length / POSTS_PER_PAGE)
-    };
-
-    return (
-        <ListLayout
-            posts={posts}
-            initialDisplayPosts={initialDisplayPosts}
-            pagination={pagination}
-            title="All Posts"
-        />
-    );
-}
diff --git a/app/sitemap.ts b/app/sitemap.ts
index b71748ca..da9f03af 100644
--- a/app/sitemap.ts
+++ b/app/sitemap.ts
@@ -12,7 +12,7 @@ export default function sitemap(): MetadataRoute.Sitemap {
             lastModified: post.lastmod || post.date
         }));
 
-    const routes = ['', 'blog', 'projects', 'tags'].map((route) => ({
+    const routes = ['', 'blog'].map((route) => ({
         url: `${siteUrl}/${route}`,
         lastModified: new Date().toISOString().split('T')[0]
     }));
diff --git a/app/tag-data.json b/app/tag-data.json
deleted file mode 100644
index 0a1a8e70..00000000
--- a/app/tag-data.json
+++ /dev/null
@@ -1,96 +0,0 @@
-{
-    "pinot": 47,
-    "linkedin": 11,
-    "data-scaling": 1,
-    "real-time-data-platform": 28,
-    "realtime": 28,
-    "analytics": 47,
-    "user-facing-analytics": 47,
-    "ab-testing": 1,
-    "infrastructure": 1,
-    "uber-data": 1,
-    "financial-intelligence": 2,
-    "thirdeye": 12,
-    "uber": 3,
-    "presto": 2,
-    "sql": 1,
-    "devblog": 13,
-    "sla": 3,
-    "monitoring": 1,
-    "jmx": 1,
-    "prometheus": 1,
-    "grafana": 1,
-    "debezium": 2,
-    "cdc": 2,
-    "change-data-analysis": 1,
-    "trino": 1,
-    "prestosql": 1,
-    "upsert": 1,
-    "h3": 1,
-    "data": 19,
-    "text-analytics": 1,
-    "releases": 1,
-    "interpolation": 1,
-    "gapfilling": 1,
-    "indexes": 1,
-    "insert": 1,
-    "timestamp": 1,
-    "datetrunc": 1,
-    "pause": 1,
-    "resume": 1,
-    "real-time-ingestion": 1,
-    "deduplication": 1,
-    "hybrid-tables": 1,
-    "time-boundary": 1,
-    "consumer-record-lag": 1,
-    "kafka": 3,
-    "geospatial-indexing": 1,
-    "star-tree-index": 1,
-    "data-explorer": 1,
-    "getting-started": 1,
-    "streaming": 2,
-    "json": 1,
-    "blog-post": 3,
-    "analyzing-user-activity": 1,
-    "server-popularity": 1,
-    "mastodon": 1,
-    "kafka-connect": 1,
-    "parquet": 1,
-    "seaborn": 1,
-    "duckdb": 1,
-    "potential": 1,
-    "apache-pinot": 1,
-    "realtime-data-streaming": 1,
-    "dashboard": 1,
-    "instructions": 1,
-    "ingesting": 1,
-    "apache-avro-messages": 1,
-    "pinot-table": 1,
-    "querying-data": 1,
-    "implementing": 1,
-    "startree-index": 1,
-    "query-performance": 1,
-    "adtech-platform": 1,
-    "reducing-latency": 1,
-    "cybersecurity-threat-detection": 1,
-    "multiplayer-game-leaderboard-tracking": 1,
-    "improved-query-performance": 1,
-    "cost-savings": 1,
-    "real-production-use-cases": 1,
-    "startree-cloud": 1,
-    "realtime-analytics": 1,
-    "95-to-99-improvement": 1,
-    "feature-contribution": 1,
-    "segment-compaction": 1,
-    "apache-pinot-project": 1,
-    "older-records": 1,
-    "storage-space": 1,
-    "configuration": 1,
-    "impact": 1,
-    "freeing-up-storage": 1,
-    "joins": 1,
-    "compression": 1,
-    "null-support": 1,
-    "pluggable-index": 1,
-    "spark-integration": 1
-}
diff --git a/app/tags/[tag]/page.tsx b/app/tags/[tag]/page.tsx
deleted file mode 100644
index 1bfa47af..00000000
--- a/app/tags/[tag]/page.tsx
+++ /dev/null
@@ -1,43 +0,0 @@
-import { slug } from 'github-slugger';
-import { allCoreContent, sortPosts } from 'pliny/utils/contentlayer';
-import siteMetadata from '@/data/siteMetadata';
-import ListLayout from '@/layouts/ListLayout';
-import { allBlogs } from 'contentlayer/generated';
-import tagData from 'app/tag-data.json';
-import { genPageMetadata } from 'app/seo';
-import { Metadata } from 'next';
-
-export async function generateMetadata({ params }: { params: { tag: string } 
}): Promise<Metadata> {
-    const tag = decodeURI(params.tag);
-    return genPageMetadata({
-        title: tag,
-        description: `${siteMetadata.title} ${tag} tagged content`,
-        alternates: {
-            canonical: './',
-            types: {
-                'application/rss+xml': 
`${siteMetadata.siteUrl}/tags/${tag}/feed.xml`
-            }
-        }
-    });
-}
-
-export const generateStaticParams = async () => {
-    const tagCounts = tagData as Record<string, number>;
-    const tagKeys = Object.keys(tagCounts);
-    const paths = tagKeys.map((tag) => ({
-        tag: encodeURI(tag)
-    }));
-    return paths;
-};
-
-export default function TagPage({ params }: { params: { tag: string } }) {
-    const tag = decodeURI(params.tag);
-    // Capitalize first letter and convert space to dash
-    const title = tag[0].toUpperCase() + tag.split(' ').join('-').slice(1);
-    const filteredPosts = allCoreContent(
-        sortPosts(
-            allBlogs.filter((post) => post.tags && post.tags.map((t) => 
slug(t)).includes(tag))
-        )
-    );
-    return <ListLayout posts={filteredPosts} title={title} />;
-}
diff --git a/app/tags/page.tsx b/app/tags/page.tsx
deleted file mode 100644
index 7681040c..00000000
--- a/app/tags/page.tsx
+++ /dev/null
@@ -1,41 +0,0 @@
-import Link from '@/components/Link';
-import Tag from '@/components/Tag';
-import { slug } from 'github-slugger';
-import tagData from 'app/tag-data.json';
-import { genPageMetadata } from 'app/seo';
-
-export const metadata = genPageMetadata({ title: 'Tags', description: 'Things 
I blog about' });
-
-export default async function Page() {
-    const tagCounts = tagData as Record<string, number>;
-    const tagKeys = Object.keys(tagCounts);
-    const sortedTags = tagKeys.sort((a, b) => tagCounts[b] - tagCounts[a]);
-    return (
-        <>
-            <div className="flex flex-col items-start justify-start divide-y 
divide-gray-200 dark:divide-gray-700 md:mt-24 md:flex-row md:items-center 
md:justify-center md:space-x-6 md:divide-y-0">
-                <div className="space-x-2 pb-8 pt-6 md:space-y-5">
-                    <h1 className="text-3xl font-extrabold leading-9 
tracking-tight text-gray-900 dark:text-gray-100 sm:text-4xl sm:leading-10 
md:border-r-2 md:px-6 md:text-6xl md:leading-14">
-                        Tags
-                    </h1>
-                </div>
-                <div className="flex max-w-lg flex-wrap">
-                    {tagKeys.length === 0 && 'No tags found.'}
-                    {sortedTags.map((t) => {
-                        return (
-                            <div key={t} className="mb-2 mr-5 mt-2">
-                                <Tag text={t} />
-                                <Link
-                                    href={`/tags/${slug(t)}`}
-                                    className="-ml-2 text-sm font-semibold 
uppercase text-gray-600 dark:text-gray-300"
-                                    aria-label={`View posts tagged ${t}`}
-                                >
-                                    {` (${tagCounts[t]})`}
-                                </Link>
-                            </div>
-                        );
-                    })}
-                </div>
-            </div>
-        </>
-    );
-}
diff --git a/components/Tag.tsx b/components/Tag.tsx
deleted file mode 100644
index 7a67360a..00000000
--- a/components/Tag.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import Link from 'next/link';
-import { slug } from 'github-slugger';
-interface Props {
-    text: string;
-}
-
-const Tag = ({ text }: Props) => {
-    return (
-        <Link
-            href={`/tags/${slug(text)}`}
-            className="mr-3 text-sm font-medium uppercase text-primary-500 
hover:text-primary-600 dark:hover:text-primary-400"
-        >
-            {text.split(' ').join('-')}
-        </Link>
-    );
-};
-
-export default Tag;
diff --git a/data/siteMetadata.js b/data/siteMetadata.js
index 2e438d25..96359458 100644
--- a/data/siteMetadata.js
+++ b/data/siteMetadata.js
@@ -14,7 +14,7 @@ const siteMetadata = {
     siteLogo: '/static/images/logo.png',
     socialBanner: '/static/images/twitter-card.png',
     mastodon: 'https://mastodon.social/explore',
-    email: '[email protected]',
+    email: '',
     github: 'https://github.com/apache/pinot',
     twitter: 'https://twitter.com/Twitter',
     facebook: 'https://facebook.com',
diff --git a/layouts/ListLayout.tsx b/layouts/ListLayout.tsx
index 8c2002f9..9d8f05c8 100644
--- a/layouts/ListLayout.tsx
+++ b/layouts/ListLayout.tsx
@@ -6,7 +6,6 @@ import { formatDate } from 'pliny/utils/formatDate';
 import { CoreContent } from 'pliny/utils/contentlayer';
 import type { Blog } from 'contentlayer/generated';
 import Link from '@/components/Link';
-import Tag from '@/components/Tag';
 import siteMetadata from '@/data/siteMetadata';
 
 interface PaginationProps {
@@ -139,9 +138,6 @@ export default function ListLayout({
                                                     {title}
                                                 </Link>
                                             </h3>
-                                            <div className="flex flex-wrap">
-                                                {tags?.map((tag) => <Tag 
key={tag} text={tag} />)}
-                                            </div>
                                         </div>
                                         <div className="prose max-w-none 
text-gray-500 dark:text-gray-400">
                                             {summary}
diff --git a/scripts/generate-sitemap.js b/scripts/generate-sitemap.js
index cfc8630b..f7bd0579 100644
--- a/scripts/generate-sitemap.js
+++ b/scripts/generate-sitemap.js
@@ -9,7 +9,7 @@ const siteMetadata = require('../data/siteMetadata');
         'pages/*.js',
         'data/**/*.mdx',
         'data/**/*.md',
-        'public/tags/**/*.xml',
+        // 'public/tags/**/*.xml',
         '!pages/_*.js',
         '!pages/api'
     ]);
diff --git a/scripts/rss.mjs b/scripts/rss.mjs
index aeada318..cb4175e4 100644
--- a/scripts/rss.mjs
+++ b/scripts/rss.mjs
@@ -3,7 +3,7 @@ import path from 'path';
 import GithubSlugger from 'github-slugger';
 import { escape } from 'pliny/utils/htmlEscaper.js';
 import siteMetadata from '../data/siteMetadata.js';
-import tagData from '../app/tag-data.json' assert { type: 'json' };
+// import tagData from '../app/tag-data.json' assert { type: 'json' };
 import { allBlogs } from '../.contentlayer/generated/index.mjs';
 import { sortPosts } from 'pliny/utils/contentlayer.js';
 
@@ -43,17 +43,17 @@ async function generateRSS(config, allBlogs, page = 
'feed.xml') {
         writeFileSync(`./public/${page}`, rss);
     }
 
-    if (publishPosts.length > 0) {
-        for (const tag of Object.keys(tagData)) {
-            const filteredPosts = allBlogs.filter((post) =>
-                post.tags.map((t) => GithubSlugger.slug(t)).includes(tag)
-            );
-            const rss = generateRss(config, filteredPosts, 
`tags/${tag}/${page}`);
-            const rssPath = path.join('public', 'tags', tag);
-            mkdirSync(rssPath, { recursive: true });
-            writeFileSync(path.join(rssPath, page), rss);
-        }
-    }
+    // if (publishPosts.length > 0) {
+    //     for (const tag of Object.keys(tagData)) {
+    //         const filteredPosts = allBlogs.filter((post) =>
+    //             post.tags.map((t) => GithubSlugger.slug(t)).includes(tag)
+    //         );
+    //         const rss = generateRss(config, filteredPosts, 
`tags/${tag}/${page}`);
+    //         const rssPath = path.join('public', 'tags', tag);
+    //         mkdirSync(rssPath, { recursive: true });
+    //         writeFileSync(path.join(rssPath, page), rss);
+    //     }
+    // }
 }
 
 const rss = () => {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to