|
| 1 | +--- |
| 2 | +name: publish-and-test-article |
| 3 | +description: >- |
| 4 | + Packages a supplied Markdown draft as a Jekyll post, adds publication |
| 5 | + metadata and assets, previews it locally, and tests its catalogue and article |
| 6 | + pages at desktop and mobile sizes. Use after an article draft is approved or |
| 7 | + when the user asks to publish, preview, or test an article locally. |
| 8 | +--- |
| 9 | + |
| 10 | +# Publish and Test Article |
| 11 | + |
| 12 | +Turn approved content into a locally verified Jekyll post. This workflow owns publication packaging and testing, not article drafting. |
| 13 | + |
| 14 | +Canonical example: `_posts/2017-03-10-we-are-all-product-designers.md`. |
| 15 | + |
| 16 | +## Checklist |
| 17 | + |
| 18 | +```text |
| 19 | +- [ ] Identify the approved draft |
| 20 | +- [ ] Agree date, slug, title, and context |
| 21 | +- [ ] Create the post and publication assets |
| 22 | +- [ ] Build and serve the site locally |
| 23 | +- [ ] Verify the catalogue card and article page |
| 24 | +- [ ] Inspect desktop and mobile screenshots |
| 25 | +- [ ] Perform a fresh editorial review |
| 26 | +- [ ] Fix approved findings and retest |
| 27 | +- [ ] Present the overview and article screenshots to the author |
| 28 | +- [ ] Obtain the author's explicit visual approval |
| 29 | +- [ ] Report the result and offer to commit and push |
| 30 | +``` |
| 31 | + |
| 32 | +## 1. Identify the content |
| 33 | + |
| 34 | +Use the draft named by the user. Otherwise, use the draft created or approved in the current work; if that is ambiguous, ask. |
| 35 | + |
| 36 | +Read the complete draft and any source material needed to package it correctly. Do not invent or substantially rewrite article prose. Ask the author about missing content or editorial decisions. |
| 37 | + |
| 38 | +Before changing files, preserve the user's work. Do not pull, reset, clean, commit, push, or deploy as part of local publishing and testing. |
| 39 | + |
| 40 | +## 2. Agree the publication details |
| 41 | + |
| 42 | +Determine from the draft and conversation, or ask only for what cannot be inferred: |
| 43 | + |
| 44 | +- publication date |
| 45 | +- filename slug |
| 46 | +- final title |
| 47 | +- context label, normally `Essay` |
| 48 | +- catalogue image or approved image concept |
| 49 | + |
| 50 | +The working `#` heading normally supplies the final title. Confirm a material title change with the author. |
| 51 | + |
| 52 | +The destination is `_posts/YYYY-MM-DD-kebab-slug.md`. The filename date supplies the post date; the filename slug may differ from the displayed title. |
| 53 | + |
| 54 | +## 3. Prepare assets |
| 55 | + |
| 56 | +Put post-specific assets in `assets/article_images/YYYY-MM-DD-kebab-slug/`. Shared talk thumbnails may remain in `assets/article_images/talks/`. Use site-root paths beginning with `/assets/` inside the post. |
| 57 | + |
| 58 | +Prefer a purposeful diagram or original visual that strengthens the article. If the draft has no approved image: |
| 59 | + |
| 60 | +1. Propose one image concept based on the central idea. |
| 61 | +2. Ask the author to approve or revise it. |
| 62 | +3. Create or source the image only after approval. |
| 63 | +4. Check generated text, licensing where relevant, catalogue-thumbnail legibility, and real pixel dimensions. |
| 64 | + |
| 65 | +For a fallback generated image, use `assets/article_images/talks/how-to-become-a-thought-leader.jpg` as the visual style reference when supported. Aim for a wide 16:9 abstract editorial image with a near-black navy background, a centred technical composition, restrained cyan, teal, and emerald light, high contrast, and generous negative space. Avoid people, logos, UI panels, stock-photo elements, watermarks, and clutter. |
| 66 | + |
| 67 | +Add a separate in-body image only when it contributes to the article: |
| 68 | + |
| 69 | +```markdown |
| 70 | + |
| 71 | +``` |
| 72 | + |
| 73 | +## 4. Create the Jekyll post |
| 74 | + |
| 75 | +Create the destination post from the approved draft, retaining the source draft until verification succeeds. |
| 76 | + |
| 77 | +1. Remove the draft's `#` title because the post layout renders the front matter title. |
| 78 | +2. Preserve the body as Markdown. |
| 79 | +3. Add front matter using real values: |
| 80 | + |
| 81 | +```yaml |
| 82 | +--- |
| 83 | +published: true |
| 84 | +layout: post |
| 85 | +image: /assets/article_images/YYYY-MM-DD-kebab-slug/hero.png |
| 86 | +image_width: 1400 |
| 87 | +image_height: 788 |
| 88 | +title: A short, specific title |
| 89 | +context: Essay |
| 90 | +--- |
| 91 | +``` |
| 92 | + |
| 93 | +`image` supplies the catalogue thumbnail, `title` supplies the displayed heading and permalink title segment, and optional `context` appears next to the date. Always use the real image dimensions. |
| 94 | + |
| 95 | +Use `##` for article sections and `###` for subsections. Use `{% include name.html %}` only for supplied slide decks or other HTML bodies in `_includes/`; full articles should normally remain Markdown. |
| 96 | + |
| 97 | +The homepage catalogue uses roughly the first 30 words of body content. Keep the TL;DR near the start and use `excerpt_separator` only when the automatic excerpt is unsuitable. |
| 98 | + |
| 99 | +The generated permalink follows `/:year-:month-:day/:title`; do not assume the filename slug is the URL. |
| 100 | + |
| 101 | +## 5. Build and serve |
| 102 | + |
| 103 | +Run `bundle install` when dependencies are missing or stale. If Bundler rejects the lockfile's `BUNDLED WITH` version, update only that line to the installed Bundler version and retry. |
| 104 | + |
| 105 | +Build once before serving so compilation failures are explicit: |
| 106 | + |
| 107 | +```bash |
| 108 | +RUBYOPT="-r$(pwd)/_plugins/taint_compat.rb" bundle exec jekyll build |
| 109 | +``` |
| 110 | + |
| 111 | +Ruby 3.4 removed `tainted?`, which Liquid still calls. Expect `[taint_compat] Applied to Object`. |
| 112 | + |
| 113 | +Reuse a healthy server on port 4000. Otherwise start: |
| 114 | + |
| 115 | +```bash |
| 116 | +RUBYOPT="-r$(pwd)/_plugins/taint_compat.rb" bundle exec jekyll serve \ |
| 117 | + --host 127.0.0.1 --port 4000 --livereload |
| 118 | +``` |
| 119 | + |
| 120 | +Confirm the catalogue URL and article URL return HTTP 200. Treat build warnings, Liquid errors, missing includes, and failed local asset requests as findings. |
| 121 | + |
| 122 | +## 6. Test the catalogue overview |
| 123 | + |
| 124 | +Determine which paginated catalogue page contains the post after building. Verify the target card: |
| 125 | + |
| 126 | +- title, date, context, and excerpt are correct and readable |
| 127 | +- the card links to the expected article URL |
| 128 | +- the catalogue image loads, crops as intended, and does not distort the layout |
| 129 | +- spacing, alignment, and neighbouring cards remain sound |
| 130 | +- nothing overflows at desktop or mobile width |
| 131 | + |
| 132 | +## 7. Test the article page |
| 133 | + |
| 134 | +Verify: |
| 135 | + |
| 136 | +- title, date, context, headings, paragraphs, lists, links, code, embeds, and includes render correctly |
| 137 | +- images load, are correctly positioned, have useful alt text, and work at both viewport sizes |
| 138 | +- navigation and previous/next links work |
| 139 | +- there is no clipping, horizontal scrolling, overlap, or unreadably small content |
| 140 | + |
| 141 | +Do not silently compensate for a layout defect. Record unsupported template behaviour clearly. |
| 142 | + |
| 143 | +## 8. Capture and inspect screenshots |
| 144 | + |
| 145 | +Write screenshots under `.screenshots/publish-and-test-article/<post-slug>/`: |
| 146 | + |
| 147 | +```text |
| 148 | +overview-desktop.png |
| 149 | +overview-mobile.png |
| 150 | +article-desktop.png |
| 151 | +article-mobile.png |
| 152 | +``` |
| 153 | + |
| 154 | +Use a 1440×900 desktop viewport and a 390×844 mobile viewport. Read and visually inspect all four screenshots; creating files alone is not verification. Capture additional focused screenshots when important content falls below the initial viewport. |
| 155 | + |
| 156 | +Present all four screenshots to the author in the conversation, clearly identifying: |
| 157 | + |
| 158 | +- the catalogue overview at desktop size |
| 159 | +- the catalogue overview at mobile size |
| 160 | +- the article at desktop size |
| 161 | +- the article at mobile size |
| 162 | + |
| 163 | +Do not merely report their file paths. The author must be able to see both the overview and article before approving publication. If a fix changes either page, recapture, inspect, and present the affected screenshots again. |
| 164 | + |
| 165 | +## 9. Review the article afresh |
| 166 | + |
| 167 | +Once the article renders reliably, review the complete piece without relying on earlier approvals. Check: |
| 168 | + |
| 169 | +- whether the title, opening, argument, examples, transitions, and conclusion form a coherent whole |
| 170 | +- whether claims are accurate, appropriately qualified, and supported |
| 171 | +- repetition, gaps, contradictions, unclear references, awkward phrasing, grammar, and typos |
| 172 | +- links, captions, image relevance, alt text, front matter, and the catalogue excerpt |
| 173 | + |
| 174 | +Separate objective defects from optional editorial suggestions. Fix clear packaging defects and retest. Obtain approval before changing previously approved prose, article meaning, or visual direction. |
| 175 | + |
| 176 | +## 10. Obtain visual approval |
| 177 | + |
| 178 | +After the checks and approved fixes pass, ask the author to review the presented overview and article screenshots. Wait for explicit approval or requested changes. |
| 179 | + |
| 180 | +Do not offer to commit or push while screenshot approval is pending. If the author requests changes, apply the approved changes, rebuild, retest, and present updated screenshots for another review. |
| 181 | + |
| 182 | +## 11. Complete the local workflow |
| 183 | + |
| 184 | +Only after the author explicitly approves the screenshots: |
| 185 | + |
| 186 | +1. Remove the source file from `_drafts/` so the verified post is the single canonical copy. |
| 187 | +2. Report whether the build and local preview passed. |
| 188 | +3. List blocking defects, visual findings, editorial findings, passed checks, local URLs, and screenshot paths. |
| 189 | +4. Report any unresolved issues. |
| 190 | +5. Ask: “The article has been published and tested locally. Would you like me to commit and push it to GitHub?” |
| 191 | + |
| 192 | +Never commit or push without both screenshot approval and explicit approval to perform the Git operations. |
0 commit comments