Automated AI news aggregation site manager for Hugo + Hextra theme. Handles content sync from ai-briefing-archive, dual deployment (Cloudflare Workers + GitHub Pages), RSS feeds, and GA4 analytics integration.
This skill helps you work with AIHeadline.news, an automated AI news aggregation site built with Hugo and the Hextra theme. Content is dynamically generated from the `ai-briefing-archive` repository and deployed to both Cloudflare Workers and GitHub Pages.
**CRITICAL**: The `content/` and `source-news/` directories are **NOT** committed to git. They are dynamically generated during CI/CD builds by fetching and processing external news data.
When the user wants to start local development:
1. Run the quick start script:
```bash
bash .github/scripts/dev.sh
```
This script syncs content and starts the Hugo dev server.
2. If manual control is needed:
```bash
# Fetch latest news data
./.github/scripts/update-source-news.sh
# Sync content to Hugo format
./.github/scripts/sync-news.sh --mode=auto
# Start Hugo development server
hugo server
```
The `sync-news.sh` script supports three modes:
For production builds:
```bash
hugo --gc --minify
npm run dev
```
The `update-source-news.sh` script:
The `sync-news.sh` script:
- Title: Localized date in Chinese (e.g., "10月17日 AI 快讯")
- Weight: Calculated for reverse chronological sorting
- Sources array: Display names extracted from H1 headers
Two independent builds are created:
All content pages inherit `cascade: type: docs` from `content/_index.md`. This affects:
**CRITICAL**: RSS template location matters for Hugo + Hextra:
**Why**: Hugo's template lookup order prioritizes page-kind-specific templates (`index.rss.xml`) over default templates. For homepage RSS with themes that use custom page types, use the explicit `index.rss.xml` path.
The `_worker.ts` file implements:
For Cloudflare Worker deployment:
**Symptoms**: `index.xml` contains channel info but no `<item>` elements
**Diagnosis**:
1. Check if RSS template is at `layouts/index.rss.xml` (not `_default/rss.xml`)
2. Verify page collection method in template uses `site.RegularPages.ByDate.Reverse`
3. Remember: content pages inherit `type: docs` from cascade
**Solution**: Move or create RSS template at `layouts/index.rss.xml`
**Symptoms**: New briefings don't appear after deployment
**Diagnosis**:
1. Check GitHub Actions logs for `update-source-news.sh` step
2. Verify `sync-news.sh` output shows expected date processing
3. Confirm Hugo build shows correct page count in build output (look for "Pages │ XX")
**Solution**: Re-run content sync scripts or check source repository update status
**Symptoms**: Build fails with "module not found" for Hextra theme
**Requirements**:
**Solution**: Hugo automatically downloads modules on first build if above requirements are met
```
layouts/
├── index.rss.xml # Homepage RSS feed (CRITICAL: exact path required)
├── _default/
│ ├── list.markdown # Markdown output format
│ └── single.markdown
├── partials/
│ └── custom-head.html # GA4 + AdSense injection
└── shortcodes/ # Custom Hugo shortcodes
```
These directories are generated and should NOT be committed:
GitHub Actions triggers on:
Build produces two independent artifacts:
1. **site-worker** → Deployed to Cloudflare Workers
2. **pages artifact** → Deployed to GitHub Pages
Both use the same Hugo source but different base URLs.
From `hugo.toml`:
When working with this codebase:
1. **Never commit generated content**: Always check that changes to `content/` or `source-news/` are not staged for commit
2. **Use sync scripts**: Don't manually edit files in `content/` - they will be overwritten. Modify source data or sync scripts instead
3. **RSS template location**: If fixing RSS issues, always use `layouts/index.rss.xml`, never `_default/rss.xml`
4. **Test locally first**: Run `bash .github/scripts/dev.sh` before suggesting deployment changes
5. **Dual deployment awareness**: Remember that changes affect both Cloudflare Workers and GitHub Pages builds
6. **Hugo version**: Ensure Hugo extended ≥ 0.150.0 for all build operations
7. **Content sync modes**: Use `--mode=auto` for most cases, `--mode=full` for major structural changes, `--mode=incremental` with `--dates` for targeted updates
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/aiheadline-news-hugo-site-manager/raw