mirror of
https://github.com/tiennm99/miti99.git
synced 2026-08-14 02:23:04 +00:00
feat: remove unused rules
keep only cursor and windsurf, because others not good enough
This commit is contained in:
@@ -1,124 +0,0 @@
|
||||
---
|
||||
applyTo: "*.md"
|
||||
---
|
||||
# Newsletter URL Processor
|
||||
|
||||
## Description
|
||||
This rule processes URLs to create or update newsletter posts. When a single URL is provided, it will either create a new newsletter post or append to an existing one. The rule ensures consistent formatting and high-quality content in Vietnamese.
|
||||
|
||||
## Trigger
|
||||
- When a single URL is provided in the message
|
||||
- When multiple URLs are provided in sequence
|
||||
|
||||
## Actions
|
||||
1. URL Processing:
|
||||
- Remove tracking parameters (utm_source, ref, etc.)
|
||||
- Clean and preserve base URL
|
||||
- Extract original article title
|
||||
- Verify URL accessibility
|
||||
- Check for duplicate articles in existing newsletters
|
||||
|
||||
2. Newsletter Creation/Update:
|
||||
- Check for existing newsletter file for current date using one of these methods:
|
||||
```powershell
|
||||
# Method 1: Using Get-Date with explicit format
|
||||
Get-Date -Format "yyyy-MM-dd"
|
||||
|
||||
# Method 2: Using .NET DateTime directly
|
||||
[DateTime]::Now.ToString("yyyy-MM-dd")
|
||||
|
||||
# Method 3: Using date command (if PowerShell fails)
|
||||
date +%Y-%m-%d
|
||||
```
|
||||
- If exists: append new content
|
||||
- If not: create new file with proper structure
|
||||
- Auto-increment newsletter number based on latest existing newsletter
|
||||
|
||||
3. Content Structure:
|
||||
```markdown
|
||||
---
|
||||
title: "Newsletter #[number]"
|
||||
date: [current date using one of the above methods]
|
||||
tags: [ "AI-Assisted", [additional relevant tags] ]
|
||||
categories: [ "Newsletter" ]
|
||||
---
|
||||
|
||||
*Mời bạn thưởng thức Newsletter #[number].*
|
||||
|
||||
## [Original Article Title](mdc:clean_url)
|
||||
|
||||
[Vietnamese summary in professional tone]
|
||||
|
||||
[Optional bullet points for key takeaways]
|
||||
|
||||
[New content URLs and summaries should be added before any bonus sections]
|
||||
```
|
||||
|
||||
4. File Location:
|
||||
- Store in: content/post/YYYY/MM/DD/index.md
|
||||
- Use one of the date methods above for date formatting
|
||||
- Create directory structure if not exists
|
||||
|
||||
## Content Guidelines
|
||||
1. Vietnamese Summaries:
|
||||
- Write in professional, clear Vietnamese
|
||||
- Keep technical terms in English when appropriate
|
||||
- Maintain consistent tone throughout
|
||||
- Length: 2-4 paragraphs for main content
|
||||
- Include key takeaways in bullet points when relevant
|
||||
|
||||
2. Tagging:
|
||||
- Always include "AI-Assisted" tag
|
||||
- Add relevant technical tags (e.g., "Development", "Architecture", "Java")
|
||||
- Use consistent tag naming across newsletters
|
||||
- Maximum 5 tags per newsletter
|
||||
|
||||
3. Formatting:
|
||||
- Use proper markdown syntax
|
||||
- Maintain consistent heading levels
|
||||
- Include proper spacing between sections
|
||||
- Use bullet points for lists
|
||||
- Keep URLs clean and readable
|
||||
|
||||
## Quality Checks
|
||||
1. Content:
|
||||
- Verify URL accessibility
|
||||
- Check for duplicate articles
|
||||
- Ensure proper date formatting
|
||||
- Validate markdown syntax
|
||||
- Maintain consistent formatting
|
||||
- Check Vietnamese language quality
|
||||
- Verify all links are working
|
||||
|
||||
2. Technical:
|
||||
- Validate front matter format
|
||||
- Check directory structure
|
||||
- Verify newsletter number sequence
|
||||
- Ensure proper file naming
|
||||
- Validate date format consistency
|
||||
|
||||
## Example
|
||||
Input: https://example.com/article?utm_source=twitter
|
||||
Output: Creates or updates newsletter post with:
|
||||
- Clean URL: https://example.com/article
|
||||
- Vietnamese summary
|
||||
- Proper front matter
|
||||
- Correct file location
|
||||
- Appropriate tags
|
||||
|
||||
## Error Handling
|
||||
- If URL is inaccessible: Skip and notify
|
||||
- If duplicate found: Skip and notify
|
||||
- If date format invalid: Use current date
|
||||
- If directory creation fails: Notify and abort
|
||||
- If markdown validation fails: Fix and retry
|
||||
|
||||
## Date Handling Troubleshooting
|
||||
If the primary date method fails, try these alternatives in order:
|
||||
1. Use .NET DateTime directly: `[DateTime]::Now.ToString("yyyy-MM-dd")`
|
||||
2. Use date command: `date +%Y-%m-%d`
|
||||
3. Use JavaScript Date object: `new Date().toISOString().split('T')[0]`
|
||||
4. Use Python datetime: `python -c "from datetime import datetime; print(datetime.now().strftime('%Y-%m-%d'))"`
|
||||
|
||||
|
||||
Note: Always verify the date format matches the required "yyyy-MM-dd" pattern before using it in the newsletter.
|
||||
@@ -1,139 +0,0 @@
|
||||
# Development Guidelines for miti99 Blog
|
||||
|
||||
This document provides guidelines and instructions for developing and maintaining the [miti99 blog](https://miti99.com).
|
||||
|
||||
## Build/Configuration Instructions
|
||||
|
||||
### Prerequisites
|
||||
|
||||
- [Hugo Extended](https://gohugo.io/installation/) v0.140.2 or later
|
||||
- Git (for version control and submodule management)
|
||||
|
||||
### Local Development Setup
|
||||
|
||||
1. **Clone the repository with submodules**:
|
||||
```bash
|
||||
git clone --recurse-submodules https://github.com/tiennm99/miti99.git
|
||||
cd miti99
|
||||
```
|
||||
|
||||
2. **Start the Hugo development server**:
|
||||
```bash
|
||||
hugo server -D
|
||||
```
|
||||
This will start a local development server at http://localhost:1313/ with live reload enabled.
|
||||
|
||||
3. **Build the site for production**:
|
||||
```bash
|
||||
hugo --minify
|
||||
```
|
||||
This will generate the static site in the `public/` directory.
|
||||
|
||||
### Configuration Files
|
||||
|
||||
The site configuration is split into multiple YAML files in the `config/_default/` directory:
|
||||
|
||||
- `hugo.yml` - Main Hugo configuration
|
||||
- `params.yml` - Site parameters
|
||||
- `menu.yml` - Navigation menu configuration
|
||||
- `markup.yml` - Content markup settings
|
||||
- `languages.yml` - Multilingual settings
|
||||
- And several other configuration files for specific features
|
||||
|
||||
### Docker Deployment
|
||||
|
||||
The project includes a Dockerfile for containerized deployment:
|
||||
|
||||
```bash
|
||||
# Build the Docker image
|
||||
docker build -t miti99-blog .
|
||||
|
||||
# Run the container
|
||||
docker run -p 80:80 miti99-blog
|
||||
```
|
||||
|
||||
## CI/CD Pipeline
|
||||
|
||||
The project uses GitHub Actions for CI/CD, defined in `.github/workflows/hugo.yml`:
|
||||
|
||||
1. **Build**: Builds the site using Hugo v0.140.2
|
||||
2. **Deploy to GitHub Pages**: Deploys the built site to GitHub Pages
|
||||
3. **Deploy to CloudFlare Pages**: Deploys the built site to CloudFlare Pages
|
||||
4. **Submit to IndexNow**: Submits the sitemap to search engines via IndexNow
|
||||
|
||||
The workflow uses caching to speed up builds and is triggered on pushes to the main branch.
|
||||
|
||||
## Content Management
|
||||
|
||||
### Creating Newsletter Posts
|
||||
|
||||
When creating newsletter posts:
|
||||
1. Create a new directory in `content/post/YYYY/MM/DD/` with an `index.md` file
|
||||
2. Format the post like previous newsletter files
|
||||
3. Front matter must include:
|
||||
- `title: "Newsletter #X"` (where X is the specific newsletter number, which increases with each new file)
|
||||
- `tags: [ "AI-Assisted", ... ]` (always include "AI-Assisted", can add other tags if needed)
|
||||
- `categories: [ "Newsletter" ]` (always use "Newsletter" as the only category)
|
||||
4. Start the post with: `*Mời bạn thưởng thức Newsletter \#X.*` (where X is the same number as in the title)
|
||||
5. Add links in the format: `## [original title](url)` (remove all metric parameters from URLs, but keep the exact original title as it appears in the blog post)
|
||||
6. After each link, add a Vietnamese description of the content
|
||||
7. Place images inside the `img` folder
|
||||
8. Place documentation files inside the `doc` folder
|
||||
|
||||
Example front matter for a newsletter:
|
||||
|
||||
```yaml
|
||||
---
|
||||
title: "Newsletter #15"
|
||||
date: 2025-05-15
|
||||
tags: [ "AI-Assisted" ]
|
||||
categories: [ "Newsletter" ]
|
||||
---
|
||||
```
|
||||
|
||||
### Handling URLs for Newsletter Posts
|
||||
|
||||
When receiving only a URL:
|
||||
1. Write an introduction in Vietnamese for the content linked by the URL
|
||||
2. The introduction should be in a professional style
|
||||
3. Common English words familiar to senior developers can be retained
|
||||
4. Create a newsletter post following these steps:
|
||||
- If a newsletter post file is already open, add the URL and introduction to that file
|
||||
- If no newsletter post file is open, create a new file with the current date
|
||||
- Format the post like previous newsletter files with proper front matter (see above)
|
||||
- Add the URL in the format: `## [original title](url)` (remove all metric parameters from URLs, but keep the exact original title as it appears in the blog post)
|
||||
- After the URL, add the Vietnamese description of the content
|
||||
5. Place images inside the `img` folder
|
||||
6. Place documentation files inside the `doc` folder
|
||||
|
||||
### Code Style and Conventions
|
||||
|
||||
- Post file name should be just `index.md`
|
||||
- Use YAML for front matter
|
||||
- Place images inside the `img` folder
|
||||
- Place documentation files inside the `doc` folder
|
||||
- Use relative links for internal content
|
||||
- Follow the Hugo content organization structure
|
||||
|
||||
## Additional Development Information
|
||||
|
||||
### Theme Customization
|
||||
|
||||
The site uses the [Hugo Theme Stack](https://github.com/CaiJimmy/hugo-theme-stack) as a Git submodule. To customize the theme:
|
||||
|
||||
1. **Override theme templates**: Create corresponding files in the `layouts/` directory
|
||||
2. **Override theme styles**: Create custom CSS in the `assets/scss/custom.scss` file
|
||||
3. **Override theme parameters**: Modify the `params.yml` configuration file
|
||||
|
||||
### Performance Optimization
|
||||
|
||||
- Use Hugo's image processing for responsive images
|
||||
- Minimize JavaScript and CSS with the `--minify` flag
|
||||
- Use Hugo's asset pipeline for bundling and fingerprinting
|
||||
- Enable HTTP/2 on your server for better performance
|
||||
|
||||
### Troubleshooting Common Issues
|
||||
|
||||
- **Submodule issues**: If the theme is missing, run `git submodule update --init --recursive`
|
||||
- **Build errors**: Check the Hugo version (should be v0.140.2 or later)
|
||||
- **Deployment issues**: Verify the GitHub Actions workflow has the correct permissions
|
||||
@@ -1,121 +0,0 @@
|
||||
# Newsletter URL Processor
|
||||
|
||||
## Description
|
||||
This rule processes URLs to create or update newsletter posts. When a single URL is provided, it will either create a new newsletter post or append to an existing one. The rule ensures consistent formatting and high-quality content in Vietnamese.
|
||||
|
||||
## Trigger
|
||||
- When a single URL is provided in the message
|
||||
- When multiple URLs are provided in sequence
|
||||
|
||||
## Actions
|
||||
1. URL Processing:
|
||||
- Remove tracking parameters (utm_source, ref, etc.)
|
||||
- Clean and preserve base URL
|
||||
- Extract original article title
|
||||
- Verify URL accessibility
|
||||
- Check for duplicate articles in existing newsletters
|
||||
|
||||
2. Newsletter Creation/Update:
|
||||
- Check for existing newsletter file for current date using one of these methods:
|
||||
```powershell
|
||||
# Method 1: Using Get-Date with explicit format
|
||||
Get-Date -Format "yyyy-MM-dd"
|
||||
|
||||
# Method 2: Using .NET DateTime directly
|
||||
[DateTime]::Now.ToString("yyyy-MM-dd")
|
||||
|
||||
# Method 3: Using date command (if PowerShell fails)
|
||||
date +%Y-%m-%d
|
||||
```
|
||||
- If exists: append new content
|
||||
- If not: create new file with proper structure
|
||||
- Auto-increment newsletter number based on latest existing newsletter
|
||||
|
||||
3. Content Structure:
|
||||
```markdown
|
||||
---
|
||||
title: "Newsletter #[number]"
|
||||
date: [current date using one of the above methods]
|
||||
tags: [ "AI-Assisted", [additional relevant tags] ]
|
||||
categories: [ "Newsletter" ]
|
||||
---
|
||||
|
||||
*Mời bạn thưởng thức Newsletter #[number].*
|
||||
|
||||
## [Original Article Title](mdc:clean_url)
|
||||
|
||||
[Vietnamese summary in professional tone]
|
||||
|
||||
[Optional bullet points for key takeaways]
|
||||
|
||||
[New content URLs and summaries should be added before any bonus sections]
|
||||
```
|
||||
|
||||
4. File Location:
|
||||
- Store in: content/post/YYYY/MM/DD/index.md
|
||||
- Use one of the date methods above for date formatting
|
||||
- Create directory structure if not exists
|
||||
|
||||
## Content Guidelines
|
||||
1. Vietnamese Summaries:
|
||||
- Write in professional, clear Vietnamese
|
||||
- Keep technical terms in English when appropriate
|
||||
- Maintain consistent tone throughout
|
||||
- Length: 2-4 paragraphs for main content
|
||||
- Include key takeaways in bullet points when relevant
|
||||
|
||||
2. Tagging:
|
||||
- Always include "AI-Assisted" tag
|
||||
- Add relevant technical tags (e.g., "Development", "Architecture", "Java")
|
||||
- Use consistent tag naming across newsletters
|
||||
- Maximum 5 tags per newsletter
|
||||
|
||||
3. Formatting:
|
||||
- Use proper markdown syntax
|
||||
- Maintain consistent heading levels
|
||||
- Include proper spacing between sections
|
||||
- Use bullet points for lists
|
||||
- Keep URLs clean and readable
|
||||
|
||||
## Quality Checks
|
||||
1. Content:
|
||||
- Verify URL accessibility
|
||||
- Check for duplicate articles
|
||||
- Ensure proper date formatting
|
||||
- Validate markdown syntax
|
||||
- Maintain consistent formatting
|
||||
- Check Vietnamese language quality
|
||||
- Verify all links are working
|
||||
|
||||
2. Technical:
|
||||
- Validate front matter format
|
||||
- Check directory structure
|
||||
- Verify newsletter number sequence
|
||||
- Ensure proper file naming
|
||||
- Validate date format consistency
|
||||
|
||||
## Example
|
||||
Input: https://example.com/article?utm_source=twitter
|
||||
Output: Creates or updates newsletter post with:
|
||||
- Clean URL: https://example.com/article
|
||||
- Vietnamese summary
|
||||
- Proper front matter
|
||||
- Correct file location
|
||||
- Appropriate tags
|
||||
|
||||
## Error Handling
|
||||
- If URL is inaccessible: Skip and notify
|
||||
- If duplicate found: Skip and notify
|
||||
- If date format invalid: Use current date
|
||||
- If directory creation fails: Notify and abort
|
||||
- If markdown validation fails: Fix and retry
|
||||
|
||||
## Date Handling Troubleshooting
|
||||
If the primary date method fails, try these alternatives in order:
|
||||
1. Use .NET DateTime directly: `[DateTime]::Now.ToString("yyyy-MM-dd")`
|
||||
2. Use date command: `date +%Y-%m-%d`
|
||||
3. Use JavaScript Date object: `new Date().toISOString().split('T')[0]`
|
||||
4. Use Python datetime: `python -c "from datetime import datetime; print(datetime.now().strftime('%Y-%m-%d'))"`
|
||||
|
||||
|
||||
Note: Always verify the date format matches the required "yyyy-MM-dd" pattern before using it in the newsletter.
|
||||
Reference in New Issue
Block a user