|
1 | 1 | # Preparing for a New Calendar Year |
2 | 2 |
|
3 | | -Run the following script: |
| 3 | +Run the following steps once the previous December's articles are complete |
| 4 | +(typically in January or February): |
| 5 | + |
| 6 | +## 1. Archive the previous year |
| 7 | + |
| 8 | +Add the previous year's topics to `archives.yaml`: |
| 9 | + |
| 10 | +```bash |
| 11 | +./year2yaml YYYY |
| 12 | +``` |
| 13 | + |
| 14 | +For example, after the 2025 calendar: |
| 15 | + |
| 16 | +```bash |
| 17 | +./year2yaml 2025 |
| 18 | +``` |
| 19 | + |
| 20 | +`year2yaml` reads the `Topic:` header from each article and appends a new |
| 21 | +section to `archives.yaml`. Entries are classified as `module` (linked to |
| 22 | +MetaCPAN) when the topic name contains `::`, and as `topic` otherwise. |
| 23 | +Single-word CPAN modules without `::` in their name (e.g. `LWP`, `Moose`) |
| 24 | +will be classified as `topic` — edit `archives.yaml` by hand afterwards if |
| 25 | +you want those to carry a MetaCPAN link. |
| 26 | + |
| 27 | +Comma-separated topics on a single `Topic:` line are split into individual |
| 28 | +entries automatically. Space-separated module names are also split, provided |
| 29 | +every space-delimited token contains `::`. |
| 30 | + |
| 31 | +## 2. Prepare the new year's scaffold |
4 | 32 |
|
5 | 33 | ```bash |
6 | 34 | ./script/prepare-new-year.sh |
7 | 35 | ``` |
| 36 | + |
| 37 | +This script: |
| 38 | + |
| 39 | +* Creates `YYYY/advent.ini` (copied from the previous year with the year |
| 40 | + updated throughout) |
| 41 | +* Updates year references in `in-season.html`, `README.md`, |
| 42 | + `.github/pull_request_template.md`, `script/build-site.sh`, and |
| 43 | + `script/stats.sh` |
| 44 | + |
| 45 | +After the script runs, create the empty directories that the build system |
| 46 | +expects and add `.gitkeep` files so they are tracked by git: |
| 47 | + |
| 48 | +```bash |
| 49 | +NEW_YEAR=$(date +%Y) |
| 50 | +mkdir -p "$NEW_YEAR/articles" "$NEW_YEAR/incoming" "$NEW_YEAR/share/static" |
| 51 | +touch "$NEW_YEAR/articles/.gitkeep" \ |
| 52 | + "$NEW_YEAR/incoming/.gitkeep" \ |
| 53 | + "$NEW_YEAR/share/static/.gitkeep" |
| 54 | +``` |
| 55 | + |
| 56 | +## 3. Review and commit |
| 57 | + |
| 58 | +Check the updated files, then commit everything: |
| 59 | + |
| 60 | +```bash |
| 61 | +git add archives.yaml year2yaml \ |
| 62 | + "$NEW_YEAR/" \ |
| 63 | + in-season.html README.md \ |
| 64 | + .github/pull_request_template.md \ |
| 65 | + script/build-site.sh script/stats.sh |
| 66 | +git commit -m "chore: archive PREV_YEAR and prepare scaffold for NEW_YEAR" |
| 67 | +``` |
0 commit comments