|
| 1 | +# ── Resource detail-page config ───────────────────────────────────────────── |
| 2 | +# Drives layouts/partials/resources/detail-card.html: the hero media shape, |
| 3 | +# what the primary/secondary action buttons say and link to, and which rows |
| 4 | +# appear in the sticky "Details" panel — in order, per resources subsection. |
| 5 | +# |
| 6 | +# Every field is optional at the CONTENT level: a field whose param has no |
| 7 | +# value for a given resource just doesn't render (no placeholder row) — that |
| 8 | +# is the whole point of driving this from data instead of hardcoding a fixed |
| 9 | +# column list per category (a 5th category is a new entry here, not new |
| 10 | +# template code). `only_if: past` is the one row gated on something other |
| 11 | +# than "value present" (Events' Recording row — see detail-card.html). |
| 12 | +# |
| 13 | +# Field types the template understands: |
| 14 | +# category — always .Parent.Title |
| 15 | +# subcategory — .Params.subcategories, comma-joined |
| 16 | +# text — .Params.<param> as-is (comma-joined if it's a list) |
| 17 | +# domain_link — .Params.<param> is a URL; shown as its bare domain, |
| 18 | +# optionally prefixed with `prefix` (e.g. "Watch on ") |
| 19 | +# github_link — .Params.<param>, "owner/repo" shorthand or full URL |
| 20 | +# link — .Params.<param> is a URL; shown as this field's `text` |
| 21 | +# member_badge — only when .Params.member is exactly `true` |
| 22 | +# last_reviewed — .Params.<param>, a date; shown with "by OurSQL editorial team" |
| 23 | +# date_range — .Date (start) plus optional .Params.date_end |
| 24 | + |
| 25 | +software: &standard_fields |
| 26 | + media: square |
| 27 | + primary_action: {label: "Visit website", param: link} |
| 28 | + secondary_action: {label: "View on GitHub", param: github, type: github} |
| 29 | + fields: |
| 30 | + - {key: category, label: Category, type: category} |
| 31 | + - {key: subcategory, label: Subcategory, type: subcategory} |
| 32 | + - {key: website, label: Website, type: domain_link, param: link} |
| 33 | + - {key: repository, label: Repository, type: github_link, param: github} |
| 34 | + - {key: member, label: "OurSQL Member", type: member_badge, param: member} |
| 35 | + - {key: last_reviewed, label: "Last reviewed", type: last_reviewed, param: last_reviewed} |
| 36 | + |
| 37 | +saas: *standard_fields |
| 38 | +services: *standard_fields |
| 39 | + |
| 40 | +community: |
| 41 | + media: square |
| 42 | + primary_action: {label: "Join the community", param: link} |
| 43 | + fields: |
| 44 | + - {key: category, label: Category, type: category} |
| 45 | + - {key: subcategory, label: Subcategory, type: subcategory} |
| 46 | + - {key: website, label: Website, type: domain_link, param: link} |
| 47 | + - {key: member, label: "OurSQL Member", type: member_badge, param: member} |
| 48 | + - {key: last_reviewed, label: "Last reviewed", type: last_reviewed, param: last_reviewed} |
| 49 | + |
| 50 | +training: |
| 51 | + media: square |
| 52 | + primary_action: {label: "Visit website", param: link} |
| 53 | + fields: |
| 54 | + - {key: category, label: Category, type: category} |
| 55 | + - {key: subcategory, label: Subcategory, type: subcategory} |
| 56 | + - {key: organization, label: Organization, type: text, param: author} |
| 57 | + # require_end: the training section's own `date` front matter has long |
| 58 | + # meant "sort/reference date" (see content/resources/training/_index.md's |
| 59 | + # `sort: date`), not "this specific cohort runs on this day" — showing it |
| 60 | + # here unqualified would misrepresent every self-paced/evergreen course as |
| 61 | + # a one-day event. Only a genuinely dated delivery (start AND end set) |
| 62 | + # shows this row; see RESOURCES.md. |
| 63 | + - {key: dates, label: "Date(s)", type: date_range, icon: calendar, require_end: true} |
| 64 | + - {key: website, label: Website, type: domain_link, param: link} |
| 65 | + - {key: last_reviewed, label: "Last reviewed", type: last_reviewed, param: last_reviewed} |
| 66 | + |
| 67 | +events: |
| 68 | + media: square |
| 69 | + # Primary action swaps by event state — handled directly in detail-card.html |
| 70 | + # (past → Watch recording / recording_url, future → Register / registration_url, |
| 71 | + # falling back to Visit website / link when neither applies) rather than as |
| 72 | + # config, since it's the one section where the action itself is conditional. |
| 73 | + secondary_action: {label: "Event website", param: link, type: link} |
| 74 | + fields: |
| 75 | + - {key: category, label: Category, type: category} |
| 76 | + - {key: subcategory, label: Subcategory, type: subcategory} |
| 77 | + - {key: dates, label: "Date(s)", type: date_range, icon: calendar} |
| 78 | + - {key: location, label: Location, type: location, icon: location} |
| 79 | + - {key: online, label: Online, type: domain_link, param: online_url} |
| 80 | + - {key: organizer, label: Organizer, type: text, param: organizers, list: true} |
| 81 | + - {key: registration, label: Registration, type: link, param: registration_url, text: Register} |
| 82 | + - {key: recording, label: Recording, type: domain_link, param: recording_url, prefix: "Watch on ", only_if: past} |
| 83 | + - {key: last_reviewed, label: "Last reviewed", type: last_reviewed, param: last_reviewed} |
| 84 | + |
| 85 | +books: |
| 86 | + media: portrait |
| 87 | + primary_action: {label: "Find the book", param: link} |
| 88 | + fields: |
| 89 | + - {key: category, label: Category, type: category} |
| 90 | + - {key: subcategory, label: Subcategory, type: subcategory} |
| 91 | + - {key: authors, label: Authors, type: text, param: authors, list: true} |
| 92 | + - {key: year, label: Year, type: text, param: year} |
| 93 | + - {key: website, label: Website, type: domain_link, param: link} |
| 94 | + - {key: last_reviewed, label: "Last reviewed", type: last_reviewed, param: last_reviewed} |
0 commit comments