SEO Optimization Implementation for Quartz Website
Project Overview
Implemented comprehensive SEO optimizations for my Quartz-based notes website to improve search engine visibility, social media sharing, and overall discoverability.
Website:
notes.tusharsukhwal.com
Platform: Quartz v4
Implementation Date: December 2024
๐ ๏ธ Technical SEO Implementations
1. Enhanced Head Component (quartz/components/Head.tsx
)
Added Canonical URLs
// Canonical URL for current page const canonicalUrl = socialUrl
Implemented Structured Data (JSON-LD)
const structuredData = { "@context": "https://schema.org", "@type": "WebPage", "@id": canonicalUrl, "url": canonicalUrl, "name": title, "description": description, "headline": title, "inLanguage": cfg.locale, "dateModified": fileData.dates?.modified?.toISOString(), "datePublished": fileData.dates?.published?.toISOString() || fileData.dates?.created?.toISOString(), "author": { "@type": "Person", "name": cfg.pageTitle.replace("'s Notes", "").replace(" Notes", "") }, "publisher": { "@type": "Person", "name": cfg.pageTitle.replace("'s Notes", "").replace(" Notes", "") }, "mainEntityOfPage": { "@type": "WebPage", "@id": canonicalUrl }, ...(fileData.frontmatter?.tags && fileData.frontmatter.tags.length > 0 && { "keywords": fileData.frontmatter.tags.join(", ") }) }
Enhanced Meta Tags
- SEO Meta Tags: Description, author, generator, language
- Robots Directive:
index, follow, max-image-preview:large, max-snippet:-1, max-video-preview:-1
- Keywords: Extracted from frontmatter tags
- Revision Date: Last modified timestamp
2. Robots.txt Implementation (quartz/static/robots.txt
)
Robots.txt Content
User-agent: * Allow: / # Block access to private directories Disallow: /private/ Disallow: /.obsidian/ Disallow: /templates/ # Sitemap location Sitemap: https://notes.tusharsukhwal.com/sitemap.xml # Crawl delay (optional - adjust as needed) Crawl-delay: 1
Key Points
- Located in
quartz/static/
for automatic copying during build- Blocks private directories from crawling
- Points to correct sitemap location
- Sets appropriate crawl delay
3. Configuration Updates (quartz.config.ts
)
Domain Configuration
baseUrl: "notes.tusharsukhwal.com",
Enhanced ContentIndex Plugin
Plugin.ContentIndex({ enableSiteMap: true, enableRSS: true, rssLimit: 20, rssFullHtml: true, includeEmptyFiles: false, }),
Custom OG Images Enabled
Plugin.CustomOgImages({ colorScheme: "lightMode", width: 1200, height: 630, }),
4. HTML Structure Improvements (quartz/components/renderPage.tsx
)
- Language Attribute: Proper
lang
attribute on HTML element - Document Structure: Optimized for accessibility and SEO
๐ SEO Features Implemented
Technical SEO
- XML Sitemap: Auto-generated at
/sitemap.xml
- Robots.txt: Proper crawling instructions
- Canonical URLs: Prevents duplicate content
- Structured Data: JSON-LD WebPage schema
- Meta Tags: Comprehensive optimization
- Language Declaration: HTML lang attributes
Content Optimization
- Meta Descriptions: Auto-generated (150-300 chars)
- Title Tags: Optimized with suffix support
- Keywords: Extracted from tags
- Author Information: Added to meta and structured data
Social Media Optimization
- Open Graph: Complete OG meta tags
- Twitter Cards: Summary with large image
- Custom OG Images: Auto-generated 1200x630 images
Performance Features
- RSS Feed: Full HTML content, 20 recent posts
- Font Preloading: Google Fonts optimization
- CDN Usage: External resource optimization
- SPA Mode: Single Page Application enabled
๐ง Implementation Details
File Structure Changes
quartz/ โโโ static/ โ โโโ robots.txt (NEW) โโโ components/ โ โโโ Head.tsx (MODIFIED) โ โโโ renderPage.tsx (MODIFIED) โโโ config files (MODIFIED)
Code Changes Summary
-
Head Component Enhancements:
- Added canonical link tags
- Implemented JSON-LD structured data
- Enhanced meta tag coverage
- Improved robots directives
-
Configuration Optimizations:
- Updated base URL to actual domain
- Enhanced RSS feed with full HTML
- Enabled custom OG image generation
- Improved content indexing settings
-
Static File Additions:
- Created robots.txt with proper directives
- Configured sitemap location
๐ Expected SEO Benefits
Immediate Improvements
- โ Better search engine crawling and indexing
- โ Enhanced social media sharing appearance
- โ Proper structured data for rich snippets
- โ Canonical URLs preventing duplicate content
Long-term Benefits
- ๐ Improved search engine rankings
- ๐ Increased organic traffic
- ๐ Better click-through rates
- ๐ Enhanced user engagement
๐งช Testing & Validation
Tools for Testing
- Structured Data: Google Rich Results Test
- Meta Tags: Browser Developer Tools inspection
- Open Graph: Facebook Sharing Debugger
- Performance: Google PageSpeed Insights
- Mobile: Google Mobile-Friendly Test
Validation Checklist
- Sitemap accessible at
https://notes.tusharsukhwal.com/sitemap.xml
- Robots.txt accessible at
https://notes.tusharsukhwal.com/robots.txt
- Meta tags properly rendered in page source
- Structured data validates without errors
- OG images generate correctly
- RSS feed contains full content
๐ Content Optimization Guidelines
Recommended Frontmatter
--- title: "Descriptive Title (50-60 characters)" description: "Compelling description for search results (150-160 characters)" tags: ["relevant", "keywords", "topics"] socialDescription: "Custom social media description" created: YYYY-MM-DD ---
Content Best Practices
- Use hierarchical headings (H1, H2, H3)
- Include internal links with
[[wikilink]]
syntax- Add descriptive alt text to images
- Use tags strategically for keyword targeting
- Keep content updated with modification dates
๐ Ongoing Maintenance
Weekly Tasks
- Monitor Google Search Console for errors
- Check Core Web Vitals performance
- Review analytics for top content
Monthly Tasks
- Update meta descriptions for high-traffic pages
- Optimize images and alt text
- Review internal linking structure
- Update outdated content
Quarterly Tasks
- Conduct keyword research
- Perform technical SEO audit
- Analyze competitor strategies
- Review and update content taxonomy
๐ฏ Next Steps
Google Search Console Setup
- Verify domain ownership
- Submit sitemap
- Monitor indexing status
Content Strategy
- Implement topic clustering
- Plan content calendar
- Focus on long-tail keywords
Performance Monitoring
- Set up analytics tracking
- Monitor Core Web Vitals
- Track search performance
๐ Related Resources
- SEO-Guide - Comprehensive SEO optimization guide
- Quartz Documentation - Official Quartz docs
- Google Search Console - Webmaster tools
- Schema.org - Structured data reference
Status: โ Implementation Complete
Last Updated: December 19, 2024
Next Review: January 2025