Hugo Deployment to Cloudflare Pages - Troubleshooting#
What Was Established#
Patterns for resolving missing assets (favicons, CSS, styling) and build failures when deploying Hugo-generated static sites to Cloudflare Pages.
Key Decisions#
- Build Configuration: Set build command to
hugo, output directory topublic, and explicitly match the local Hugo version in Cloudflare Pages settings. - Static Asset Placement: Ensure all static files (e.g.,
favicon.ico, CSS) reside in thestatic/directory root or theme-specific static folders. - Rebuild Enforcement: Use
hugo --cleanDestinationDiror manually remove thepublic/directory to force Hugo to regenerate all assets and detect changes. - Cache Management: Clear both Cloudflare Pages deployment cache and browser cache to prevent stale asset delivery.
- Verification Workflow: Validate locally via
hugo server, inspect the generatedpublic/directory, review Cloudflare deployment logs, and confirm full Git commits.
Current Configuration#
- Build Command:
hugo - Output Directory:
public - Static Directory:
static/ - Config File:
config.toml/config.yaml(verifybaseURLmatches target domain)
Obsidian Integration for Hugo Date Format#
Hugo expects ISO 8601 dates with timezone offset: 2025-11-22T23:11:12-05:00
Templater Plugin (Recommended)#
---
date: <% tp.date.now("YYYY-MM-DDTHH:mm:ssZ") %>
---The Z in the format string handles timezone conversion automatically.
QuickAdd Plugin#
---
date: {{DATE:YYYY-MM-DDTHH:mm:ssZ}}
---Timezone Offset Explained#
-05:00= EST (5 hours behind UTC)-04:00= EDT (4 hours behind UTC)- Hugo uses this format because it’s machine-readable and unambiguous across timezones.
Historical Notes#
- Conversation date: 2025-11-24 (Cloudflare Pages), 2025-11-27 (Obsidian config).
- Addresses Cloudflare Pages specifically; distinct from Cloudflare Workers deployments.
- No specific homelab infrastructure IPs or hostnames involved; represents a general static-site deployment pattern.
Open Questions#
- None identified in the historical conversations.
Related Pages#
- Hinterflix Help Site - Cloudflare Deployment: Covers Hugo deployment to Cloudflare Workers.
- Web Server Architecture on Proxmox: Covers local static site hosting patterns.
- Self-Hosted CMS Options & Landscape: Covers Hugo among other CMS options.
Sources#
ingested/chats/121-Configuring Obsidian for Hugo DateTime Format.mdingested/chats/116-Troubleshooting Hugo Deployment to Cloudflare Pages.mdingested/chats/114-How do I check the repository fo.md- Historical DeepSeek conversation (2025-11-24): Cloudflare Pages troubleshooting
- DeepSeek conversation: “Configuring Obsidian for Hugo DateTime Format” (chat 121)