Nine packs: the rest of the WordPress list #29
No files matched your search
+22
-4
@@ -35,18 +35,28 @@ Content-Security-Policy as the site's own.
|
||||
subscribe to (see [events.md](events.md));
|
||||
- **changelog**: release notes, a page per release and all of them on
|
||||
one page, a feed to follow and a "What's new" section;
|
||||
- **coming-soon**: a holding page for before launch or during
|
||||
maintenance, with when you'll open and a sign-up form;
|
||||
- **contact-forms**: ready-made forms for a quote, a booking and a
|
||||
mailing list, and a section that puts any form beside your email,
|
||||
phone and address;
|
||||
- **directory**: a listing of businesses, members or places, grouped
|
||||
by category, with a page each;
|
||||
- **docs**: a documentation section with a sidebar, part pages and
|
||||
previous/next links, in the order `data/docs-nav.yaml` gives;
|
||||
- **downloads**: files to download, with their type and size;
|
||||
- **faq**: questions that open to show their answers;
|
||||
- **gallery**: a grid of pictures that open full size, with no script;
|
||||
- **glossary**: terms and what they mean, A to Z, each with its own
|
||||
link;
|
||||
- **jobs**: openings with closing dates; closed ones leave the list by
|
||||
themselves;
|
||||
- **link-in-bio**: one page of big buttons, for the link in a social
|
||||
profile;
|
||||
- **location-and-hours**: address, map link, phone, email and opening
|
||||
hours, from `data/location.yaml`, as a section or a partial;
|
||||
- **logo-wall**: a grid of logos, for customers, sponsors or "as seen
|
||||
in";
|
||||
- **menu-and-prices**: a price list in groups, and plans side by side;
|
||||
- **payment-links**: buy, book and donate buttons that open your payment
|
||||
provider's own checkout (Stripe, PayPal, Square, Ko-fi, Liberapay…);
|
||||
@@ -57,24 +67,32 @@ Content-Security-Policy as the site's own.
|
||||
- **recipes**: ingredients, steps, times and servings;
|
||||
- **related-posts**: at the end of an article, the ones sharing the most
|
||||
tags with it;
|
||||
- **reviews**: star ratings from customers, with the average, as a
|
||||
section or under a product;
|
||||
- **series**: articles in parts, with "Part 2 of 5", every part listed
|
||||
and links to the previous and next part;
|
||||
- **share-links**: plain share links for Mastodon, Bluesky, LinkedIn and
|
||||
email, with no tracking;
|
||||
- **shop**: a product catalog with a page per product, each Buy button
|
||||
opening your payment provider's checkout (no cart);
|
||||
- **status-page**: whether your services are working, open and past
|
||||
incidents, and a feed;
|
||||
- **table-of-contents**: a long page's headings, linked, at its top;
|
||||
- **tables**: tables from a spreadsheet saved as CSV (or YAML), with a
|
||||
caption and row headings, that scroll on phones;
|
||||
- **team**: a page per person, a list of everyone and a section;
|
||||
- **testimonials**: quotes with a name and a role.
|
||||
- **testimonials**: quotes with a name and a role;
|
||||
- **timeline**: dates down a line, with what happened at each;
|
||||
- **videos**: a video library from your own files, with a page per
|
||||
video, a feed and a "Latest videos" section.
|
||||
- `-site` picks the site folder (default: the current one).
|
||||
|
||||
**Search engines.** The faq, location-and-hours, team, recipes, jobs and shop
|
||||
packs are also written as schema.org data (FAQPage, LocalBusiness, Person,
|
||||
Recipe, JobPosting, Product), and so is the breadcrumbs pack's trail
|
||||
(BreadcrumbList, on every page once the pack is installed), which search
|
||||
engines use for richer results. A pack can't carry the
|
||||
Recipe, JobPosting, Product), and so are the breadcrumbs pack's trail
|
||||
(BreadcrumbList, on every page once the pack is installed), a glossary
|
||||
section's terms (DefinedTermSet), a video page (VideoObject) and a product's
|
||||
reviews (AggregateRating), which search engines use for richer results. A pack can't carry the
|
||||
`<script type="application/ld+json">` that holds it, so HotDog CMS
|
||||
builds it (`pageData` in templates) and the starter's `partials/schema.html`
|
||||
writes it. Sites started before HotDog CMS 0.2 can add the same two lines to
|
||||
|
||||
@@ -205,6 +205,13 @@ matter, the same in each part), in reading order: by `part:` when every part
|
||||
has one, otherwise oldest first; none when the page isn't in a series of two
|
||||
or more. The breadcrumbs and series packs are built on them.
|
||||
|
||||
`sortBy "term" .items` orders a list of maps, or of pages, by one key: text
|
||||
without regard to case, numbers as numbers, dates by date, and anything
|
||||
without the key last (for pages, a front matter key, or `Title`, `Date` or
|
||||
`Weight`). `ratings .reviews` sums up a list with `rating:` from 1 to 5 as
|
||||
`.Average` (to one decimal) and `.Count`, and `stars 4.6` draws a rating as
|
||||
text, ★★★★★, rounded to the nearest star.
|
||||
|
||||
```
|
||||
{{ range trail . }}<a href="{{ .Href }}">{{ .Title }}</a> › {{ end }}
|
||||
```
|
||||
|
||||
+18
-4
@@ -156,7 +156,14 @@ func funcs(s *site.Site, a *Assets, md *site.Markdown, icons Icons) template.Fun
|
||||
}
|
||||
return v
|
||||
},
|
||||
"now": func() time.Time { return s.BuildTime },
|
||||
// now: when the site is being built, in the site's timezone (timezone:
|
||||
// in site.yaml), so a page can say "as of 1:39 PM" in local time.
|
||||
"now": func() time.Time {
|
||||
if s.Location != nil {
|
||||
return s.BuildTime.In(s.Location)
|
||||
}
|
||||
return s.BuildTime
|
||||
},
|
||||
// kindIs "string" .x: what a front matter or data value is (string, map, list, number, bool).
|
||||
"kindIs": func(kind string, v any) bool {
|
||||
switch v.(type) {
|
||||
@@ -193,7 +200,8 @@ func funcs(s *site.Site, a *Assets, md *site.Markdown, icons Icons) template.Fun
|
||||
// region. Fixed strings, so nothing a page writes can reach them.
|
||||
"emailOff": func() template.HTML { return "<!--email_off-->" },
|
||||
"emailOffEnd": func() template.HTML { return "<!--/email_off-->" },
|
||||
// formatDate "January 2006" "2025-03-04": a date written as text.
|
||||
// formatDate "January 2006" "2025-03-04": a date written as text, with
|
||||
// or without a time (2025-03-04 08:30), as front matter's date: takes.
|
||||
"formatDate": func(layout string, v any) (string, error) {
|
||||
// YAML reads a bare date (closes: 2026-11-15) as a time already.
|
||||
if t, ok := v.(time.Time); ok {
|
||||
@@ -203,9 +211,9 @@ func funcs(s *site.Site, a *Assets, md *site.Markdown, icons Icons) template.Fun
|
||||
if str == "" || v == nil {
|
||||
return "", nil
|
||||
}
|
||||
t, err := time.Parse("2006-01-02", str)
|
||||
t, err := site.ParseDate(str)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("formatDate: %q is not a date like 2026-10-10", str)
|
||||
return "", fmt.Errorf("formatDate: %q is not a date like 2026-10-10 or 2026-10-10 08:30", str)
|
||||
}
|
||||
return t.Format(layout), nil
|
||||
},
|
||||
@@ -270,6 +278,12 @@ func funcs(s *site.Site, a *Assets, md *site.Markdown, icons Icons) template.Fun
|
||||
"closed": func(v any) bool { return closed(s, v) },
|
||||
// related . 3: pages in the same collection sharing the most tags.
|
||||
"related": func(p *site.Page, n int) []*site.Page { return related(s, p, n) },
|
||||
// sortBy "term" .items: a list of maps, or pages, in order of one key.
|
||||
"sortBy": sortBy,
|
||||
// ratings .reviews: .Average (one decimal) and .Count of the ratings.
|
||||
"ratings": ratings,
|
||||
// stars 4: the rating as five stars of text, ★★★★☆.
|
||||
"stars": stars,
|
||||
// trail .: the pages above this one, from the home page, then it.
|
||||
"trail": func(p *site.Page) []*site.Page { return trail(s, p) },
|
||||
// series .: the parts of the series this page is in, in reading order.
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package build
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"git.coffeylabs.org/coffey-labs/hotdog-cms/internal/site"
|
||||
)
|
||||
|
||||
func TestSortBy(t *testing.T) {
|
||||
items := []any{
|
||||
map[string]any{"term": "starter"},
|
||||
map[string]any{"n": 1},
|
||||
map[string]any{"term": "Autolyse"},
|
||||
map[string]any{"term": 10},
|
||||
map[string]any{"term": 9},
|
||||
}
|
||||
got, err := sortBy("term", items)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var names []string
|
||||
for _, it := range got {
|
||||
names = append(names, str(it.(map[string]any)["term"]))
|
||||
}
|
||||
// Numbers as numbers (9 before 10), text without regard to case, missing last.
|
||||
if strings.Join(names, ",") != "9,10,Autolyse,starter," {
|
||||
t.Errorf("order: %v", names)
|
||||
}
|
||||
a := &site.Page{Title: "b", Date: time.Date(2026, 1, 2, 0, 0, 0, 0, time.UTC), Params: map[string]any{"category": "Shops"}}
|
||||
b := &site.Page{Title: "A", Date: time.Date(2026, 1, 1, 0, 0, 0, 0, time.UTC), Params: map[string]any{"category": "Food"}}
|
||||
for key, want := range map[string]string{"Title": "A", "Date": "A", "category": "A"} {
|
||||
got, _ := sortBy(key, []*site.Page{a, b})
|
||||
if got[0].(*site.Page).Title != want {
|
||||
t.Errorf("sortBy %s: %s first", key, got[0].(*site.Page).Title)
|
||||
}
|
||||
}
|
||||
if _, err := sortBy("x", "not a list"); err == nil {
|
||||
t.Error("sorted a string")
|
||||
}
|
||||
}
|
||||
|
||||
func TestRatingsAndStars(t *testing.T) {
|
||||
r := ratings([]any{
|
||||
map[string]any{"rating": 5},
|
||||
map[string]any{"rating": 4},
|
||||
map[string]any{"rating": "4"},
|
||||
map[string]any{"rating": 9}, // out of range: left out
|
||||
map[string]any{"name": "x"}, // no rating
|
||||
})
|
||||
if r.Count != 3 || r.Average != 4.3 {
|
||||
t.Errorf("ratings: %+v", r)
|
||||
}
|
||||
for in, want := range map[any]string{5: "★★★★★", 4.6: "★★★★★", 4.4: "★★★★☆", 0: "☆☆☆☆☆", 7: "★★★★★", "3": "★★★☆☆"} {
|
||||
if got := stars(in); got != want {
|
||||
t.Errorf("stars(%v) = %s, want %s", in, got, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsoDuration(t *testing.T) {
|
||||
for in, want := range map[string]string{"2:14": "PT2M14S", "1:02:03": "PT1H2M3S", "0:45": "PT45S", "12": "", "a:b": "", "": ""} {
|
||||
if got := isoDuration(in); got != want {
|
||||
t.Errorf("isoDuration(%q) = %q, want %q", in, got, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestProductReviewsData(t *testing.T) {
|
||||
s := &site.Site{Config: &site.Config{Name: "Bakery", URL: "https://example.org"}}
|
||||
p := &site.Page{Title: "Kit", Permalink: "https://example.org/kit/", Params: map[string]any{
|
||||
"price": 24,
|
||||
"reviews": []any{
|
||||
map[string]any{"name": "Sam", "rating": 5, "text": "Works **well**."},
|
||||
map[string]any{"name": "Lee", "rating": 4},
|
||||
},
|
||||
}}
|
||||
d := productData(s, p)
|
||||
ar, _ := d["aggregateRating"].(map[string]any)
|
||||
if ar == nil || ar["ratingValue"] != "4.5" || ar["reviewCount"] != 2 {
|
||||
t.Fatalf("aggregateRating: %v", d["aggregateRating"])
|
||||
}
|
||||
rv, _ := d["review"].([]any)
|
||||
if len(rv) != 2 || rv[0].(map[string]any)["reviewBody"] != "Works well." {
|
||||
t.Errorf("review: %v", d["review"])
|
||||
}
|
||||
delete(p.Params, "reviews")
|
||||
if _, ok := productData(s, p)["aggregateRating"]; ok {
|
||||
t.Error("a product without reviews has a rating")
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package build
|
||||
import (
|
||||
"fmt"
|
||||
"html/template"
|
||||
"math"
|
||||
"regexp"
|
||||
"sort"
|
||||
"strconv"
|
||||
@@ -36,6 +37,10 @@ func pageData(s *site.Site, p *site.Page) []map[string]any {
|
||||
if d := businessData(s, sec.Data); d != nil {
|
||||
out = append(out, d)
|
||||
}
|
||||
case "glossary":
|
||||
if d := glossaryData(s, p, sec.Data); d != nil {
|
||||
out = append(out, d)
|
||||
}
|
||||
}
|
||||
}
|
||||
if hasPack(s, "breadcrumbs") {
|
||||
@@ -54,6 +59,10 @@ func pageData(s *site.Site, p *site.Page) []map[string]any {
|
||||
out = append(out, recipeData(s, p))
|
||||
case "product":
|
||||
out = append(out, productData(s, p))
|
||||
case "video":
|
||||
if d := videoData(s, p); d != nil {
|
||||
out = append(out, d)
|
||||
}
|
||||
case "job":
|
||||
// A closed opening isn't advertised: search engines drop listings
|
||||
// whose validThrough has passed, and say so.
|
||||
@@ -501,6 +510,30 @@ func productData(s *site.Site, p *site.Page) map[string]any {
|
||||
out["offers"] = map[string]any{"@type": "Offer", "price": strconv.FormatFloat(f, 'f', 2, 64), "priceCurrency": cur, "availability": avail, "url": p.Permalink}
|
||||
}
|
||||
out["brand"] = map[string]any{"@type": "Brand", "name": s.Config.Name}
|
||||
// Customers' reviews of the product (the reviews pack). A business's
|
||||
// reviews of itself get none: search engines ignore those.
|
||||
if r := ratings(p.Params["reviews"]); r.Count > 0 {
|
||||
out["aggregateRating"] = map[string]any{"@type": "AggregateRating", "ratingValue": strconv.FormatFloat(r.Average, 'f', 1, 64), "reviewCount": r.Count, "bestRating": 5, "worstRating": 1}
|
||||
var reviews []any
|
||||
for _, it := range list(p.Params["reviews"]) {
|
||||
m, _ := it.(map[string]any)
|
||||
n, ok := amount(m["rating"])
|
||||
if !ok || str(m["name"]) == "" {
|
||||
continue
|
||||
}
|
||||
rv := map[string]any{"@type": "Review", "author": map[string]any{"@type": "Person", "name": str(m["name"])}, "reviewRating": map[string]any{"@type": "Rating", "ratingValue": strconv.FormatFloat(n, 'f', -1, 64), "bestRating": 5, "worstRating": 1}}
|
||||
if t := plainText(str(m["text"])); t != "" {
|
||||
rv["reviewBody"] = t
|
||||
}
|
||||
if d, ok := dayOf(s, m["date"]); ok {
|
||||
rv["datePublished"] = d.Format("2006-01-02")
|
||||
}
|
||||
reviews = append(reviews, rv)
|
||||
}
|
||||
if len(reviews) > 0 {
|
||||
out["review"] = reviews
|
||||
}
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
@@ -610,3 +643,165 @@ func partNumber(p *site.Page) (float64, bool) {
|
||||
n, err := strconv.ParseFloat(str(p.Params["part"]), 64)
|
||||
return n, err == nil
|
||||
}
|
||||
|
||||
// Ratings sums up a list of reviews, each with a rating: from 1 to 5.
|
||||
type Ratings struct {
|
||||
Average float64 // to one decimal place
|
||||
Count int
|
||||
}
|
||||
|
||||
func ratings(v any) Ratings {
|
||||
var sum float64
|
||||
var r Ratings
|
||||
for _, it := range list(v) {
|
||||
m, _ := it.(map[string]any)
|
||||
if n, ok := amount(m["rating"]); ok && n >= 1 && n <= 5 {
|
||||
sum += n
|
||||
r.Count++
|
||||
}
|
||||
}
|
||||
if r.Count > 0 {
|
||||
r.Average = math.Round(sum/float64(r.Count)*10) / 10
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
// stars draws a rating out of five as text, rounded to the nearest star.
|
||||
func stars(v any) string {
|
||||
n, _ := amount(v)
|
||||
full := int(math.Round(math.Max(0, math.Min(5, n))))
|
||||
return strings.Repeat("\u2605", full) + strings.Repeat("\u2606", 5-full)
|
||||
}
|
||||
|
||||
// sortBy orders a list of maps, or pages, by one key: text without regard to
|
||||
// case, numbers as numbers, things without the key last. Pages are sorted by
|
||||
// a front matter key, or by Title, Date or Weight.
|
||||
func sortBy(key string, v any) ([]any, error) {
|
||||
var items []any
|
||||
switch l := v.(type) {
|
||||
case []any:
|
||||
items = append(items, l...)
|
||||
case []*site.Page:
|
||||
for _, p := range l {
|
||||
items = append(items, p)
|
||||
}
|
||||
case nil:
|
||||
return nil, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("sortBy: not a list")
|
||||
}
|
||||
get := func(it any) any {
|
||||
switch x := it.(type) {
|
||||
case map[string]any:
|
||||
return x[key]
|
||||
case *site.Page:
|
||||
switch key {
|
||||
case "Title":
|
||||
return x.Title
|
||||
case "Date":
|
||||
return x.Date
|
||||
case "Weight":
|
||||
return x.Weight
|
||||
}
|
||||
return x.Params[key]
|
||||
}
|
||||
return nil
|
||||
}
|
||||
sort.SliceStable(items, func(i, j int) bool {
|
||||
a, b := get(items[i]), get(items[j])
|
||||
if a == nil || b == nil {
|
||||
return a != nil
|
||||
}
|
||||
if x, ok := a.(time.Time); ok {
|
||||
if y, ok := b.(time.Time); ok {
|
||||
return x.Before(y)
|
||||
}
|
||||
}
|
||||
if x, ok := amount(a); ok {
|
||||
if y, ok := amount(b); ok {
|
||||
return x < y
|
||||
}
|
||||
}
|
||||
return strings.ToLower(str(a)) < strings.ToLower(str(b))
|
||||
})
|
||||
return items, nil
|
||||
}
|
||||
|
||||
// glossaryData is a glossary section's terms as a DefinedTermSet, each term
|
||||
// at its anchor on the page.
|
||||
func glossaryData(s *site.Site, p *site.Page, d map[string]any) map[string]any {
|
||||
var terms []any
|
||||
for _, it := range sectionItems(s, d, "items") {
|
||||
m, _ := it.(map[string]any)
|
||||
name := str(m["term"])
|
||||
if name == "" {
|
||||
continue
|
||||
}
|
||||
t := map[string]any{"@type": "DefinedTerm", "name": name, "url": p.Permalink + "#" + site.Slugify(name)}
|
||||
if def := plainText(str(m["definition"])); def != "" {
|
||||
t["description"] = def
|
||||
}
|
||||
terms = append(terms, t)
|
||||
}
|
||||
if len(terms) == 0 {
|
||||
return nil
|
||||
}
|
||||
out := ldBase("DefinedTermSet")
|
||||
out["name"] = p.Title
|
||||
if h := str(d["heading"]); h != "" {
|
||||
out["name"] = h
|
||||
}
|
||||
out["url"] = p.Permalink
|
||||
out["hasDefinedTerm"] = terms
|
||||
return out
|
||||
}
|
||||
|
||||
// videoData is a video page (the videos pack) as a VideoObject.
|
||||
func videoData(s *site.Site, p *site.Page) map[string]any {
|
||||
src := str(p.Params["video"])
|
||||
poster := str(p.Params["poster"])
|
||||
if src == "" || poster == "" || p.Date.IsZero() {
|
||||
return nil // search engines need the file, a picture and a date
|
||||
}
|
||||
out := ldBase("VideoObject")
|
||||
out["name"] = p.Title
|
||||
out["url"] = p.Permalink
|
||||
out["description"] = p.Summary
|
||||
if p.Summary == "" {
|
||||
out["description"] = p.Title
|
||||
}
|
||||
out["thumbnailUrl"] = abs(s, poster)
|
||||
out["contentUrl"] = abs(s, src)
|
||||
out["uploadDate"] = p.Date.Format(time.RFC3339)
|
||||
if d := isoDuration(str(p.Params["duration"])); d != "" {
|
||||
out["duration"] = d
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// isoDuration turns 12:34 or 1:02:03 into PT12M34S or PT1H2M3S.
|
||||
func isoDuration(v string) string {
|
||||
parts := strings.Split(strings.TrimSpace(v), ":")
|
||||
if len(parts) < 2 || len(parts) > 3 {
|
||||
return ""
|
||||
}
|
||||
n := make([]int, len(parts))
|
||||
for i, s := range parts {
|
||||
x, err := strconv.Atoi(s)
|
||||
if err != nil || x < 0 {
|
||||
return ""
|
||||
}
|
||||
n[i] = x
|
||||
}
|
||||
if len(n) == 2 {
|
||||
n = append([]int{0}, n...)
|
||||
}
|
||||
out := "PT"
|
||||
if n[0] > 0 {
|
||||
out += strconv.Itoa(n[0]) + "H"
|
||||
}
|
||||
if n[1] > 0 {
|
||||
out += strconv.Itoa(n[1]) + "M"
|
||||
}
|
||||
return out + strconv.Itoa(n[2]) + "S"
|
||||
}
|
||||
@@ -221,6 +221,77 @@ func TestBundledPacksBuildAndPass(t *testing.T) {
|
||||
"articles/a/index.html": {"Part 1 of 3"},
|
||||
"articles/x/index.html": {"Part 2 of 2", `class="series-prev" href="/articles/y/"`},
|
||||
}},
|
||||
{"reviews", []page{
|
||||
{"data/reviews.yaml", "- { name: Maria Lopez, rating: 5, date: 2026-09-14, text: The best **sourdough**., source: Google }\n- { name: Tom Reed, rating: 4 }\n- { name: Ana, rating: 4 }\n"},
|
||||
{"content/kind-words.md", "---\ntitle: Kind words\nsummary: Reviews.\nsections:\n - reviews: { heading: What customers say, from: reviews }\n---\n"},
|
||||
{"content/starter-kit.md", "---\ntitle: Starter kit\nsummary: A kit.\nreviews:\n - { name: Sam, rating: 5, text: Works. }\n - { name: Lee, rating: 3 }\n---\n"},
|
||||
}, map[string][]string{
|
||||
"kind-words/index.html": {"What customers say", `<b>4.3</b> out of 5 · 3 reviews`, `<span aria-hidden="true">★★★★★</span><span class="rv-sr">5 out of 5 stars</span>`, "★★★★☆", "<strong>sourdough</strong>", "Maria Lopez · September 2026 · Google", "packs/reviews/reviews."},
|
||||
"starter-kit/index.html": {`<h2 id="reviews-heading">Reviews</h2>`, `<b>4</b> out of 5 · 2 reviews`, "Sam", "Lee"},
|
||||
}},
|
||||
{"glossary", []page{
|
||||
{"data/glossary.yaml", "- { term: Starter, definition: Flour and water with wild yeast. }\n- { term: levain, definition: A starter for **one** bake., see_also: [Starter] }\n- { term: Autolyse, definition: Resting flour and water. }\n- { term: Lame, definition: A blade. }\n"},
|
||||
{"content/words.md", "---\ntitle: Baking words\nsummary: A glossary.\nsections:\n - glossary: { heading: Baking words, from: glossary }\n---\n"},
|
||||
}, map[string][]string{
|
||||
"words/index.html": {`<a href="#g0-a">A</a></li><li><a href="#g0-l">L</a></li><li><a href="#g0-s">S</a>`, `id="autolyse"`, `<div class="gl-entry" id="lame">`, `See also: <a href="#starter">Starter</a>`, "<strong>one</strong>", `"@type":"DefinedTermSet"`, `"url":"https://example.org/words/#levain"`, "packs/glossary/glossary."},
|
||||
}},
|
||||
{"logo-wall", []page{
|
||||
{"content/press.md", "---\ntitle: Press\nsummary: As seen in.\nsections:\n - logos:\n heading: As seen in\n muted: true\n size: small\n items:\n - { name: The Times, logo: /media/a.png, link: \"https://example.com/story\" }\n - { name: The Post, logo: /media/b.png }\n---\n"},
|
||||
}, map[string][]string{
|
||||
"press/index.html": {"lw-grid lw-small lw-muted", `<a href="https://example.com/story"><img src="/media/a.png" alt="The Times"`, `<li><img src="/media/b.png" alt="The Post"`, "packs/logo-wall/logo-wall."},
|
||||
}},
|
||||
{"videos", []page{
|
||||
{"static/media/v.mp4", "mp4"},
|
||||
{"static/media/v.vtt", "WEBVTT\n"},
|
||||
{"content/videos/_index.md", "---\ntitle: Videos\nsummary: How we bake.\n---\n"},
|
||||
{"content/videos/shaping.md", "---\ntitle: Shaping a boule\ndate: 2026-10-01\nsummary: Two minutes.\nvideo: /media/v.mp4\nposter: /media/a.png\ncaptions: /media/v.vtt\nduration: \"2:14\"\n---\nThe transcript.\n"},
|
||||
{"content/index.md", "---\ntitle: Home\nsummary: Bakery.\nlayout: landing\nsections:\n - videos: { heading: Latest videos, count: 2 }\n---\n"},
|
||||
}, map[string][]string{
|
||||
"videos/shaping/index.html": {`<video controls preload="metadata" playsinline poster="/media/a.png">`, `<source src="/media/v.mp4" type="video/mp4">`, `<track kind="captions" src="/media/v.vtt"`, `"@type":"VideoObject"`, `"duration":"PT2M14S"`, `"contentUrl":"https://example.org/media/v.mp4"`, "The transcript."},
|
||||
"videos/index.html": {`href="/videos/shaping/"`, `<span class="vid-len">2:14</span>`},
|
||||
"index.html": {"Latest videos", `href="/videos/shaping/"`, "Every video"},
|
||||
"videos/feed.xml": {"Shaping a boule"},
|
||||
}},
|
||||
{"directory", []page{
|
||||
{"content/directory/_index.md", "---\ntitle: Local businesses\nsummary: On Main Street.\n---\n"},
|
||||
{"content/directory/books.md", "---\ntitle: Main Street Books\nsummary: Books.\ncategory: Shops\naddress: 40 Main Street\nphone: (217) 555-0170\nwebsite: \"https://books.example.com\"\n---\n"},
|
||||
{"content/directory/cafe.md", "---\ntitle: Corner Cafe\nsummary: Coffee.\ncategory: Food\n---\n"},
|
||||
{"content/directory/bikes.md", "---\ntitle: Bike Repair\nsummary: Bikes.\ncategory: Shops\n---\n"},
|
||||
{"content/directory/odd.md", "---\ntitle: Odd Jobs\nsummary: Anything.\n---\n"},
|
||||
}, map[string][]string{
|
||||
"directory/index.html": {`<a href="#food">Food</a></li><li><a href="#shops">Shops</a></li><li><a href="#other">Other</a>`, `<h2 class="dir-cat" id="shops">Shops</h2>`, "packs/directory/directory."},
|
||||
"directory/books/index.html": {"Map and directions", `href="tel:%28217%29555-0170"`, ">books.example.com<", "· Shops"},
|
||||
}},
|
||||
{"link-in-bio", []page{
|
||||
{"content/links.md", "---\ntitle: Bakery on Main\nsummary: Links.\nlayout: links\nphoto: /media/a.png\nphoto_alt: Our logo\nlinks:\n - { text: Order for pick-up, url: /about/, note: Ready by 7am }\n - { text: Mastodon, url: \"https://example.social/@bakery\" }\n---\nFresh bread.\n"},
|
||||
}, map[string][]string{
|
||||
"links/index.html": {`<img class="lib-photo" src="/media/a.png" alt="Our logo"`, `<a class="lib-link" href="/about/"><span>Order for pick-up</span><small>Ready by 7am</small>`, "Fresh bread.", "packs/link-in-bio/link-in-bio."},
|
||||
}},
|
||||
{"status-page", []page{
|
||||
{"data/status.yaml", "components:\n - { name: Website, status: operational }\n - { name: Online ordering, status: degraded, note: Checkout is slow. }\n"},
|
||||
{"content/incidents/slow.md", "---\ntitle: Ordering is slow\ndate: 2026-10-12 08:10\nstatus: monitoring\naffects: [Online ordering]\n---\n**09:05** A fix is in.\n"},
|
||||
{"content/incidents/old.md", "---\ntitle: Site was down\ndate: 2026-09-01 07:00\nstatus: resolved\nresolved: 2026-09-01 07:40\naffects: Website\n---\nFixed.\n"},
|
||||
{"content/status.md", "---\ntitle: Status\nsummary: Is it working.\nlayout: landing\nsections:\n - status: {}\n---\n"},
|
||||
}, map[string][]string{
|
||||
"status/index.html": {`st-overall st-degraded`, "Some things aren't working as they should.", `<span class="st-badge st-degraded">Partly working</span>`, "Checkout is slow.", `<h3 class="st-h">Now</h3>`, `href="/incidents/slow/">Ordering is slow`, "Fixed, watching", "Past incidents", `href="/incidents/old/">Site was down`, `href="/incidents/feed.xml"`},
|
||||
"incidents/old/index.html": {"Resolved", "September 1, 2026, 7:40 AM", "<dd>Website</dd>"},
|
||||
"incidents/slow/index.html": {"<dd>Online ordering</dd>", "<strong>09:05</strong>"},
|
||||
}},
|
||||
{"coming-soon", []page{
|
||||
{"content/soon.md", "---\ntitle: Fresh bread, coming soon\nsummary: Opening in March.\nlayout: holding\nlaunch: Opening March 1, 2027\nform: contact\nlinks:\n - { text: Mastodon, url: \"https://example.social/@bakery\" }\n---\nLeave your email.\n"},
|
||||
}, map[string][]string{
|
||||
"soon/index.html": {`<h1 class="hold-title">Fresh bread, coming soon</h1>`, `<p class="hold-when">Opening March 1, 2027</p>`, `action="/_hotdog/forms/contact"`, `href="https://example.social/@bakery">Mastodon`, "packs/coming-soon/coming-soon."},
|
||||
}},
|
||||
{"timeline", []page{
|
||||
{"content/history.md", "---\ntitle: History\nsummary: How we got here.\nsections:\n - timeline:\n heading: How we got here\n items:\n - { when: \"2019\", title: The first loaf, text: \"At the **market**.\" }\n - { when: \"2021\", title: Main Street, image: /media/a.png, image_alt: The shop front }\n---\n"},
|
||||
}, map[string][]string{
|
||||
"history/index.html": {`<p class="tl-when">2019</p>`, `<h3 class="tl-title">The first loaf</h3>`, "<strong>market</strong>", `src="/media/a.png" alt="The shop front"`, "packs/timeline/timeline."},
|
||||
}},
|
||||
}
|
||||
// What a pack's pages must not have: the menu, on pages meant to stand alone.
|
||||
absent := map[string]map[string][]string{
|
||||
"link-in-bio": {"links/index.html": {`<header class="top">`}},
|
||||
"coming-soon": {"soon/index.html": {`<header class="top">`}},
|
||||
}
|
||||
for _, c := range cases {
|
||||
t.Run(c.pack, func(t *testing.T) {
|
||||
@@ -241,6 +312,11 @@ func TestBundledPacksBuildAndPass(t *testing.T) {
|
||||
os.WriteFile(lp, []byte(strings.Replace(string(raw), "<h1", `{{ template "breadcrumbs" . }}<h1`, 1)), 0o644)
|
||||
}
|
||||
}
|
||||
if c.pack == "reviews" {
|
||||
lp := filepath.Join(dir, "layouts", "page.html")
|
||||
raw, _ := os.ReadFile(lp)
|
||||
os.WriteFile(lp, []byte(strings.Replace(string(raw), "{{ .Content }}", `{{ .Content }}{{ template "reviews" . }}`, 1)), 0o644)
|
||||
}
|
||||
if c.pack == "author-box" || c.pack == "series" {
|
||||
lp := filepath.Join(dir, "layouts", "article.html")
|
||||
raw, _ := os.ReadFile(lp)
|
||||
@@ -283,6 +359,14 @@ func TestBundledPacksBuildAndPass(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
for file, nots := range absent[c.pack] {
|
||||
out, _ := os.ReadFile(filepath.Join(res.Out, filepath.FromSlash(file)))
|
||||
for _, n := range nots {
|
||||
if strings.Contains(string(out), n) {
|
||||
t.Errorf("%s has %q", file, n)
|
||||
}
|
||||
}
|
||||
}
|
||||
cfg, err := site.LoadConfig(dir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
@@ -725,6 +725,10 @@ func strList(v any) []string {
|
||||
|
||||
var dateLayouts = []string{time.RFC3339, "2006-01-02T15:04:05", "2006-01-02T15:04", "2006-01-02 15:04:05", "2006-01-02 15:04", "2006-01-02"}
|
||||
|
||||
// ParseDate reads a date as front matter's date: does: 2026-10-10, or with
|
||||
// a time, 2026-10-10 08:30.
|
||||
func ParseDate(v any) (time.Time, error) { return date(v) }
|
||||
|
||||
func date(v any) (time.Time, error) {
|
||||
switch t := v.(type) {
|
||||
case nil:
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Coffey Labs LLC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,10 @@
|
||||
# Coming soon pack
|
||||
|
||||
A holding page for a site that isn't open yet, or is closed for a while:
|
||||
your name, a headline, when you'll open, a few words, and optionally a form
|
||||
from `forms/` (the contact-forms pack's mailing list sign-up fits) and
|
||||
links. No menu, so there's nowhere to wander off to.
|
||||
|
||||
hotdog-cms pack add coming-soon
|
||||
|
||||
Give the home page `layout: holding` until launch day.
|
||||
@@ -0,0 +1,10 @@
|
||||
/* The coming soon pack. Colors come from the theme's variables. */
|
||||
.hold { min-height: 70vh; max-width: 640px; margin: 0 auto; padding: 64px 20px 48px; display: flex; flex-direction: column; justify-content: center; text-align: center; }
|
||||
.hold-site { margin: 0; color: var(--accent); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; }
|
||||
.hold-title { margin: 12px 0 0; font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.1; }
|
||||
.hold-when { display: inline-block; align-self: center; margin: 18px 0 0; padding: 6px 14px; border-radius: 999px; background: var(--accent-soft); font-weight: 650; }
|
||||
.hold-text { margin-top: 18px; color: var(--muted); font-size: 1.1rem; }
|
||||
.hold-text > :last-child { margin-bottom: 0; }
|
||||
.hold-form { margin: 28px auto 0; width: 100%; max-width: 420px; text-align: left; }
|
||||
.hold-form .hotdog-form button[type="submit"] { background: var(--accent); border: 1px solid var(--accent); color: var(--accent-text, #fff); font-weight: 650; }
|
||||
.hold-links { list-style: none; margin: 28px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 20px; }
|
||||
@@ -0,0 +1,16 @@
|
||||
{{/* A holding page: before launch, or while the site is closed. No menu. */}}
|
||||
{{/* No banner or menu here. A template whose body is empty doesn't replace
|
||||
the site's, so each holds an empty string. */}}
|
||||
{{ define "banner" }}{{ "" }}{{ end }}
|
||||
{{ define "nav" }}{{ "" }}{{ end }}
|
||||
{{ define "main" }}
|
||||
<link rel="stylesheet" href="{{ asset "packs/coming-soon/coming-soon.css" }}">
|
||||
<div class="hold">
|
||||
<p class="hold-site">{{ .Site.Config.Name }}</p>
|
||||
<h1 class="hold-title">{{ .Title }}</h1>
|
||||
{{ with .Params.launch }}<p class="hold-when">{{ . }}</p>{{ end }}
|
||||
{{ with .Content }}<div class="hold-text">{{ . }}</div>{{ end }}
|
||||
{{ with .Params.form }}<div class="hold-form">{{ form . }}</div>{{ end }}
|
||||
{{ with .Params.links }}<ul class="hold-links">{{ range . }}<li><a href="{{ .url }}">{{ .text }}</a></li>{{ end }}</ul>{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,26 @@
|
||||
name: coming-soon
|
||||
version: 1.0.0
|
||||
title: Coming soon
|
||||
description: A holding page for before launch or during maintenance, with when you'll be back and a sign-up form.
|
||||
license: MIT
|
||||
author: Coffey Labs LLC
|
||||
notes: |
|
||||
Give a page layout: holding. For a site that isn't open yet, make it the
|
||||
home page, content/index.md:
|
||||
|
||||
---
|
||||
title: Fresh bread, coming to Main Street
|
||||
summary: Bakery on Main opens in March.
|
||||
layout: holding
|
||||
launch: Opening March 1, 2027
|
||||
form: signup # optional: a form from forms/, such as the
|
||||
# contact-forms pack's mailing list sign-up
|
||||
links:
|
||||
- { text: Mastodon, url: "https://example.social/@bakery" }
|
||||
---
|
||||
Sourdough, rye and pastries, baked from 4am. Leave your email and we'll
|
||||
tell you the day we open.
|
||||
|
||||
The page has no menu, only what's on it and the site's footer. When
|
||||
you're ready, change the layout back (landing, for the starter's home
|
||||
page).
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Coffey Labs LLC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,8 @@
|
||||
# Directory pack
|
||||
|
||||
A listing of businesses, members, places or anything else with an address:
|
||||
`/directory/` groups the entries by category, A to Z within each, with a row
|
||||
of categories to jump with; each entry has a page with its address and a map
|
||||
link, phone, email and website.
|
||||
|
||||
hotdog-cms pack add directory
|
||||
@@ -0,0 +1,19 @@
|
||||
/* The directory pack. Colors come from the theme's variables. */
|
||||
.dir-cats ul { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
|
||||
.dir-cats a { display: inline-block; padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; font-size: .92rem; text-decoration: none; }
|
||||
.dir-cats a:hover { border-color: var(--accent); }
|
||||
.dir-cat { margin-top: 32px; scroll-margin-top: 80px; }
|
||||
.dir-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
|
||||
.dir-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
|
||||
.dir-logo { flex: none; width: 52px; height: 52px; border-radius: 10px; object-fit: contain; background: var(--bg, #fff); border: 1px solid var(--line); }
|
||||
.dir-logo-big { width: 84px; height: 84px; }
|
||||
.dir-name { font-weight: 650; font-size: 1.05rem; }
|
||||
.dir-summary { margin: 4px 0 0; color: var(--muted); }
|
||||
.dir-reach { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .9rem; }
|
||||
.dir-reach:empty { display: none; }
|
||||
.dir-head { display: flex; gap: 18px; align-items: center; }
|
||||
.dir-head h1 { margin: 0; }
|
||||
.dir-facts { display: grid; gap: 14px 32px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin: 24px 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); }
|
||||
.dir-facts dt { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
|
||||
.dir-facts dd { margin: 4px 0 0; }
|
||||
.dir-facts address { font-style: normal; white-space: pre-line; }
|
||||
@@ -0,0 +1,14 @@
|
||||
{{ define "main" }}
|
||||
<link rel="stylesheet" href="{{ asset "packs/directory/directory.css" }}">
|
||||
<section class="wrap page directory">
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ with .Content }}<div class="prose">{{ . }}</div>{{ end }}
|
||||
{{ $all := sortBy "category" (sortBy "Title" (collection .Collection)) }}
|
||||
{{ $cats := list }}{{ $last := "<none>" }}{{ range $all }}{{ $c := default "Other" .Params.category }}{{ if ne (print $c) $last }}{{ $cats = append $cats $c }}{{ $last = print $c }}{{ end }}{{ end }}
|
||||
{{ if gt (len $cats) 1 }}<nav class="dir-cats" aria-label="Categories"><ul>{{ range $cats }}<li><a href="#{{ slugify . }}">{{ . }}</a></li>{{ end }}</ul></nav>{{ end }}
|
||||
{{ range $cats }}{{ $cat := print . }}
|
||||
<h2 class="dir-cat" id="{{ slugify $cat }}">{{ $cat }}</h2>
|
||||
<ul class="dir-list">{{ range $all }}{{ if eq (print (default "Other" .Params.category)) $cat }}{{ template "listing-card" . }}{{ end }}{{ end }}</ul>
|
||||
{{ else }}<p>Nothing listed yet.</p>{{ end }}
|
||||
</section>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,17 @@
|
||||
{{ define "main" }}
|
||||
<link rel="stylesheet" href="{{ asset "packs/directory/directory.css" }}">
|
||||
<article class="wrap page listing">
|
||||
{{ with index .Site.Lists .Collection }}<p class="eyebrow"><a href="{{ .Path }}">{{ .Title }}</a>{{ with $.Params.category }} · {{ . }}{{ end }}</p>{{ end }}
|
||||
<div class="dir-head">
|
||||
{{ with .Params.logo }}<img class="dir-logo dir-logo-big" src="{{ . }}" alt="" >{{ end }}
|
||||
<div><h1>{{ .Title }}</h1>{{ with .Summary }}<p class="dir-summary">{{ . }}</p>{{ end }}</div>
|
||||
</div>
|
||||
<dl class="dir-facts">
|
||||
{{ with .Params.address }}<div><dt>Address</dt><dd><address>{{ . }}</address><a href="https://www.openstreetmap.org/search?query={{ urlquery . }}">Map and directions</a></dd></div>{{ end }}
|
||||
{{ with .Params.phone }}<div><dt>Phone</dt><dd><a href="tel:{{ replace " " "" . }}">{{ . }}</a></dd></div>{{ end }}
|
||||
{{ with .Params.email }}<div><dt>Email</dt><dd>{{ emailOff }}<a href="mailto:{{ . }}">{{ . }}</a>{{ emailOffEnd }}</dd></div>{{ end }}
|
||||
{{ with .Params.website }}<div><dt>Website</dt><dd><a href="{{ . }}">{{ hostOf . }}</a></dd></div>{{ end }}
|
||||
</dl>
|
||||
{{ with .Content }}<div class="prose">{{ . }}</div>{{ end }}
|
||||
</article>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,33 @@
|
||||
name: directory
|
||||
version: 1.0.0
|
||||
title: Directory
|
||||
description: A listing of businesses, members or places, grouped by category, with a page each.
|
||||
license: MIT
|
||||
author: Coffey Labs LLC
|
||||
collections:
|
||||
directory:
|
||||
layout: listing
|
||||
list_layout: directory
|
||||
sort: title
|
||||
paginate: 0
|
||||
notes: |
|
||||
Add each entry as content/directory/<name>.md:
|
||||
|
||||
---
|
||||
title: Main Street Books
|
||||
summary: New and used books, and a reading corner for kids.
|
||||
category: Shops
|
||||
address: |
|
||||
40 Main Street
|
||||
Springfield, IL 62701
|
||||
phone: (217) 555-0170
|
||||
email: [email protected]
|
||||
website: https://example.com
|
||||
logo: /media/main-street-books.webp
|
||||
---
|
||||
More about them.
|
||||
|
||||
/directory/ lists every entry, A to Z within each category, with a row
|
||||
of categories at the top to jump with. Entries without a category go
|
||||
under Other, at the end. Give the list a title and an
|
||||
introduction in content/directory/_index.md.
|
||||
@@ -0,0 +1,9 @@
|
||||
{{/* One entry in the directory: logo, name, line about it and how to reach them. */}}
|
||||
<li class="dir-card">
|
||||
{{ with .Params.logo }}<img class="dir-logo" src="{{ . }}" alt="" loading="lazy">{{ end }}
|
||||
<div>
|
||||
<a class="dir-name" href="{{ .Href }}">{{ .Title }}</a>
|
||||
{{ with .Summary }}<p class="dir-summary">{{ . }}</p>{{ end }}
|
||||
<p class="dir-reach">{{ with .Params.phone }}<a href="tel:{{ replace " " "" . }}">{{ . }}</a>{{ end }}{{ with .Params.website }} <a href="{{ . }}">{{ hostOf . }}</a>{{ end }}</p>
|
||||
</div>
|
||||
</li>
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Coffey Labs LLC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,11 @@
|
||||
# Glossary pack
|
||||
|
||||
Terms and what they mean, sorted A to Z, with a row of letters to jump with.
|
||||
Each term has its own link (`/glossary/#levain`) to send people straight to
|
||||
it, and "See also" links between related terms. Search engines get the list
|
||||
as a DefinedTermSet.
|
||||
|
||||
hotdog-cms pack add glossary
|
||||
|
||||
Keep the terms in `data/glossary.yaml`, in any order, and add a Glossary
|
||||
section with `from: glossary`.
|
||||
@@ -0,0 +1,15 @@
|
||||
/* The glossary pack. Colors come from the theme's variables. */
|
||||
.gl-letters ul { list-style: none; margin: 0 0 20px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
|
||||
.gl-letters a { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 650; text-decoration: none; }
|
||||
.gl-letters a:hover { border-color: var(--accent); }
|
||||
.gl-list { margin: 0; max-width: 72ch; }
|
||||
.gl-letter { margin: 26px 0 6px; padding-bottom: 4px; border-bottom: 2px solid var(--accent); color: var(--accent); font-weight: 800; font-size: 1.3rem; scroll-margin-top: 80px; }
|
||||
.gl-entry { padding: 12px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 80px; }
|
||||
.gl-entry:target { background: var(--accent-soft); border-radius: 8px; padding-inline: 12px; }
|
||||
.gl-entry dt { font-weight: 700; font-size: 1.05rem; }
|
||||
.gl-anchor { color: inherit; text-decoration: none; }
|
||||
.gl-anchor:hover { text-decoration: underline; }
|
||||
.gl-entry dd { margin: 4px 0 0; }
|
||||
.gl-entry dd > :first-child { margin-top: 0; }
|
||||
.gl-entry dd > :last-child { margin-bottom: 0; }
|
||||
.gl-see { color: var(--muted); font-size: .92rem; }
|
||||
@@ -0,0 +1,23 @@
|
||||
name: glossary
|
||||
version: 1.0.0
|
||||
title: Glossary
|
||||
description: Terms and what they mean, A to Z, each with its own link, and the list for search engines.
|
||||
license: MIT
|
||||
author: Coffey Labs LLC
|
||||
notes: |
|
||||
Keep the terms in data/glossary.yaml, in any order:
|
||||
|
||||
- term: Levain
|
||||
definition: A starter built up the night before, for one bake.
|
||||
see_also: [Starter]
|
||||
- term: Starter
|
||||
definition: Flour and water, alive with wild yeast. Feed it daily.
|
||||
|
||||
Then add a "Glossary" section to a page:
|
||||
|
||||
sections:
|
||||
- glossary: { heading: Baking words, from: glossary }
|
||||
|
||||
Terms are sorted A to Z, with a row of letters at the top to jump with.
|
||||
Each term has its own link: /glossary/#levain. Search engines get the list
|
||||
(DefinedTermSet).
|
||||
@@ -0,0 +1,35 @@
|
||||
{{/* section
|
||||
label: Glossary
|
||||
about: Terms and what they mean, A to Z, each with its own link.
|
||||
fields:
|
||||
- { name: heading, type: text, default: Glossary }
|
||||
- { name: intro, type: markdown }
|
||||
- name: items
|
||||
type: list
|
||||
label: Terms
|
||||
fields:
|
||||
- { name: term, type: text, required: true }
|
||||
- { name: definition, type: markdown, required: true }
|
||||
- { name: see_also, type: list, label: See also, help: Other terms in this glossary, one per line. }
|
||||
- { name: from, type: data, label: Terms from, help: A file in data/ that holds the terms. Leave empty to use the terms above. }
|
||||
*/}}
|
||||
{{ $items := .Data.items }}{{ with .Data.from }}{{ $items = data . }}{{ end }}{{ $items = sortBy "term" $items }}
|
||||
{{ $letters := list }}{{ $last := "" }}{{ range $items }}{{ $l := upper (printf "%.1s" (print .term)) }}{{ if ne $l $last }}{{ $letters = append $letters $l }}{{ $last = $l }}{{ end }}{{ end }}
|
||||
{{ $id := printf "g%d" .Index }}
|
||||
<link rel="stylesheet" href="{{ asset "packs/glossary/glossary.css" }}">
|
||||
<section class="block glossary">
|
||||
<div class="wrap">
|
||||
{{ with .Data.heading }}<h2>{{ . }}</h2>{{ end }}
|
||||
{{ with .Data.intro }}<div class="intro">{{ markdownify . }}</div>{{ end }}
|
||||
{{ if gt (len $letters) 1 }}<nav class="gl-letters" aria-label="Jump to a letter"><ul>{{ range $letters }}<li><a href="#{{ $id }}-{{ slugify . }}">{{ . }}</a></li>{{ end }}</ul></nav>{{ end }}
|
||||
<dl class="gl-list">
|
||||
{{ $last = "" }}{{ range $items }}{{ $l := upper (printf "%.1s" (print .term)) }}
|
||||
{{ if ne $l $last }}<div class="gl-letter" id="{{ $id }}-{{ slugify $l }}" aria-hidden="true">{{ $l }}</div>{{ $last = $l }}{{ end }}
|
||||
<div class="gl-entry" id="{{ slugify .term }}">
|
||||
<dt><a class="gl-anchor" href="#{{ slugify .term }}">{{ .term }}</a></dt>
|
||||
<dd>{{ markdownify .definition }}{{ with .see_also }}<p class="gl-see">See also: {{ range $i, $t := . }}{{ if $i }}, {{ end }}<a href="#{{ slugify $t }}">{{ $t }}</a>{{ end }}</p>{{ end }}</dd>
|
||||
</div>
|
||||
{{ end }}
|
||||
</dl>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Coffey Labs LLC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,10 @@
|
||||
# Link in bio pack
|
||||
|
||||
One page for the link in a social profile: your picture, a line about you,
|
||||
and big buttons to everywhere else, with no menu in the way. It's a page on
|
||||
your own site, so there's no third-party link service counting your
|
||||
visitors.
|
||||
|
||||
hotdog-cms pack add link-in-bio
|
||||
|
||||
Make a page with `layout: links` and a `links:` list.
|
||||
@@ -0,0 +1,14 @@
|
||||
/* The link in bio pack. Colors come from the theme's variables. */
|
||||
.lib { max-width: 480px; margin: 0 auto; padding: 56px 20px 40px; text-align: center; }
|
||||
.lib-photo { width: 112px; height: 112px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); background: var(--surface); }
|
||||
.lib-name { margin: 16px 0 6px; font-size: 1.6rem; }
|
||||
.lib-bio { color: var(--muted); }
|
||||
.lib-bio > :first-child { margin-top: 0; }
|
||||
.lib-links { list-style: none; margin: 26px 0 0; padding: 0; display: grid; gap: 12px; }
|
||||
.lib-link { display: grid; gap: 2px; padding: 15px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); font-weight: 650; text-decoration: none; transition: transform .15s, border-color .15s; }
|
||||
.lib-link small { color: var(--muted); font-weight: 500; }
|
||||
.lib-link:hover { transform: translateY(-2px); border-color: var(--accent); }
|
||||
.lib-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
|
||||
.lib-links li:first-child .lib-link { background: var(--accent); border-color: var(--accent); color: var(--accent-text, #fff); }
|
||||
.lib-links li:first-child .lib-link small { color: inherit; opacity: .85; }
|
||||
.lib-home { margin-top: 28px; font-size: .9rem; }
|
||||
@@ -0,0 +1,17 @@
|
||||
{{/* A page of links, for a social profile: no menu, only the links. */}}
|
||||
{{/* No banner or menu here. A template whose body is empty doesn't replace
|
||||
the site's, so each holds an empty string. */}}
|
||||
{{ define "banner" }}{{ "" }}{{ end }}
|
||||
{{ define "nav" }}{{ "" }}{{ end }}
|
||||
{{ define "main" }}
|
||||
<link rel="stylesheet" href="{{ asset "packs/link-in-bio/link-in-bio.css" }}">
|
||||
<div class="lib">
|
||||
{{ with .Params.photo }}<img class="lib-photo" src="{{ . }}" alt="{{ $.Params.photo_alt }}" width="112" height="112">{{ end }}
|
||||
<h1 class="lib-name">{{ .Title }}</h1>
|
||||
{{ with .Content }}<div class="lib-bio">{{ . }}</div>{{ end }}
|
||||
<ul class="lib-links">
|
||||
{{ range .Params.links }}<li><a class="lib-link" href="{{ .url }}"><span>{{ .text }}</span>{{ with .note }}<small>{{ . }}</small>{{ end }}</a></li>{{ end }}
|
||||
</ul>
|
||||
<p class="lib-home"><a href="/">{{ .Site.Config.Name }}</a></p>
|
||||
</div>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,24 @@
|
||||
name: link-in-bio
|
||||
version: 1.0.0
|
||||
title: Link in bio
|
||||
description: One page with your picture, a line about you and big buttons to everywhere else, for the link in a social profile.
|
||||
license: MIT
|
||||
author: Coffey Labs LLC
|
||||
notes: |
|
||||
Make a page with layout: links, such as content/links.md:
|
||||
|
||||
---
|
||||
title: Bakery on Main
|
||||
summary: Fresh bread in Springfield since 2019.
|
||||
layout: links
|
||||
photo: /media/logo.webp
|
||||
photo_alt: The bakery's logo
|
||||
links:
|
||||
- { text: Order for pick-up, url: /order/, note: Ready by 7am }
|
||||
- { text: This week's menu, url: /menu/ }
|
||||
- { text: Mastodon, url: "https://example.social/@bakery" }
|
||||
---
|
||||
Sourdough, rye and pastries, baked from 4am.
|
||||
|
||||
Then put https://your.site/links/ in your social profiles. The page has
|
||||
no menu, only your links, and the site's footer.
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Coffey Labs LLC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,8 @@
|
||||
# Logo wall pack
|
||||
|
||||
A grid of logos for customers, sponsors, partners or "as seen in", each
|
||||
optionally linked, in three sizes. `muted` shows them in gray until pointed
|
||||
at, so logos in many colors sit well together. It's a still grid: a moving
|
||||
carousel would need a script, and packs carry none.
|
||||
|
||||
hotdog-cms pack add logo-wall
|
||||
@@ -0,0 +1,20 @@
|
||||
/* The logo wall pack. Colors come from the theme's variables. */
|
||||
.lw-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(var(--lw-min, 160px), 1fr)); }
|
||||
.lw-small { --lw-min: 120px; --lw-h: 36px; }
|
||||
.lw-medium { --lw-min: 160px; --lw-h: 48px; }
|
||||
.lw-large { --lw-min: 220px; --lw-h: 68px; }
|
||||
.lw-grid li { display: grid; place-items: center; padding: 18px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
|
||||
.lw-grid a { display: grid; place-items: center; width: 100%; }
|
||||
.lw-grid img { max-height: var(--lw-h, 48px); max-width: 100%; width: auto; height: auto; object-fit: contain; }
|
||||
.lw-muted img { filter: grayscale(1); opacity: .7; transition: filter .2s, opacity .2s; }
|
||||
.lw-muted li:hover img, .lw-muted a:focus-visible img { filter: none; opacity: 1; }
|
||||
.lw-light li { background: #fff; }
|
||||
/* Dark mode: gray on a dark tile is too faint, so muted logos become light
|
||||
outlines, and stay so when pointed at (their own colors may be dark). */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
:root:not([data-theme="light"]) .lw-muted:not(.lw-light) img { filter: grayscale(1) brightness(0) invert(1); opacity: .65; }
|
||||
:root:not([data-theme="light"]) .lw-muted:not(.lw-light) li:hover img { filter: grayscale(1) brightness(0) invert(1); opacity: 1; }
|
||||
}
|
||||
[data-theme="dark"] .lw-muted:not(.lw-light) img { filter: grayscale(1) brightness(0) invert(1); opacity: .65; }
|
||||
[data-theme="dark"] .lw-muted:not(.lw-light) li:hover img { filter: grayscale(1) brightness(0) invert(1); opacity: 1; }
|
||||
.lw-grid a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 6px; }
|
||||
@@ -0,0 +1,21 @@
|
||||
name: logo-wall
|
||||
version: 1.0.0
|
||||
title: Logo wall
|
||||
description: A grid of logos, for customers, sponsors, partners or "as seen in".
|
||||
license: MIT
|
||||
author: Coffey Labs LLC
|
||||
notes: |
|
||||
Put the logos in static/media/ and add a "Logos" section to any page:
|
||||
|
||||
sections:
|
||||
- logos:
|
||||
heading: As seen in
|
||||
muted: true
|
||||
items:
|
||||
- { name: Springfield Times, logo: /media/times.png, link: "https://example.com/our-story" }
|
||||
|
||||
muted shows them in gray until pointed at, so logos in many colors sit
|
||||
well together; in dark mode they become light outlines, which suits logos
|
||||
on a see-through background (PNG or SVG). For logos that come on white,
|
||||
set light_tiles: true to put each on a white tile. Logos can be SVG files of your own (the pack can't carry
|
||||
any, but your site can). Ask before using someone's logo.
|
||||
@@ -0,0 +1,29 @@
|
||||
{{/* section
|
||||
label: Logos
|
||||
about: A grid of logos, for customers, sponsors, partners or "as seen in".
|
||||
fields:
|
||||
- { name: heading, type: text }
|
||||
- { name: intro, type: markdown }
|
||||
- name: items
|
||||
type: list
|
||||
label: Logos
|
||||
fields:
|
||||
- { name: name, type: text, required: true, help: Also the logo's alt text. }
|
||||
- { name: logo, type: image, required: true }
|
||||
- { name: link, type: link, help: Optional. }
|
||||
- { name: from, type: data, label: Logos from, help: A file in data/ that holds the logos. Leave empty to use the logos above. }
|
||||
- { name: muted, type: bool, label: Gray until pointed at, help: "In dark mode, light outlines: best with logos on a see-through background." }
|
||||
- { name: light_tiles, type: bool, label: White behind each logo, help: For logos that come on a white background. }
|
||||
- { name: size, type: select, options: [small, medium, large], default: medium }
|
||||
*/}}
|
||||
{{ $items := .Data.items }}{{ with .Data.from }}{{ $items = data . }}{{ end }}
|
||||
<link rel="stylesheet" href="{{ asset "packs/logo-wall/logo-wall.css" }}">
|
||||
<section class="block logo-wall">
|
||||
<div class="wrap">
|
||||
{{ with .Data.heading }}<h2>{{ . }}</h2>{{ end }}
|
||||
{{ with .Data.intro }}<div class="intro">{{ markdownify . }}</div>{{ end }}
|
||||
<ul class="lw-grid lw-{{ default "medium" .Data.size }}{{ if .Data.muted }} lw-muted{{ end }}{{ if .Data.light_tiles }} lw-light{{ end }}">
|
||||
{{ range $items }}<li>{{ if .link }}<a href="{{ .link }}"><img src="{{ .logo }}" alt="{{ .name }}" loading="lazy"></a>{{ else }}<img src="{{ .logo }}" alt="{{ .name }}" loading="lazy">{{ end }}</li>{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
+1
-1
@@ -5,5 +5,5 @@ package packs
|
||||
|
||||
import "embed"
|
||||
|
||||
//go:embed all:author-box all:breadcrumbs all:calendar all:changelog all:contact-forms all:docs all:downloads all:faq all:gallery all:jobs all:location-and-hours all:menu-and-prices all:payment-links all:podcast all:portfolio all:recipes all:related-posts all:series all:share-links all:shop all:table-of-contents all:tables all:team all:testimonials
|
||||
//go:embed all:author-box all:breadcrumbs all:calendar all:changelog all:coming-soon all:contact-forms all:directory all:docs all:downloads all:faq all:gallery all:glossary all:jobs all:link-in-bio all:location-and-hours all:logo-wall all:menu-and-prices all:payment-links all:podcast all:portfolio all:recipes all:related-posts all:reviews all:series all:share-links all:shop all:status-page all:table-of-contents all:tables all:team all:testimonials all:timeline all:videos
|
||||
var FS embed.FS
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Coffey Labs LLC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,11 @@
|
||||
# Reviews pack
|
||||
|
||||
Customers' star ratings, with the average and how many there are: as a
|
||||
section on any page, or under a product of the shop pack.
|
||||
|
||||
hotdog-cms pack add reviews
|
||||
|
||||
Stars are text (★), with "4 out of 5 stars" for screen readers. A product's
|
||||
reviews give search engines its rating (AggregateRating). A business's
|
||||
reviews of itself give none, because search engines ignore a business's
|
||||
ratings on its own site.
|
||||
@@ -0,0 +1,11 @@
|
||||
/* The reviews pack. Colors come from the theme's variables. */
|
||||
.rv-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin: 0 0 18px; font-size: 1.05rem; }
|
||||
.rv-summary b { font-size: 1.3rem; }
|
||||
.rv-stars { margin: 0; color: var(--accent); letter-spacing: .08em; font-size: 1.1rem; line-height: 1; }
|
||||
.rv-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
|
||||
.rv-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
|
||||
.rv-item { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: grid; gap: 8px; align-content: start; }
|
||||
.rv-text { margin: 0; padding: 0; border: 0; font-size: 1rem; }
|
||||
.rv-text > :first-child { margin-top: 0; }
|
||||
.rv-text > :last-child { margin-bottom: 0; }
|
||||
.rv-who { margin: 0; color: var(--muted); font-size: .9rem; }
|
||||
@@ -0,0 +1,30 @@
|
||||
name: reviews
|
||||
version: 1.0.0
|
||||
title: Reviews
|
||||
description: Star ratings from customers, with the average and how many, as a section or under a product.
|
||||
license: MIT
|
||||
author: Coffey Labs LLC
|
||||
notes: |
|
||||
Add a "Reviews" section to any page, in the editor's section library or
|
||||
in the page's front matter:
|
||||
|
||||
sections:
|
||||
- reviews:
|
||||
heading: What customers say
|
||||
items:
|
||||
- name: Maria Lopez
|
||||
rating: 5
|
||||
date: 2026-09-14
|
||||
text: The best sourdough in town.
|
||||
source: Google
|
||||
|
||||
rating is 1 to 5. To share reviews between pages, put them in
|
||||
data/reviews.yaml (a list like the one above) and set from: reviews.
|
||||
|
||||
For a product (the shop pack), list its reviews as reviews: in the
|
||||
product's front matter and add {{ template "reviews" . }} to
|
||||
layouts/product.html. Search engines then get the product's rating
|
||||
(AggregateRating). Reviews of the business itself get no search-engine
|
||||
data: search engines ignore a business's ratings on its own site.
|
||||
|
||||
Only publish reviews people really wrote, with their permission.
|
||||
@@ -0,0 +1,6 @@
|
||||
{{/* One review: stars, words, who and when. */}}
|
||||
<li class="rv-item">
|
||||
{{ with .rating }}<p class="rv-stars"><span aria-hidden="true">{{ stars . }}</span><span class="rv-sr">{{ . }} out of 5 stars</span></p>{{ end }}
|
||||
{{ with .text }}<blockquote class="rv-text">{{ markdownify . }}</blockquote>{{ end }}
|
||||
<p class="rv-who">{{ .name }}{{ with .date }} · {{ formatDate "January 2006" . }}{{ end }}{{ with .source }} · {{ . }}{{ end }}</p>
|
||||
</li>
|
||||
@@ -0,0 +1,4 @@
|
||||
{{/* The average of a list of reviews and how many there are. */}}
|
||||
{{ $r := ratings . }}{{ if $r.Count }}
|
||||
<p class="rv-summary"><span class="rv-stars" aria-hidden="true">{{ stars $r.Average }}</span> <b>{{ $r.Average }}</b> out of 5 · {{ $r.Count }} review{{ if ne $r.Count 1 }}s{{ end }}</p>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,9 @@
|
||||
{{/* A page's own reviews (reviews: in its front matter), such as a product's. */}}
|
||||
{{ with .Params.reviews }}
|
||||
<link rel="stylesheet" href="{{ asset "packs/reviews/reviews.css" }}">
|
||||
<section class="reviews" aria-labelledby="reviews-heading">
|
||||
<h2 id="reviews-heading">Reviews</h2>
|
||||
{{ template "review-summary" . }}
|
||||
<ul class="rv-list">{{ range . }}{{ template "review-item" . }}{{ end }}</ul>
|
||||
</section>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,28 @@
|
||||
{{/* section
|
||||
label: Reviews
|
||||
about: Star ratings from customers, with the average and how many.
|
||||
fields:
|
||||
- { name: heading, type: text, default: What customers say }
|
||||
- { name: intro, type: markdown }
|
||||
- name: items
|
||||
type: list
|
||||
label: Reviews
|
||||
fields:
|
||||
- { name: name, type: text, required: true }
|
||||
- { name: rating, type: number, required: true, help: 1 to 5. }
|
||||
- { name: text, type: markdown, label: What they said }
|
||||
- { name: date, type: text, help: "When, such as 2026-09-14." }
|
||||
- { name: source, type: text, help: "Where it was posted, such as Google." }
|
||||
- { name: from, type: data, label: Reviews from, help: A file in data/ that holds the reviews, to share them between pages. Leave empty to use the reviews above. }
|
||||
- { name: no_summary, type: bool, label: Hide the average }
|
||||
*/}}
|
||||
{{ $items := .Data.items }}{{ with .Data.from }}{{ $items = data . }}{{ end }}
|
||||
<link rel="stylesheet" href="{{ asset "packs/reviews/reviews.css" }}">
|
||||
<section class="block reviews">
|
||||
<div class="wrap">
|
||||
{{ with .Data.heading }}<h2>{{ . }}</h2>{{ end }}
|
||||
{{ with .Data.intro }}<div class="intro">{{ markdownify . }}</div>{{ end }}
|
||||
{{ if not .Data.no_summary }}{{ template "review-summary" $items }}{{ end }}
|
||||
<ul class="rv-list">{{ range $items }}{{ template "review-item" . }}{{ end }}</ul>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Coffey Labs LLC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,12 @@
|
||||
# Status page pack
|
||||
|
||||
A status page: whether each of your services is working, an overall line
|
||||
that follows from them, the incidents still open, and the past ones, with a
|
||||
page per incident and a feed people can follow.
|
||||
|
||||
hotdog-cms pack add status-page
|
||||
|
||||
Components and how they're doing live in `data/status.yaml`; incidents are
|
||||
pages in `content/incidents/`, updated as they go. The page changes when
|
||||
the site is published, so publish after each update. Keep it on a different
|
||||
host from the services it reports on.
|
||||
@@ -0,0 +1,29 @@
|
||||
/* The status page pack. Theme colors, plus a green, amber, red and blue for
|
||||
the states, which keep their meaning in light and dark. */
|
||||
.status, .incident, .incidents { --st-ok: #1f8a4c; --st-part: #b26a00; --st-down: #c0392b; --st-maint: #2f6fd1; }
|
||||
@media (prefers-color-scheme: dark) { .status, .incident, .incidents { --st-ok: #4cc27f; --st-part: #f0a63a; --st-down: #ff6b5e; --st-maint: #6fa3ff; } }
|
||||
[data-theme="dark"] :is(.status, .incident, .incidents) { --st-ok: #4cc27f; --st-part: #f0a63a; --st-down: #ff6b5e; --st-maint: #6fa3ff; }
|
||||
[data-theme="light"] :is(.status, .incident, .incidents) { --st-ok: #1f8a4c; --st-part: #b26a00; --st-down: #c0392b; --st-maint: #2f6fd1; }
|
||||
.st-overall { --c: var(--st-ok); margin: 0 0 22px; padding: 18px 20px; border-radius: var(--radius); border: 1px solid var(--c); border-left-width: 6px; background: var(--surface); font-weight: 700; font-size: 1.15rem; }
|
||||
.st-overall small { display: block; margin-top: 4px; color: var(--muted); font-weight: 500; font-size: .85rem; }
|
||||
.st-overall.st-degraded { --c: var(--st-part); } .st-overall.st-outage { --c: var(--st-down); } .st-overall.st-maintenance { --c: var(--st-maint); }
|
||||
.st-components { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
|
||||
.st-components li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 18px; border-bottom: 1px solid var(--line); }
|
||||
.st-components li:last-child { border-bottom: 0; }
|
||||
.st-name { font-weight: 600; display: grid; }
|
||||
.st-name small { color: var(--muted); font-weight: 400; }
|
||||
.st-badge { --c: var(--st-ok); display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: .85rem; font-weight: 650; color: var(--c); }
|
||||
.st-badge::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
|
||||
.st-degraded, .st-identified, .st-monitoring { --c: var(--st-part); }
|
||||
.st-outage, .st-investigating { --c: var(--st-down); }
|
||||
.st-maintenance { --c: var(--st-maint); }
|
||||
.st-resolved { --c: var(--muted); }
|
||||
.st-h { margin: 28px 0 10px; font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
|
||||
.st-incidents { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 10px; }
|
||||
.st-incident { padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
|
||||
.st-inc-title { font-weight: 650; }
|
||||
.st-inc-meta { margin: 4px 0 0; color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
|
||||
.st-more { margin-top: 18px; font-size: .92rem; }
|
||||
.st-facts { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 0 0 24px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); }
|
||||
.st-facts dt { color: var(--muted); font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
|
||||
.st-facts dd { margin: 2px 0 0; font-weight: 600; }
|
||||
@@ -0,0 +1,10 @@
|
||||
{{ define "main" }}
|
||||
<link rel="stylesheet" href="{{ asset "packs/status-page/status-page.css" }}">
|
||||
<section class="wrap page incidents">
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ with .Content }}<div class="prose">{{ . }}</div>{{ end }}
|
||||
<p class="st-more"><a href="/{{ .Collection }}/feed.xml">Follow in a feed reader</a></p>
|
||||
{{ with .Paginator.Items }}<ul class="st-incidents">{{ range . }}{{ template "incident-row" . }}{{ end }}</ul>{{ else }}<p>No incidents so far.</p>{{ end }}
|
||||
{{ template "pagination" . }}
|
||||
</section>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,14 @@
|
||||
{{ define "main" }}
|
||||
<link rel="stylesheet" href="{{ asset "packs/status-page/status-page.css" }}">
|
||||
<article class="wrap page incident">
|
||||
{{ with index .Site.Lists .Collection }}<p class="eyebrow"><a href="{{ .Path }}">{{ .Title }}</a></p>{{ end }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
<dl class="st-facts">
|
||||
<div><dt>Status</dt><dd><span class="st-badge st-{{ default "investigating" .Params.status }}">{{ template "status-label" (default "investigating" .Params.status) }}</span></dd></div>
|
||||
<div><dt>Started</dt><dd><time datetime="{{ date "rfc3339" .Date }}">{{ date "January 2, 2006, 3:04 PM" .Date }}</time></dd></div>
|
||||
{{ with .Params.resolved }}<div><dt>Fixed</dt><dd>{{ formatDate "January 2, 2006, 3:04 PM" . }}</dd></div>{{ end }}
|
||||
{{ with .Params.affects }}<div><dt>Affects</dt><dd>{{ if kindIs "list" . }}{{ joinAny ", " . }}{{ else }}{{ . }}{{ end }}</dd></div>{{ end }}
|
||||
</dl>
|
||||
{{ with .Content }}<div class="prose st-updates">{{ . }}</div>{{ end }}
|
||||
</article>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,47 @@
|
||||
name: status-page
|
||||
version: 1.0.0
|
||||
title: Status page
|
||||
description: Whether your services are working, what's wrong when they aren't, and the history of incidents, with a feed to follow.
|
||||
license: MIT
|
||||
author: Coffey Labs LLC
|
||||
collections:
|
||||
incidents:
|
||||
layout: incident
|
||||
list_layout: incident-list
|
||||
feed: true
|
||||
notes: |
|
||||
Say how each service is doing in data/status.yaml:
|
||||
|
||||
components:
|
||||
- { name: Website, status: operational }
|
||||
- { name: Online ordering, status: degraded, note: Checkout is slow. }
|
||||
|
||||
status is operational, degraded, outage or maintenance. Then add a
|
||||
"Status" section to a page, such as content/status.md:
|
||||
|
||||
---
|
||||
title: Status
|
||||
summary: Whether everything is working.
|
||||
layout: landing
|
||||
sections:
|
||||
- status: {}
|
||||
---
|
||||
|
||||
When something goes wrong, add content/incidents/<name>.md, with the
|
||||
newest update at the top:
|
||||
|
||||
---
|
||||
title: Online ordering is slow
|
||||
date: 2027-01-12 08:10
|
||||
status: monitoring # investigating, identified, monitoring or resolved
|
||||
resolved: 2027-01-12 09:30 # when it was fixed, once it is
|
||||
affects: [Online ordering]
|
||||
---
|
||||
**09:05** A fix is in; we're watching it.
|
||||
|
||||
**08:10** Checkout is taking up to a minute. We're looking into it.
|
||||
|
||||
The page changes when the site is published, so publish after each
|
||||
update. People can follow /incidents/feed.xml. Keep the status page on a
|
||||
different host from the services it reports on, so it's up when they
|
||||
aren't.
|
||||
@@ -0,0 +1,5 @@
|
||||
{{/* One incident in a list: what, when, how it stands. */}}
|
||||
<li class="st-incident">
|
||||
<a class="st-inc-title" href="{{ .Href }}">{{ .Title }}</a>
|
||||
<p class="st-inc-meta"><span class="st-badge st-{{ default "investigating" .Params.status }}">{{ template "status-label" (default "investigating" .Params.status) }}</span> <time datetime="{{ date "rfc3339" .Date }}">{{ date "January 2, 2006, 3:04 PM" .Date }}</time>{{ with .Params.affects }} · {{ if kindIs "list" . }}{{ joinAny ", " . }}{{ else }}{{ . }}{{ end }}{{ end }}</p>
|
||||
</li>
|
||||
@@ -0,0 +1,2 @@
|
||||
{{- $s := print . -}}
|
||||
{{- if eq $s "operational" }}Working{{ else if eq $s "degraded" }}Partly working{{ else if eq $s "outage" }}Down{{ else if eq $s "maintenance" }}Maintenance{{ else if eq $s "investigating" }}Investigating{{ else if eq $s "identified" }}Cause found{{ else if eq $s "monitoring" }}Fixed, watching{{ else if eq $s "resolved" }}Resolved{{ else }}{{ $s }}{{ end -}}
|
||||
@@ -0,0 +1,32 @@
|
||||
{{/* section
|
||||
label: Status
|
||||
about: Whether each service is working, the overall picture, and recent incidents.
|
||||
fields:
|
||||
- { name: heading, type: text }
|
||||
- { name: from, type: data, default: status, label: Status from, help: The file in data/ with your components. }
|
||||
- { name: collection, type: collection, default: incidents, label: Incidents from }
|
||||
- { name: count, type: number, default: 5, label: Recent incidents to show }
|
||||
*/}}
|
||||
{{ $d := data (default "status" .Data.from) }}{{ $c := default "incidents" .Data.collection }}
|
||||
{{ $down := false }}{{ $part := false }}{{ $maint := false }}
|
||||
{{ range $d.components }}{{ $s := print .status }}{{ if eq $s "outage" }}{{ $down = true }}{{ else if eq $s "degraded" }}{{ $part = true }}{{ else if eq $s "maintenance" }}{{ $maint = true }}{{ end }}{{ end }}
|
||||
{{ $open := list }}{{ $past := list }}{{ range collection $c }}{{ if eq (print .Params.status) "resolved" }}{{ $past = append $past . }}{{ else }}{{ $open = append $open . }}{{ end }}{{ end }}
|
||||
<link rel="stylesheet" href="{{ asset "packs/status-page/status-page.css" }}">
|
||||
<section class="block status">
|
||||
<div class="wrap">
|
||||
{{ with .Data.heading }}<h2>{{ . }}</h2>{{ end }}
|
||||
<p class="st-overall {{ if $down }}st-outage{{ else if or $part $open }}st-degraded{{ else if $maint }}st-maintenance{{ else }}st-operational{{ end }}">{{ if $down }}Something is down.{{ else if or $part $open }}Some things aren't working as they should.{{ else if $maint }}Maintenance is under way.{{ else }}Everything is working.{{ end }} <small>As of {{ date "January 2, 2006, 3:04 PM" now }}.</small></p>
|
||||
{{ with $open }}
|
||||
<h3 class="st-h">Now</h3>
|
||||
<ul class="st-incidents">{{ range . }}{{ template "incident-row" . }}{{ end }}</ul>
|
||||
{{ end }}
|
||||
<ul class="st-components">
|
||||
{{ range $d.components }}<li><span class="st-name">{{ .name }}{{ with .note }}<small>{{ . }}</small>{{ end }}</span><span class="st-badge st-{{ default "operational" .status }}">{{ template "status-label" (default "operational" .status) }}</span></li>{{ end }}
|
||||
</ul>
|
||||
{{ with $past }}
|
||||
<h3 class="st-h">Past incidents</h3>
|
||||
<ul class="st-incidents">{{ range limit (default 5 $.Data.count) . }}{{ template "incident-row" . }}{{ end }}</ul>
|
||||
{{ end }}
|
||||
<p class="st-more"><a href="/{{ $c }}/">Every incident</a> · <a href="/{{ $c }}/feed.xml">Follow in a feed reader</a></p>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Coffey Labs LLC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,7 @@
|
||||
# Timeline pack
|
||||
|
||||
Dates down a line, with what happened at each: a company's history, a
|
||||
project's milestones, the order of a wedding day. Each moment has a date
|
||||
written as you like, a title, Markdown text and an optional picture.
|
||||
|
||||
hotdog-cms pack add timeline
|
||||
@@ -0,0 +1,13 @@
|
||||
/* The timeline pack. Colors come from the theme's variables. */
|
||||
.tl-list { list-style: none; margin: 0; padding: 0; max-width: 760px; position: relative; }
|
||||
.tl-list::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
|
||||
.tl-item { position: relative; padding: 0 0 28px 36px; }
|
||||
.tl-item:last-child { padding-bottom: 0; }
|
||||
.tl-item::before { content: ""; position: absolute; left: 0; top: 5px; width: 16px; height: 16px; border-radius: 50%; background: var(--bg, var(--surface)); border: 3px solid var(--accent); box-sizing: border-box; }
|
||||
.tl-when { margin: 0; color: var(--accent); font-weight: 700; font-size: .9rem; letter-spacing: .03em; }
|
||||
.tl-title { margin: 2px 0 0; font-size: 1.15rem; }
|
||||
.tl-text { margin-top: 4px; }
|
||||
.tl-text > :first-child { margin-top: 0; }
|
||||
.tl-text > :last-child { margin-bottom: 0; }
|
||||
.tl-image { display: block; margin-top: 12px; max-width: 100%; border-radius: var(--radius); border: 1px solid var(--line); }
|
||||
@media (min-width: 760px) { .tl-item { display: grid; grid-template-columns: 140px 1fr; gap: 0 24px; padding-left: 36px; } .tl-when { padding-top: 2px; } }
|
||||
@@ -0,0 +1,19 @@
|
||||
name: timeline
|
||||
version: 1.0.0
|
||||
title: Timeline
|
||||
description: Dates down a line, with what happened at each, for a history, a project's milestones or a wedding day.
|
||||
license: MIT
|
||||
author: Coffey Labs LLC
|
||||
notes: |
|
||||
Add a "Timeline" section to any page:
|
||||
|
||||
sections:
|
||||
- timeline:
|
||||
heading: How we got here
|
||||
items:
|
||||
- { when: "2019", title: The first loaf, text: "Baked in a home kitchen, sold at the Saturday market." }
|
||||
- { when: "2021", title: Main Street, text: "Our own shop, with a real oven." }
|
||||
|
||||
The items show in the order they're written. text is Markdown, and an
|
||||
item can have an image and image_alt. To share one timeline between
|
||||
pages, put the items in data/timeline.yaml and set from: timeline.
|
||||
@@ -0,0 +1,37 @@
|
||||
{{/* section
|
||||
label: Timeline
|
||||
about: Dates down a line, with what happened at each.
|
||||
fields:
|
||||
- { name: heading, type: text }
|
||||
- { name: intro, type: markdown }
|
||||
- name: items
|
||||
type: list
|
||||
label: Moments
|
||||
fields:
|
||||
- { name: when, type: text, required: true, help: "As you'd write it: 2019, Spring 2021, 9:30am." }
|
||||
- { name: title, type: text, required: true }
|
||||
- { name: text, type: markdown }
|
||||
- { name: image, type: image }
|
||||
- { name: image_alt, type: text, label: What the picture shows }
|
||||
- { name: from, type: data, label: Moments from, help: A file in data/ that holds the moments. Leave empty to use the ones above. }
|
||||
*/}}
|
||||
{{ $items := .Data.items }}{{ with .Data.from }}{{ $items = data . }}{{ end }}
|
||||
<link rel="stylesheet" href="{{ asset "packs/timeline/timeline.css" }}">
|
||||
<section class="block timeline">
|
||||
<div class="wrap">
|
||||
{{ with .Data.heading }}<h2>{{ . }}</h2>{{ end }}
|
||||
{{ with .Data.intro }}<div class="intro">{{ markdownify . }}</div>{{ end }}
|
||||
<ol class="tl-list">
|
||||
{{ range $it := $items }}
|
||||
<li class="tl-item">
|
||||
<p class="tl-when">{{ .when }}</p>
|
||||
<div class="tl-body">
|
||||
<h3 class="tl-title">{{ .title }}</h3>
|
||||
{{ with .text }}<div class="tl-text">{{ markdownify . }}</div>{{ end }}
|
||||
{{ with .image }}<img class="tl-image" src="{{ . }}" alt="{{ default "" $it.image_alt }}" loading="lazy">{{ end }}
|
||||
</div>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ol>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 Coffey Labs LLC
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,11 @@
|
||||
# Videos pack
|
||||
|
||||
A video library from your own files: a page per video with its player,
|
||||
captions and transcript; `/videos/` with every poster; a feed of new videos;
|
||||
and a "Latest videos" section for any page. Videos with a poster and a date
|
||||
are described to search engines (VideoObject).
|
||||
|
||||
hotdog-cms pack add videos
|
||||
|
||||
Nothing is embedded from YouTube or anywhere else, so nothing tracks your
|
||||
visitors. For one video on a page, the starter's Video section is enough.
|
||||
@@ -0,0 +1,14 @@
|
||||
/* The videos pack. Colors come from the theme's variables. */
|
||||
.vid-player { margin: 18px 0; }
|
||||
.vid-player video { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); background: #000; }
|
||||
.vid-meta { margin: 4px 0 0; color: var(--muted); }
|
||||
.vid-summary { font-size: 1.05rem; }
|
||||
.vid-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
|
||||
.vid-card a { display: grid; gap: 8px; text-decoration: none; color: var(--text); }
|
||||
.vid-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: var(--accent-soft); border: 1px solid var(--line); }
|
||||
.vid-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
|
||||
.vid-card a:hover .vid-thumb img { transform: scale(1.03); }
|
||||
.vid-card a:focus-visible .vid-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
|
||||
.vid-len { position: absolute; right: 8px; bottom: 8px; padding: 2px 7px; border-radius: 6px; background: rgba(0, 0, 0, .75); color: #fff; font-size: .8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
|
||||
.vid-title { font-weight: 650; }
|
||||
.vid-date { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
|
||||
@@ -0,0 +1,9 @@
|
||||
{{ define "main" }}
|
||||
<link rel="stylesheet" href="{{ asset "packs/videos/videos.css" }}">
|
||||
<section class="wrap page videos">
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ with .Content }}<div class="prose">{{ . }}</div>{{ end }}
|
||||
<ul class="vid-grid">{{ range .Paginator.Items }}{{ template "video-card" . }}{{ end }}</ul>
|
||||
{{ template "pagination" . }}
|
||||
</section>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,11 @@
|
||||
{{ define "main" }}
|
||||
<link rel="stylesheet" href="{{ asset "packs/videos/videos.css" }}">
|
||||
<article class="wrap page video-page">
|
||||
{{ with index .Site.Lists .Collection }}<p class="eyebrow"><a href="{{ .Path }}">{{ .Title }}</a></p>{{ end }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
<p class="vid-meta">{{ if not .Date.IsZero }}<time datetime="{{ date "iso" .Date }}">{{ date "January 2, 2006" .Date }}</time>{{ end }}{{ with .Params.duration }} · {{ . }}{{ end }}</p>
|
||||
{{ template "video-player" . }}
|
||||
{{ with .Summary }}<p class="vid-summary">{{ . }}</p>{{ end }}
|
||||
{{ with .Content }}<div class="prose vid-notes">{{ . }}</div>{{ end }}
|
||||
</article>
|
||||
{{ end }}
|
||||
@@ -0,0 +1,35 @@
|
||||
name: videos
|
||||
version: 1.0.0
|
||||
title: Videos
|
||||
description: A video library, with a page per video, its transcript, a list, a feed and a "Latest videos" section, all from your own files.
|
||||
license: MIT
|
||||
author: Coffey Labs LLC
|
||||
collections:
|
||||
videos:
|
||||
layout: video
|
||||
list_layout: video-list
|
||||
feed: true
|
||||
notes: |
|
||||
Put each video's files in static/media/ and add it as
|
||||
content/videos/<name>.md:
|
||||
|
||||
---
|
||||
title: Shaping a boule
|
||||
date: 2027-01-12
|
||||
summary: Two minutes, one loaf, no special tools.
|
||||
video: /media/shaping.mp4
|
||||
webm: /media/shaping.webm # optional, smaller
|
||||
poster: /media/shaping.webp # the picture shown before it plays
|
||||
captions: /media/shaping.vtt # optional WebVTT captions
|
||||
duration: "2:14"
|
||||
---
|
||||
The transcript, or notes about the video.
|
||||
|
||||
/videos/ lists every video with its poster, and /videos/feed.xml lets
|
||||
people follow new ones. Add a "Latest videos" section to any page to show
|
||||
the newest few. Videos with a poster and a date are described to search
|
||||
engines (VideoObject).
|
||||
|
||||
The videos are your own files, played by the visitor's browser: no
|
||||
YouTube or other player, so nothing tracks your visitors. For one video
|
||||
on a page, the starter's Video section is enough.
|
||||
@@ -0,0 +1,8 @@
|
||||
{{/* One video in a list: its poster, title, length and date. */}}
|
||||
<li class="vid-card">
|
||||
<a href="{{ .Href }}">
|
||||
<span class="vid-thumb">{{ with .Params.poster }}<img src="{{ . }}" alt="" loading="lazy">{{ end }}{{ with .Params.duration }}<span class="vid-len">{{ . }}</span>{{ end }}</span>
|
||||
<span class="vid-title">{{ .Title }}</span>
|
||||
</a>
|
||||
{{ if not .Date.IsZero }}<p class="vid-date"><time datetime="{{ date "iso" .Date }}">{{ date "January 2, 2006" .Date }}</time></p>{{ end }}
|
||||
</li>
|
||||
@@ -0,0 +1,9 @@
|
||||
{{/* A video page's player, from its front matter: video, webm, poster, captions. */}}
|
||||
<figure class="vid-player">
|
||||
<video controls preload="metadata" playsinline{{ with .Params.poster }} poster="{{ . }}"{{ end }}>
|
||||
{{ with .Params.webm }}<source src="{{ . }}" type="video/webm">{{ end }}
|
||||
{{ with .Params.video }}<source src="{{ . }}" type="video/mp4">{{ end }}
|
||||
{{ with .Params.captions }}<track kind="captions" src="{{ . }}" srclang="{{ $.Site.Config.Language }}" label="Captions" default>{{ end }}
|
||||
<a href="{{ .Params.video }}">Download the video</a>
|
||||
</video>
|
||||
</figure>
|
||||
@@ -0,0 +1,17 @@
|
||||
{{/* section
|
||||
label: Latest videos
|
||||
about: The newest videos from the video library, with their posters.
|
||||
fields:
|
||||
- { name: heading, type: text, default: Latest videos }
|
||||
- { name: collection, type: collection, default: videos, label: Videos from }
|
||||
- { name: count, type: number, default: 3, label: How many }
|
||||
*/}}
|
||||
{{ $c := default "videos" .Data.collection }}
|
||||
<link rel="stylesheet" href="{{ asset "packs/videos/videos.css" }}">
|
||||
<section class="block videos">
|
||||
<div class="wrap">
|
||||
{{ with .Data.heading }}<h2>{{ . }}</h2>{{ end }}
|
||||
<ul class="vid-grid">{{ range limit (default 3 .Data.count) (collection $c) }}{{ template "video-card" . }}{{ end }}</ul>
|
||||
<p><a class="more" href="/{{ $c }}/">Every video</a></p>
|
||||
</div>
|
||||
</section>
|
||||
Reference in new issue
Block a user