fix(seo): block gallery from image indexing and remove facebook/tiktok from hero

This commit is contained in:
ssbg04 committed 2026-10-22 02:02:48 +08:00
1 parent 974863e237
commit 3c0654e030
5 files changed
+29 -11

No files matched your search

+1
View File
@@ -23,6 +23,7 @@ export default defineConfig({
!page.includes('/api/') &&
!page.includes('/maintenance') &&
!page.includes('/chat') &&
!page.includes('/gallery') &&
!page.includes('/_image'),
serialize(item) {
if (item.url === 'https://crischarles.com' || item.url === 'https://crischarles.com/') {
+15
View File
@@ -6,13 +6,28 @@ Disallow: /api/
Disallow: /.vercel/
Disallow: /.astro/
Disallow: /maintenance
Disallow: /gallery
Disallow: /gallery/
# Disallow image indexing specifically for Google Images crawler
User-agent: Googlebot-Image
Disallow: /gallery
Disallow: /gallery/
# Allow specific crawlers
User-agent: Googlebot
Allow: /
Disallow: /api/
Disallow: /.vercel/
Disallow: /.astro/
Disallow: /maintenance
Disallow: /gallery
Disallow: /gallery/
User-agent: Bingbot
Allow: /
Disallow: /gallery
Disallow: /gallery/
# Reference to sitemap
Sitemap: https://crischarles.com/sitemap-index.xml
+3 -2
View File
@@ -80,13 +80,14 @@ export default function Hero({
}
};
const linksToRender = socialLinks.length > 0
const linksToRender = (socialLinks.length > 0
? socialLinks.filter(l => l.showInHero !== false)
: [
{ platform: "GitHub", url: "https://github.com/ssbg04", icon: "github", order: 1 },
{ platform: "LinkedIn", url: "https://www.linkedin.com/in/cris-charles-garcia/", icon: "linkedin", order: 2 },
{ platform: "Email", url: "mailto:crischarlesgarcia345@gmail.com", icon: "mail", order: 3 }
];
]
).filter(l => !['facebook', 'tiktok'].includes(l.platform.toLowerCase()));
const dayImg = heroImage || (ppDay as any).src || ppDay;
const nightImg = heroImageNight || heroImage || (ppNight as any).src || ppNight;
+7 -8
View File
@@ -30,20 +30,24 @@ const imagePath = image.startsWith('http')
const socialImageURL = new URL(imagePath, siteOrigin).href;
const isGalleryPage = Astro.url.pathname.startsWith('/gallery');
const isIndexablePage =
!isGalleryPage &&
!Astro.url.pathname.startsWith('/api/') &&
!Astro.url.pathname.startsWith('/maintenance') &&
!Astro.url.pathname.startsWith('/_astro') &&
!Astro.url.pathname.startsWith('/_image');
const robotsValue = isIndexablePage
const robotsValue = isGalleryPage
? 'noindex, noimageindex, nofollow'
: isIndexablePage
? 'index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1'
: 'noindex, nofollow';
const socialProfiles = [
'https://github.com/ssbg04',
'https://www.facebook.com/kristyarls345/',
'https://www.tiktok.com/@sisibigi',
'https://www.linkedin.com/in/cris-charles-garcia/',
'https://crischarles.com',
];
@@ -64,11 +68,6 @@ const navigationElements = [
description: 'Verified credentials and certifications earned by Cris Charles Garcia from Cisco and other industry-recognized programs.',
path: '/certifications'
},
{
name: 'Gallery',
description: 'Visual showcase and photo archive of project milestones, developer activities, and academic experiences.',
path: '/gallery'
},
{
name: 'Contact',
description: 'Get in touch with Cris Charles Garcia for development inquiries, consulting, or project collaborations.',
+3 -1
View File
@@ -549,12 +549,14 @@ export async function getSocialLinks(): Promise<SocialLink[]> {
else if (iconKey.includes('linkedin')) iconKey = 'linkedin';
else if (iconKey.includes('mail') || iconKey.includes('email')) iconKey = 'mail';
const isSocialMedia = ['facebook', 'tiktok'].includes(platformName.toLowerCase());
return {
platform: platformName,
url: l.url || '#',
icon: iconKey,
order: typeof l.order === 'number' ? l.order : idx + 1,
showInHero: l.showInHero ?? true,
showInHero: isSocialMedia ? false : (l.showInHero ?? true),
showInFooter: l.showInFooter ?? true,
showInLinksPage: l.showInLinksPage ?? true
};