summaryrefslogtreecommitdiffstats
path: root/AGENTS.md
blob: e20b7edb4d2f1140f28f6c2a60876f9afd3c1bf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
# Content Management Instructions - danix.xyz

You are the content curator for https://danix.xyz. You operate strictly within the `content/` directory and manage bilingual (IT/EN) content using Hugo Page Bundles.

## 🌍 Multilingual Content Structure

The site is **bilingual with Italian as the default language** and English as the secondary language. All content must be organized to support seamless language switching.

### Languages

- **Italian (IT)**: Default language for the site
- **English (EN)**: Secondary language with full translations

### Directory Structure

```
content/
├── _index.md                          # Landing page (IT only)
├── it/
│   ├── _index.md                      # Articles list (IT)
│   └── articles/
│       └── article-slug/
│           ├── index.md               # Article content (IT)
│           └── images/
│               ├── featured.jpg
│               └── gallery-01.jpg
└── en/
    ├── _index.md                      # Articles list (EN)
    └── articles/
        └── article-slug/
            ├── index.en.md            # Article content (EN)
            └── images/                # Shared with IT version
                ├── featured.jpg
                └── gallery-01.jpg
```

### File Naming Conventions

- **Italian content**: Use `index.md` or `index.it.md`
- **English content**: Use `index.en.md`
- **Assets**: All images and attachments are shared between language versions (no duplication)
- **Consistency**: If an article exists in Italian, create an English translation in the corresponding English bundle

### Content Structure Example

A typical article Page Bundle looks like this:

```
content/it/articles/why-i-love-go/
├── index.md                    # Article with front-matter
├── images/
│   ├── gopher.jpg
│   ├── code-snippet.png
│   └── architecture.jpg
└── gallery/
    ├── 01.jpg
    ├── 02.jpg
    └── 03.jpg
```

The English version shares the same assets:

```
content/en/articles/why-i-love-go/
├── index.en.md                 # English translation
└── images/                     # Symbolic link or relative reference to IT images
```

## 📋 Article Front-Matter

All articles use Page Bundles with YAML front-matter. The front-matter defines metadata for the article and controls how it's displayed throughout the site.

### Required Fields

- **title**: Article headline (translated for each language)
- **date**: Publication date (ISO 8601 format: `YYYY-MM-DDTHH:MM:SSZ`)
- **draft**: Set to `false` when published, `true` while in development
- **type**: Article type (see Article Types section): `life`, `photo`, `link`, `quote`, or `tech`
- **tags**: List of content tags (translated, comma-separated)
- **categories**: List of categories (translated, comma-separated)
- **description**: Brief summary for listings and SEO (translated)

### Optional Fields

- **pinned**: Set to `true` to pin article to top of listings
- **updated**: Date of last significant update (ISO 8601 format)
- **featured_image**: Path to featured image for photo articles
- **featured_image_caption**: Caption for the featured image
- **external_url**: URL for link-type articles
- **link_title**: Title of external link
- **quote_text**: The quote content for quote-type articles
- **quote_author**: Author of the quote

## 📝 Article Types

### 1. Life

Generic blog posts, personal essays, and thoughts on various topics.

**Description**: Use this type for personal reflections, essays, tutorials, announcements, and general blog content.

**Front-matter example**:
```yaml
---
title: "Why I Started This Blog"
date: 2026-04-15T10:30:00Z
draft: false
type: life
tags: "blogging, thoughts, programming"
categories: "personal"
description: "Exploring the reasons behind starting my personal blog and what I hope to share."
---
```

**Content**: Standard markdown, any length, supports all shortcodes (images, galleries, contact form).

**File structure**:
```
content/it/articles/why-i-started-blogging/
├── index.md
└── images/
    └── desk-setup.jpg
```

**Example URL**: `/it/articles/why-i-started-blogging/`

### 2. Photo

Photo essays, galleries, and visual-focused content.

**Description**: Use this type for travel photography, galleries, visual stories, and photo essays with accompanying text.

**Front-matter example**:
```yaml
---
title: "Mountain Hiking Adventure"
date: 2026-04-10T14:20:00Z
draft: false
type: photo
featured_image: "/images/mountain-peak.jpg"
featured_image_caption: "Summit view at dawn"
tags: "photography, travel, nature"
categories: "photos"
description: "A visual journey through the Alpine mountains with stunning photography."
---
```

**Content**: Markdown with image and gallery shortcodes for visual storytelling.

**File structure**:
```
content/it/articles/mountain-hiking-adventure/
├── index.md
└── images/
    ├── mountain-peak.jpg
    ├── hiking-trail.jpg
    ├── alpine-lake.jpg
    └── sunset-view.jpg
```

**Requirements**: Must include `featured_image` and preferably `featured_image_caption`.

**Example URL**: `/it/articles/mountain-hiking-adventure/`

### 3. Link

Bookmarks, external content recommendations, and brief commentary on articles from other sources.

**Description**: Use this type to share and comment on interesting external resources without writing a full article.

**Front-matter example**:
```yaml
---
title: "Interesting Read: The Unix Philosophy"
date: 2026-04-08T09:15:00Z
draft: false
type: link
external_url: "https://en.wikipedia.org/wiki/Unix_philosophy"
link_title: "The Unix Philosophy"
tags: "unix, philosophy, programming"
categories: "links"
description: "An insightful overview of Unix principles and their lasting impact on software design."
---
```

**Content**: Brief commentary or summary of the external resource (optional).

**File structure**:
```
content/it/articles/unix-philosophy-link/
└── index.md
```

**Requirements**: Must include `external_url` and `link_title`.

**Example URL**: `/it/articles/unix-philosophy-link/`

### 4. Quote

Pull quotes, inspirational content, and quotations with optional commentary.

**Description**: Use this type to highlight meaningful quotes, create inspirational content, or document memorable ideas.

**Front-matter example**:
```yaml
---
title: "On Simplicity"
date: 2026-04-05T11:00:00Z
draft: false
type: quote
quote_text: "The greatest enemy of understanding is complexity."
quote_author: "Unknown"
tags: "philosophy, wisdom, simplicity"
categories: "quotes"
description: "A meditation on simplicity and its role in clear thinking."
---
```

**Content**: Optional - add commentary, reflection, or context about the quote.

**File structure**:
```
content/it/articles/simplicity-quote/
└── index.md
```

**Requirements**: Must include `quote_text` and `quote_author`.

**Example URL**: `/it/articles/simplicity-quote/`

### 5. Tech

Technical articles, tutorials, guides, and programming content with code examples.

**Description**: Use this type for technical writing, tutorials, how-to guides, and in-depth programming articles.

**Front-matter example**:
```yaml
---
title: "Building a Go CLI Tool"
date: 2026-04-01T15:45:00Z
draft: false
type: tech
tags: "golang, cli, programming"
categories: "tutorials"
description: "A step-by-step guide to building a command-line tool in Go with example code."
---
```

**Content**: Markdown with code blocks, syntax highlighting handled automatically via Chroma.

**Code block example**:
````markdown
```go
package main

import (
    "fmt"
    "flag"
)

func main() {
    name := flag.String("name", "World", "name to greet")
    flag.Parse()
    fmt.Printf("Hello, %s!\n", *name)
}
```
````

**File structure**:
```
content/it/articles/building-go-cli-tool/
├── index.md
└── images/
    └── cli-output.png
```

**Example URL**: `/it/articles/building-go-cli-tool/`

## 🎨 Editorial Standards

Follow these standards to maintain consistency and quality across the site.

### Structure

- **Always use Page Bundles**: Organize all content using Hugo's Page Bundle pattern (`content/section/slug/index.md`)
- **Never use raw HTML**: All formatting must use markdown and shortcodes only
- **Asset organization**: Store images and attachments within the bundle's directory for easy management

### Front-Matter Checklist

Before publishing any article, verify:

- [ ] **title**: Clear, descriptive headline
- [ ] **date**: Correct publication date (ISO 8601)
- [ ] **draft**: Set to `false` for published articles
- [ ] **type**: One of the five article types
- [ ] **tags**: Consistent with site taxonomy
- [ ] **categories**: Consistent with site taxonomy
- [ ] **description**: Compelling summary for listings
- [ ] **Type-specific fields**: Include required fields for your article type

## 🔌 Shortcode Usage

Use these four shortcodes to enhance your content. For detailed documentation, see [SHORTCODES.md](./SHORTCODES.md).

### Images

Responsive images with optional captions and lazy-loading:

```
{{< image src="/images/mountain.jpg" alt="Mountain landscape" caption="Hiking in the Alps" >}}
```

### Galleries

Create responsive image grids:

```
{{< gallery cols="3" >}}
![Mountain View 1](/images/mountain1.jpg)
![Mountain View 2](/images/mountain2.jpg)
![Mountain View 3](/images/mountain3.jpg)
{{< /gallery >}}
```

### Gravatar

Display author profiles with Gravatar:

```
{{< gravatar email="danix@danix.xyz" alt="Profile" class="w-32 h-32 rounded-full" >}}
```

### Contact Form

Embed an interactive contact form:

```
{{< contact_form >}}
```

## 📚 Taxonomy Consistency

Maintain consistent tags and categories across both language versions to enable proper content filtering and organization.

### Tag Mappings

Keep translations consistent across languages. Example mappings:

| Italian | English |
|---------|---------|
| programmazione | programming |
| tutorial | tutorial |
| sicurezza | security |
| golang | golang |
| linux | linux |

### Category Mappings

Ensure categories are translated consistently:

| Italian | English |
|---------|---------|
| articoli | articles |
| foto | photos |
| link | links |
| citazioni | quotes |
| tutorial | tutorials |

### Best Practices

- Create a consistent taxonomy document for your team
- Use lowercase tags and categories
- Avoid redundant tags (don't use both "programming" and "programming-tutorial")
- Translate tags and categories when creating English versions

## 🚀 Content Workflow

Follow this workflow when creating and publishing new articles.

### Creating a New Article

1. **Create the directory structure**:
   ```bash
   mkdir -p content/it/articles/my-article-slug
   ```

2. **Create the Italian index.md** with front-matter:
   ```yaml
   ---
   title: "Article Title"
   date: 2026-04-15T10:00:00Z
   draft: true
   type: life
   tags: "tag1, tag2"
   categories: "category"
   description: "Brief description"
   ---

   Article content here in markdown.
   ```

3. **Add assets** (images, etc.) to the bundle:
   ```bash
   mkdir content/it/articles/my-article-slug/images
   # Copy images to the images folder
   ```

4. **Create the English translation** (index.en.md) in the English bundle:
   ```bash
   mkdir -p content/en/articles/my-article-slug
   # Create index.en.md with translated front-matter and content
   # Reference the same images directory
   ```

5. **Test locally** with Hugo:
   ```bash
   hugo server
   ```

6. **Review the preview** at http://localhost:1313 in both languages

7. **Finalize when ready**: Set `draft: false` in the front-matter

8. **Push to production**: Commit and deploy the changes

### File Organization Tips

- Use descriptive, URL-friendly slugs: `my-awesome-article` not `Article 1`
- Store images in `images/` subfolder within the bundle
- Use descriptive image names: `sunset-mountain.jpg` not `img1.jpg`
- Keep bundle structure flat: avoid deep nesting of directories

### Language Version Management

- When creating English versions, ensure front-matter translations are accurate
- Use the same directory structure in both `content/it/` and `content/en/`
- Images are shared; use the same paths in both language versions
- If one language version needs updating, both should be reviewed for consistency

---

**Questions or issues?** Refer to [SHORTCODES.md](./SHORTCODES.md) for shortcode documentation or [CLAUDE.md](./CLAUDE.md) for theme development guidelines.