Widget
Widget Page
The Blacks template includes a promotion widget — a small block of content that appears on every article page across your site. Use it to highlight a service, feature a product, or promote a related post.
This is different from regular pages. You write it once, and it shows up everywhere.
Where Widgets Live
All promotion widgets live inside:
src/content/services/Each Markdown file in this folder becomes a promotion widget. You can have one, or many — the template decides how to display them based on your setup.
Create a New Promotion Widget
To create a new widget:
- Copy an existing Markdown file from
src/content/services/ - Rename it to match your service or promotion name
- Open it in your code editor
- Update the frontmatter and content
- Save it
The widget will automatically appear on article pages.
Frontmatter Format
Every promotion widget starts with a block of frontmatter — the section between the --- markers at the top of the file.
Frontmatter format:
---title: Title promotion widgetlink: URL Link for promotion widgetdescription: Description promotion widgetimage: URL image here...pubDate: input publish date---What each field does:
| Field | Purpose |
|---|---|
title | The widget’s display title |
link | The URL the widget points to (relative or absolute) |
description | A short summary shown under the title |
image | The widget’s cover image |
pubDate | The publication date. Format: YYYY-MM-DD. |
Full Implementation Example
Here is a complete promotion widget ready to use:
---title: Fashion Photographylink: fashiondescription: Capture your moment with fashion photography art.image: https://1.bp.blogspot.com/-WIXTfosQAto/YLd14DRL3iI/AAAAAAAAObM/yfqhdR62D_0NdLNvYsMV7Q9G8HFvWLpKwCLcBGAsYHQ/s2048/12890962_10206146031830731_8653409357574200403_o.jpgpubDate: 2023-11-28---Output — Widget view:
Output — Full article page with widget:
Tips for Using Promotion Widgets
- Keep the title short. Two to four words work best.
- Write a benefit-driven description. Not “Fashion Photography” — instead “Capture your moment with fashion photography art.”
- Use a compelling image. This is the first thing readers see.
- Point to something relevant. If the widget appears on a photography post, link to a photography service.
- Update regularly. A stale promotion widget loses impact. Rotate it every few weeks.
Common Mistakes
| Mistake | Result | Fix |
|---|---|---|
Missing link | Widget has no clickable target | Add a link field |
Missing image | Widget renders without a visual | Add an image field with a valid URL |
Inconsistent pubDate format | Sorting issues | Use YYYY-MM-DD |
| Broken image URL | Empty image block | Test the URL in your browser first |
Next Step
Your promotion widget is ready. Continue to:
👉 Github Repo — push your project to GitHub for deployment