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

  1. Head Component Enhancements:

    • Added canonical link tags
    • Implemented JSON-LD structured data
    • Enhanced meta tag coverage
    • Improved robots directives
  2. Configuration Optimizations:

    • Updated base URL to actual domain
    • Enhanced RSS feed with full HTML
    • Enabled custom OG image generation
    • Improved content indexing settings
  3. 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

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

Status: โœ… Implementation Complete

Last Updated: December 19, 2024
Next Review: January 2025