Content Redaction Guide
Automatically redact sensitive information from your site in production builds while keeping it visible in local builds.
Overview
The Redact plugin allows you to mark specific sections of your content for automatic removal in production (Cloudflare) builds while keeping them visible when working locally.
Key Benefits:
- ✅ Keep pages intact (don’t remove entire pages)
- ✅ Selectively hide only sensitive sections
- ✅ Preserve context and structure
- ✅ Automatic based on build environment
- ✅ No manual intervention needed
Basic Usage
Wrap sensitive content between HTML comment markers:
## Budget Overview
Total project cost: $68,400
<!-- REDACT-START -->
**Payment Schedule:**
- Payment 1: $6,600 (deposit)
- Payment 2: $20,000 (at signing)
- Payment 3: $20,000 (at framing)
- Payment 4: $21,800 (at completion)
<!-- REDACT-END -->
The garage includes in-floor radiant heating and workshop space.What You See
Local build (npx quartz build --serve):
Total project cost: $68,400
Payment Schedule:
- Payment 1: $6,600 (deposit)
- Payment 2: $20,000 (at signing)
- Payment 3: $20,000 (at framing)
- Payment 4: $21,800 (at completion)
The garage includes in-floor radiant heating...
Production build (Cloudflare):
Total project cost: $68,400
[Content redacted for privacy]
The garage includes in-floor radiant heating...
Custom Replacement Text
Provide context-specific replacement text:
## Contact Information
**Project Owner:** Dan Gahagan
<!-- REDACT-START: Contact details available in local build only -->
- **Email:** dangahagan@gmail.com
- **Phone:** 989-621-8849
<!-- REDACT-END -->
Feel free to reach out with questions!Production shows:
Project Owner: Dan Gahagan
[Contact details available in local build only]
Feel free to reach out with questions!
Common Use Cases
1. Financial Information
## Budget & Financing
<!-- REDACT-START -->
**Home Equity Assessment:** $60,900
**Available HELOC:** ~$70,000
**Loan Amount:** $83,040
<!-- REDACT-END -->
Project financed through home equity line of credit.2. Personal Contact Details
## Permits & Approvals
Application submitted to Clare County Planning.
<!-- REDACT-START -->
**Zoning Official:** Terry Acton
**Email:** actont@clareco.net
**Phone:** 989-539-7131
<!-- REDACT-END -->
Permit approval received on March 15, 2025.3. Vendor Contact Information
## Primary Contractor
**Company:** Hershberger's HP&H Lumber
<!-- REDACT-START -->
**Contact:** Jonas Hershberger
**Email:** HPH Lumber@Gmail.com
**Phone:** +1-989-386-5338 (Marcus)
**Team:** Marcus, Will, Marvin
<!-- REDACT-END -->
Excellent craftsmanship and communication throughout the project.4. Property Details
## Site Information
**Location:** 309 E. 7th St, Clare, MI 48617
<!-- REDACT-START -->
**Parcel ID:** 18-051-500-005-00
**Zoning District:** R-1
**Lot Size:** 0.189 acres
**Setbacks:** 10' rear, 5' side
<!-- REDACT-END -->
Located in a quiet residential neighborhood.5. Mixed Content with Multiple Sections
## Project Timeline
### Phase 1: Planning (Complete)
- ✅ Initial design concepts
- ✅ Permit applications
- ✅ Contractor selection
<!-- REDACT-START: Financial milestone details -->
**Deposit paid:** $6,600 on February 1
**Budget approved:** $68,400 total
<!-- REDACT-END -->
### Phase 2: Foundation (In Progress)
- ✅ Excavation complete
- ✅ Forms installed
- ⧗ Concrete pour scheduled
<!-- REDACT-START -->
**Concrete contractor:** John's Concrete Services
**Contact:** 989-555-1234
**Scheduled:** October 28, 2025
<!-- REDACT-END -->Best Practices
Do: Redact Specific Sensitive Items
✅ Good - Redact only the sensitive data:
Contract total: $68,400
<!-- REDACT-START -->
Payment breakdown:
- Deposit: $6,600
- Framing: $20,000
- Completion: $41,800
<!-- REDACT-END -->❌ Avoid - Redacting too much context:
<!-- REDACT-START -->
Contract total: $68,400
Payment breakdown:
- Deposit: $6,600
- Framing: $20,000
- Completion: $41,800
<!-- REDACT-END -->Do: Keep Context Visible
✅ Good - Readers understand what was redacted:
## Vendor Contacts
**Tree Removal:** Michael Henry Tree Service
<!-- REDACT-START: Contact information redacted -->
Phone: 989-339-4377
Email: mhenry@example.com
<!-- REDACT-END -->
Completed tree removal on October 15.Do: Use Custom Replacement Text
✅ Good - Explains why content is hidden:
<!-- REDACT-START: Financial calculations visible in local build -->
Available equity: $70,000
Loan approval: $83,040
Project budget: $68,400
<!-- REDACT-END -->Don’t: Redact Public Information
❌ Avoid - Redacting already-public info:
<!-- REDACT-START -->
Address: 309 E. 7th St, Clare, MI
<!-- REDACT-END -->Your friends/family already know your address. Only redact information that goes beyond what trusted viewers would know.
Redaction vs. File Exclusion
Use both strategies for comprehensive privacy:
When to Use File Exclusion
Exclude entire files/folders for:
- Documents that are entirely sensitive (contracts, invoices)
- Development/planning documents not meant for sharing
- Large sets of vendor contact files
Configure in quartz.config.ts:
const productionIgnorePatterns = [
"Email Imports/**", // Entire folder
"30-Vendors & Contacts/**", // Entire folder
"10-Planning/Budget & Financing.md", // Single file
]When to Use Content Redaction
Redact specific sections when:
- Page has both public and private information
- You want to preserve page structure and context
- Redacting specific data points (amounts, phone numbers, IDs)
- Multiple small sections throughout a document
Use redaction markers in markdown:
<!-- REDACT-START -->
Sensitive content here
<!-- REDACT-END -->Combined Strategy Example
File: 10-Planning/Budget & Financing.md
Option A: Exclude entire file
// quartz.config.ts
productionIgnorePatterns: [
"10-Planning/Budget & Financing.md",
]Result: Entire page returns 404 in production
Option B: Keep file, redact sensitive sections
# Budget & Financing
Project funded through home equity line of credit.
<!-- REDACT-START -->
Available equity: $70,000
Approved amount: $83,040
<!-- REDACT-END -->
Financing secured through Comerica Bank.
<!-- REDACT-START -->
Loan officer: Gail Zeneberg
Phone: 989-772-6515
<!-- REDACT-END -->
Closing scheduled for February 15.Result: Page accessible with sensitive details hidden
Recommendation for this project:
- Exclude:
Email Imports/**(contracts, permits - entirely sensitive) - Redact: Meeting notes, vendor pages (mix of public/private)
Syntax Reference
Basic Redaction
<!-- REDACT-START -->
Content to hide in production
<!-- REDACT-END -->Custom Replacement Message
<!-- REDACT-START: Your custom message here -->
Content to hide
<!-- REDACT-END -->Multiple Sections
Public content here
<!-- REDACT-START -->
Private section 1
<!-- REDACT-END -->
More public content
<!-- REDACT-START -->
Private section 2
<!-- REDACT-END -->
Final public contentNested Content
Redaction markers work with any markdown:
<!-- REDACT-START -->
## Heading inside redaction
- List item 1
- List item 2
**Bold text** and _italic text_
| Table | Headers |
|-------|---------|
| Data | More |
<!-- REDACT-END -->Testing Your Redactions
Test Local Build
npx quartz build --serveVerify:
- All content visible (including redacted sections)
- Redaction markers removed (clean reading experience)
Test Production Build
NODE_ENV=production npx quartz build --serveVerify:
- Redacted sections show replacement text
- Page structure remains intact
- Navigation still works
- No broken links
Checklist Before Deployment
- Test both local and production builds
- Verify replacement messages are clear
- Check that public content is still visible
- Confirm sensitive data is properly hidden
- Review PII Audit Report for missed items
- Test navigation and internal links work
Common Issues
Redaction Not Working
Problem: Content still visible in production build
Check:
- Markers are exact:
<!-- REDACT-START -->(case-insensitive, but no typos) - Closing marker present:
<!-- REDACT-END --> - Production mode enabled:
NODE_ENV=production
Debug:
NODE_ENV=production npx quartz build
# Check build output for warningsUnclosed Redaction Block
Problem: Warning in build logs
[Redact Plugin] Warning: Found REDACT-START without matching REDACT-END
Solution: Find and add missing <!-- REDACT-END --> marker
Too Much Content Hidden
Problem: Page loses context
Solution: Reduce scope of redaction blocks:
<!-- Before -->
<!-- REDACT-START -->
Entire section with context
<!-- REDACT-END -->
<!-- After -->
Public context here
<!-- REDACT-START -->
Only sensitive data
<!-- REDACT-END -->Configuration Options
Edit quartz.config.ts to customize:
Plugin.Redact({
// Default replacement text for all redactions
replacementText: "_[Content redacted for privacy]_",
// Remove markers in local builds for cleaner reading
removeMarkersInLocal: true,
})Privacy Workflow
Recommended workflow for handling sensitive content:
1. Initial Content Creation
Write everything in Obsidian (full detail, no redactions)
2. Review for Sharing
Before deployment, review pages:
- Identify sensitive sections using PII Audit Report
- Decide: exclude file OR redact sections
3. Apply Redactions
Add redaction markers to files you want to keep:
<!-- REDACT-START -->
Sensitive content
<!-- REDACT-END -->4. Test Locally
# Test full content
npx quartz build --serve
# Test redacted version
NODE_ENV=production npx quartz build --serve5. Deploy
git add .
git commit -m "docs: add redactions for privacy"
git pushCloudflare automatically builds with redactions applied.
6. Maintenance
When updating content:
- Add new sensitive info inside redaction blocks
- Review periodically using PII Audit checklist
Example: Redacting PII Audit Items
Based on PII Audit Report, here are examples of redacting critical items:
Email & Phone (Critical Sensitivity)
## Contact Information
For project inquiries, contact the owner.
<!-- REDACT-START: Contact details redacted for privacy -->
**Email:** dangahagan@gmail.com
**Phone:** 989-621-8849
<!-- REDACT-END -->Financial Details (Critical Sensitivity)
## Project Financing
<!-- REDACT-START: Financial details available in local build -->
**Home Equity Assessment:** $60,900
**Available HELOC:** ~$70,000
**Calculated Loan Amount:** $83,040
<!-- REDACT-END -->
Project funded through home equity financing from Comerica Bank.Parcel ID (Critical Sensitivity)
## Property Details
**Address:** 309 E. 7th St, Clare, MI 48617
<!-- REDACT-START -->
**Parcel ID:** 18-051-500-005-00
**Zoning District:** R-1
**Lot Size:** 0.189 acres
<!-- REDACT-END -->Vendor Contacts (Medium Sensitivity)
## Tree Removal Service
**Company:** Michael Henry Tree Service
Excellent service, completed removal in one day.
<!-- REDACT-START: Contact information redacted -->
**Phone:** 989-339-4377
**Service Date:** October 15, 2025
<!-- REDACT-END -->Related Documentation
- PII Audit Report - Comprehensive privacy audit
- 05 - Deployment and Access Control - Deployment guide
BUILD-MODES.md- Dual-build configuration guide- Web Presentation Implementation Plan - Project overview
With the Redact plugin, you maintain full documentation locally while sharing only appropriate details publicly.