Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seo sitemap #422

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions apps/web/app/(routes)/[lang]/[project]/auction/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
import { getDictionary } from '@/dictionaries'
import { AVAILABLE_LANGS } from '@/lib/config'
import { getProjects } from '@/lib/projects'
import type { ProjectPageProps } from '@/types/routing.type'
import type { MetadataRoute } from 'next'
import { generateStaticParams } from '../page'

export default async function sitemap({
params,
}: ProjectPageProps): Promise<MetadataRoute.Sitemap> {
const dict = await getDictionary(params.lang)
const projects = await getProjects(dict)
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const projects = await generateStaticParams()

return projects.map((project) => ({
url: `https://${process.env.NEXT_PUBLIC_APP_URL}/${project.slug}/auction`,
return projects.map((item) => ({
url: `https://${process.env.NEXT_PUBLIC_APP_URL}/${item.project}/auction`,
lastModified: new Date(),
changeFrequency: 'yearly',
priority: 0.9,
alternates: {
// ? e.g.: { 'en': 'https://example.com/en/...', 'es': 'https://example.com/es/...', ... }
languages: Object.fromEntries(
AVAILABLE_LANGS.map((lang) => [
lang,
`https://${process.env.NEXT_PUBLIC_APP_URL}/${lang}/${project.slug}/presale`,
`https://${process.env.NEXT_PUBLIC_APP_URL}/${lang}/${item.project}/auction`,
]),
),
AndlerRL marked this conversation as resolved.
Show resolved Hide resolved
},
}))
}
}
10 changes: 10 additions & 0 deletions apps/web/app/(routes)/[lang]/[project]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,13 @@ const DynamicCtaButton = dynamic(
loading: () => <Button variant="accent">Get Whitelisted</Button>,
},
)


export async function generateMetadata({ params }: ProjectPageProps) {
const dict = await getDictionary(params.lang)
const project = await getProjectBySlug(params.project, dict)
return {
title: project?.title,
description: project?.pitch,
}
}
luighis marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 7 additions & 0 deletions apps/web/app/(routes)/[lang]/[project]/presale/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,10 @@ export default async function ProjectPage({ params }: ProjectPageProps) {
</div>
)
}

export async function generateMetadata({ params }: ProjectPageProps) {
return {
title: `Presale - ${params.project}`,
description: `Participate in the presale for ${params.project}. Contribute and be a part of the project before it launches.`,
}
}
AndlerRL marked this conversation as resolved.
Show resolved Hide resolved
15 changes: 7 additions & 8 deletions apps/web/app/(routes)/[lang]/[project]/presale/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,22 @@ import { AVAILABLE_LANGS } from '@/lib/config'
import { getProjects } from '@/lib/projects'
import type { ProjectPageProps } from '@/types/routing.type'
import type { MetadataRoute } from 'next'
import { generateStaticParams } from '../page'

export default async function sitemap({
params,
}: ProjectPageProps): Promise<MetadataRoute.Sitemap> {
const dict = await getDictionary(params.lang)
const projects = await getProjects(dict)
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const projects = await generateStaticParams()

return projects.map((project) => ({
url: `https://${process.env.NEXT_PUBLIC_APP_URL}/${project.slug}/presale`,
return projects.map((item) => ({
url: `https://${process.env.NEXT_PUBLIC_APP_URL}/${item.project}/presale`,
AndlerRL marked this conversation as resolved.
Show resolved Hide resolved
lastModified: new Date(),
changeFrequency: 'yearly',
priority: 0.9,
alternates: {
// ? e.g.: { 'en': 'https://example.com/en/...', 'es': 'https://example.com/es/...', ... }
languages: Object.fromEntries(
AVAILABLE_LANGS.map((lang) => [
lang,
`https://${process.env.NEXT_PUBLIC_APP_URL}/${lang}/${project.slug}/presale`,
`https://${process.env.NEXT_PUBLIC_APP_URL}/${lang}/${item.project}/presale`,
]),
),
},
Expand Down
20 changes: 8 additions & 12 deletions apps/web/app/(routes)/[lang]/[project]/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
import { getDictionary } from '@/dictionaries'
import { AVAILABLE_LANGS } from '@/lib/config'
import { getProjects } from '@/lib/projects'
import type { ProjectPageProps } from '@/types/routing.type'
import type { MetadataRoute } from 'next'
import { generateStaticParams } from './page'

export default async function sitemap({
params,
}: ProjectPageProps): Promise<MetadataRoute.Sitemap> {
const dict = await getDictionary(params.lang)
const projects = await getProjects(dict)
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const projects = await generateStaticParams()

return projects.map((project) => ({
url: `https://${process.env.NEXT_PUBLIC_APP_URL}/${project.slug}`,
return projects.map((item) => ({
url: `https://${process.env.NEXT_PUBLIC_APP_URL}/${item.project}`,
lastModified: new Date(),
priority: 0.9,
changeFrequency: 'yearly',
priority: 0.7,
alternates: {
// ? e.g.: { 'en': 'https://example.com/en/...', 'es': 'https://example.com/es/...', ... }
languages: Object.fromEntries(
AVAILABLE_LANGS.map((lang) => [
lang,
`https://${process.env.NEXT_PUBLIC_APP_URL}/${lang}/${project.slug}`,
`https://${process.env.NEXT_PUBLIC_APP_URL}/${lang}/${item.project}`,
]),
),
},
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/(routes)/[lang]/about/about-bitlauncher/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const content: AboutBitlauncherPageContent = {
}

export const metadata: Metadata = {
title: 'Bitlauncher',
title: 'About Bitlauncher - AI & Cryptocurrency Launchpad',
description:
'Be part of the intelligent future and join the Ai/Web3 revolution now!',
'Discover Bitlauncher, the pioneering launchpad dedicated to transforming AI and cryptocurrency. Join the AI/Web3 revolution today!',
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { AVAILABLE_LANGS } from '@/lib/config'
import type { CommonPageProps } from '@/types/routing.type'
import type { MetadataRoute } from 'next'

export default async function sitemap({
params,
}: CommonPageProps): Promise<MetadataRoute.Sitemap> {
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
return [
{
url: `https://${process.env.NEXT_PUBLIC_APP_URL}/about/about-bitlauncher`,
Expand Down
50 changes: 20 additions & 30 deletions apps/web/app/(routes)/[lang]/blog/[category]/[slug]/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,24 @@
import { AVAILABLE_LANGS } from '@/lib/config'
import { getBlogCategoryLandingData } from '@/services/datocms'
import { getAllArticles } from '@/services/datocms/datocms-all-articles.service'
import type { MetadataRoute } from 'next'
import type { ArticlePageProps } from './page'

export default async function sitemap(
props: ArticlePageProps,
): Promise<MetadataRoute.Sitemap> {
const {
params: { lang, category },
} = props
const data = await getBlogCategoryLandingData(lang, category)
if (!data) return []

const { sections } = data
if (!sections) return []

const slugs = sections.map((section) => section.slug)

return slugs.map((slug) => ({
url: `https://${process.env.NEXT_PUBLIC_APP_URL}/${lang}/blog/${category}/${slug}`,
lastModified: new Date(),
priority: 0.5,
alternates: {
// ? e.g.: { 'en': 'https://example.com/en/...', 'es': 'https://example.com/es/...', ... }
languages: Object.fromEntries(
AVAILABLE_LANGS.map((lang) => [
lang,
`https://${process.env.NEXT_PUBLIC_APP_URL}/${lang}/blog/${category}/${slug}`,
]),
),
},
}))
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const articles = await getAllArticles()
if (!articles) return []
AndlerRL marked this conversation as resolved.
Show resolved Hide resolved

AndlerRL marked this conversation as resolved.
Show resolved Hide resolved
return articles.flatMap((item) =>
item.articles.map((article) => ({
url: `https://${process.env.NEXT_PUBLIC_APP_URL}/blog/${item.category}/${article.slug}`,
lastModified: article._publishedAt,
priority: 0.6,
alternates: {
languages: Object.fromEntries(
AVAILABLE_LANGS.map((lang) => [
lang,
`https://${process.env.NEXT_PUBLIC_APP_URL}/${lang}/blog/${item.category}/${article.slug}`,
]),
),
},
})),
)
}
13 changes: 4 additions & 9 deletions apps/web/app/(routes)/[lang]/blog/[category]/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
import { AVAILABLE_LANGS } from '@/lib/config'
import { getArticleSections } from '@/services/datocms'
import type { MetadataRoute } from 'next'
import type { CategoryPageProps } from './page'

export default async function sitemap(
props: CategoryPageProps,
): Promise<MetadataRoute.Sitemap> {
const {
params: { lang },
} = props
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
luighis marked this conversation as resolved.
Show resolved Hide resolved
let sections = []
try {
sections = await getArticleSections(lang)
sections = await getArticleSections('en')
} catch (error) {
return []
}

const categories = sections.map((section) => section.slug)

return categories.map((category) => ({
url: `https://${process.env.NEXT_PUBLIC_APP_URL}/${lang}/blog/${category}`,
url: `https://${process.env.NEXT_PUBLIC_APP_URL}/blog/${category}`,
lastModified: new Date(),
priority: 0.7,
alternates: {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/app/(routes)/[lang]/blog/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default async function BlogPage({ params }: BlogPageProps) {
export async function generateMetadata({
params,
}: BlogPageProps): Promise<Metadata> {
const pageSeo = await getPageSeoText('home')
const pageSeo = await getPageSeoText('bitlauncher')
luighis marked this conversation as resolved.
Show resolved Hide resolved
const seoData = {
title: pageSeo.pageSeo?.title || '',
description: pageSeo.pageSeo?.description || '',
Expand Down
5 changes: 1 addition & 4 deletions apps/web/app/(routes)/[lang]/blog/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import { AVAILABLE_LANGS } from '@/lib/config'
import type { CommonPageProps } from '@/types/routing.type'
import type { MetadataRoute } from 'next'

export default async function sitemap({
params,
}: CommonPageProps): Promise<MetadataRoute.Sitemap> {
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
return [
{
url: `https://${process.env.NEXT_PUBLIC_APP_URL}/blog`,
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/(routes)/[lang]/learn/security/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default async function SecurityTips({ params }: CommonPageProps) {
}

export const metadata: Metadata = {
title: 'Security Tips | Bitlauncher',
title: 'Top Security Tips for a Safer Digital Experience',
description:
'Be part of the intelligent future and join the Ai/Web3 revolution now!',
'Discover essential security tips to protect yourself online. Join the AI/Web3 revolution and stay ahead with our expert advice.',
}
2 changes: 1 addition & 1 deletion apps/web/app/(routes)/[lang]/legal/privacy/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default async function PrivacyPolicy({ params }: CommonPageProps) {
}

export const metadata: Metadata = {
title: 'Privacy Policy | Bitlauncher',
title: 'Privacy Policy',
AndlerRL marked this conversation as resolved.
Show resolved Hide resolved
description:
'Read our Privacy Policy to understand how we protect and manage your data in our crypto launchpad application.',
}
6 changes: 3 additions & 3 deletions apps/web/app/(routes)/[lang]/legal/terms/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default async function PrivacyPolicy({ params }: CommonPageProps) {
}

export const metadata: Metadata = {
title: 'Privacy Policy | Bitlauncher',
title: 'Terms of Service',
description:
'Read our Privacy Policy to understand how we protect and manage your data in our crypto launchpad application.',
}
'Review our Terms of Service to understand the rules and regulations for using our crypto launchpad application.',
}
62 changes: 58 additions & 4 deletions apps/web/app/(routes)/[lang]/sitemap.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { AVAILABLE_LANGS } from '@/lib/config'
import type { CommonPageProps } from '@/types/routing.type'
import type { MetadataRoute } from 'next'

export default async function sitemap({
params,
}: CommonPageProps): Promise<MetadataRoute.Sitemap> {
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
return [
{
url: `https://${process.env.NEXT_PUBLIC_APP_URL}`,
lastModified: new Date(),
changeFrequency: 'yearly',
priority: 1,
alternates: {
// ? e.g.: { 'en': 'https://example.com/en/...', 'es': 'https://example.com/es/...', ... }
Expand All @@ -20,5 +18,61 @@ export default async function sitemap({
),
},
},
{
url: `https://${process.env.NEXT_PUBLIC_APP_URL}/blog`,
lastModified: new Date(),
changeFrequency: 'monthly',
priority: 0.8,
alternates: {
languages: Object.fromEntries(
AVAILABLE_LANGS.map((lang) => [
lang,
`https://${process.env.NEXT_PUBLIC_APP_URL}/${lang}/blog`,
]),
),
},
},
{
url: `https://${process.env.NEXT_PUBLIC_APP_URL}/whitepaper`,
lastModified: new Date(),
changeFrequency: 'yearly',
priority: 0.6,
alternates: {
languages: Object.fromEntries(
AVAILABLE_LANGS.map((lang) => [
lang,
`https://${process.env.NEXT_PUBLIC_APP_URL}/${lang}/whitepaper`,
]),
),
},
},
{
url: `https://${process.env.NEXT_PUBLIC_APP_URL}/learn/security`,
lastModified: new Date(),
changeFrequency: 'yearly',
priority: 0.6,
alternates: {
languages: Object.fromEntries(
AVAILABLE_LANGS.map((lang) => [
lang,
`https://${process.env.NEXT_PUBLIC_APP_URL}/${lang}/learn/security`,
]),
),
},
},
{
url: `https://${process.env.NEXT_PUBLIC_APP_URL}/about/about-bitlauncher`,
lastModified: new Date(),
changeFrequency: 'yearly',
priority: 0.6,
alternates: {
languages: Object.fromEntries(
AVAILABLE_LANGS.map((lang) => [
lang,
`https://${process.env.NEXT_PUBLIC_APP_URL}/${lang}/about/about-bitlauncher`,
]),
),
},
},
]
}
4 changes: 2 additions & 2 deletions apps/web/app/(routes)/[lang]/wallet/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ export default function WalletPage() {
}

export const metadata: Metadata = {
title: 'Wallet | Bitlauncher',
title: 'Wallet Balances',
description:
'Be part of the intelligent future and join the Ai/Web3 revolution now!',
'Your balances on the Bitlauncher | Bitcash ecosystem. Connect your Bitcash and EVM wallets',
}

function BalancesCard() {
Expand Down
4 changes: 2 additions & 2 deletions apps/web/app/(routes)/[lang]/whitepaper/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export default async function WhitepaperPage() {
}

export const metadata: Metadata = {
title: 'Bitlauncher',
description: 'Whitepaper',
title: 'Comprehensive Whitepaper',
description: 'Explore the detailed whitepaper of Bitlauncher, covering all aspects of our innovative platform and technology.',
}
AndlerRL marked this conversation as resolved.
Show resolved Hide resolved
Loading