mirror of
https://github.com/tiennm99/blog.git
synced 2026-10-11 03:13:10 +00:00
3.9 KiB
3.9 KiB
AGENTS.md
This file provides guidance to AI code assistants when working with this Hugo-based blog repository (miti99.com).
Project Overview
- Type: Hugo static site blog with Vietnamese content
- Theme: hugo-theme-stack
- Focus: Technology newsletters, programming tutorials, technical insights
- Language: Vietnamese (with English technical terms where appropriate)
- Timezone: Asia/Ho_Chi_Minh (UTC+7)
Quick Commands
hugo server --gc # Local development
hugo --gc --minify # Production build
Directory Structure
content/
└── post/
└── YYYY/
└── MM/
└── DD/
├── index.md # Blog post content
└── data/ # Data files
Note on Assets: Images and documents from external sources should be referenced directly from their original locations rather than downloaded into subfolders. The only exception is for images or documents that are created by yourself, which can be stored in the appropriate directories.
URL Processing Workflow
1. URL Processing
- Clean URL: Remove tracking params (utm_*, fbclid, etc.)
- Verify: Check if URL is accessible (HTTP 200)
- Extract:
- For articles: Get title and content (don't download assets)
- For assets: Identify type for bonus section
- Check duplicates: Skip if already covered
- Skip if: Inaccessible or duplicate
2. Newsletter Management
- Get date: Current date (YYYY-MM-DD)
- Check existing:
content/post/YYYY/MM/DD/index.md - If exists: Append before bonus sections
- If new: Create with auto-incremented number
3. Content Structure
New Newsletter Template
---
title: "Newsletter #[number]"
date: YYYY-MM-DD
tags: ["AI-Assisted", "Technology", "tag-3", "tag-4"]
categories: ["Newsletter"]
---
*Mời bạn thưởng thức Newsletter #[number].*
## [Original Article Title](clean_url)
[Vietnamese summary: 2-4 paragraphs]
**Điểm chính:**
- [Key point 1]
- [Key point 2]
- [Key point 3]
Bonus Content Section
For direct asset links (.png, .jpg, .pdf, .docx):
### Bonus Resources
- [Image: Description](image_url)
- [Document: Description](document_url)
Vietnamese Writing Guidelines
- Primary: Vietnamese
- English for: Tech names, acronyms, code, common terms
- Audience: Junior developers
- Tone: Professional but accessible
- Length: 150-300 words per summary
Tagging Guidelines
- Required: "AI-Assisted"
- Maximum: 6-7 tags
- Categories: Always ["Newsletter"]
Quality Checklist
- Valid Hugo front matter
- Correct Vietnamese grammar
- Clean URLs
- Proper markdown
- Date format: YYYY-MM-DD
- Required tags present
- Sequential newsletter number
- Correct directory structure
Error Handling
| Issue | Solution |
|---|---|
| URL inaccessible | Skip and notify |
| Duplicate content | Skip and notify |
| Date error | Use current date |
| Directory failed | Create and retry |
| Extraction failed | Use title, flag |
Response Format
✅ Newsletter Processing Complete
📄 File: content/post/YYYY/MM/DD/index.md
📊 Action: [Created new | Updated existing] Newsletter #[number]
🔗 URLs processed: [count]
⚠️ Skipped: [count] (reason)
Next steps: Review content and publish when ready.
Best Practices for Code Agents
- Always verify file paths before making changes
- Follow established directory structure
- Maintain consistency with existing content
- Test locally using
hugo server --gc(optional) - Preserve front matter structure in markdown files
- Use relative paths for internal links and assets
- Check Vietnamese grammar and diacritics
- Validate markdown syntax before saving
- Handle assets properly: Use external links for user-provided assets, do not embed assets from articles