diff --git a/assets/js/search-filter-sort.js b/assets/js/search-filter-sort.js index b8737fd69..999412e43 100644 --- a/assets/js/search-filter-sort.js +++ b/assets/js/search-filter-sort.js @@ -613,6 +613,13 @@ const imgClass = settings.image_class || ''; if (imgClass) imgClass.split(' ').filter(Boolean).forEach(c => img.classList.add(c)); } + } else if (entry.itemType === 'blog') { + const img = slot('image'); + if (img) { + img.src = '/images/pos-og.png'; + img.alt = entry.title || 'Blog post'; + img.classList.add('object-cover'); + } } else if (settings.placeholder_image) { const img = slot('image'); if (img) { @@ -643,15 +650,18 @@ const peopleEl = slot('people'); if (peopleEl) { peopleEl.classList.remove('hidden'); + const authorClass = settings.author_class || ''; + if (authorClass) authorClass.split(' ').filter(Boolean).forEach(c => peopleEl.classList.add(c)); + const frag = document.createDocumentFragment(); const wrapper = document.createElement('div'); - wrapper.className = 'flex flex-row gap-x-5 items-center'; + wrapper.className = 'mt-2 flex flex-row gap-x-4 items-center text-sm'; // Headshot images const hasImages = entry.authors.some(a => a.image); if (hasImages) { const imgWrap = document.createElement('div'); - imgWrap.className = 'flex flex-row'; + imgWrap.className = 'flex flex-row flex-shrink-0'; entry.authors.forEach((a, i) => { if (a.image) { const img = document.createElement('img'); @@ -668,7 +678,7 @@ // Names const namesDiv = document.createElement('div'); - namesDiv.className = 'truncate text-slate-900'; + namesDiv.className = 'line-clamp-2'; namesDiv.textContent = entry.authors.map(a => a.name).join(', '); wrapper.appendChild(namesDiv); frag.appendChild(wrapper); @@ -676,22 +686,51 @@ } } - // Conditional metadata - const conditionals = [ - ['location', entry.location], - ['date', entry.dateFormatted], - ['duration', entry.durationFormatted], - ['views', entry.viewsFormatted], - ['stars', entry.starsFormatted], - ]; - for (const [name, value] of conditionals) { - if (value) { - const el = slot(name); - if (el) { - el.style.display = ''; - const textEl = slot(name + '-text'); - if (textEl) textEl.textContent = value; - } + // Conditional metadata - inline with separators + const metadataEl = slot('metadata'); + if (metadataEl) { + const metadataItems = [ + ['date', null, entry.dateFormatted], + ['location', null, entry.location], + ['duration', null, entry.durationFormatted], + ['views', null, entry.viewsFormatted], + ['stars', 'boxicons--star-filled', entry.starsFormatted], + ].filter(([_, __, value]) => value); + + if (metadataItems.length > 0) { + metadataEl.classList.remove('hidden'); + const metadataClass = settings.metadata_class || ''; + if (metadataClass) metadataClass.split(' ').filter(Boolean).forEach(c => metadataEl.classList.add(c)); + + metadataItems.forEach(([name, icon, value], index) => { + if (icon) { + // Stars - with icon + const itemDiv = document.createElement('div'); + itemDiv.className = 'flex gap-1 items-center'; + + const iconSpan = document.createElement('span'); + iconSpan.className = 'icon-[' + icon + ']'; + itemDiv.appendChild(iconSpan); + + const textSpan = document.createElement('span'); + textSpan.textContent = value; + itemDiv.appendChild(textSpan); + + metadataEl.appendChild(itemDiv); + } else { + // Other metadata - no icon + const textSpan = document.createElement('span'); + textSpan.textContent = value; + metadataEl.appendChild(textSpan); + } + + // Add separator if not last item + if (index < metadataItems.length - 1) { + const separator = document.createElement('span'); + separator.textContent = '|'; + metadataEl.appendChild(separator); + } + }); } } diff --git a/content/blog/positron/outgrow-your-laptop/hqdefault.jpg b/content/blog/positron/outgrow-your-laptop/hqdefault.jpg deleted file mode 100644 index 9adbbc9ff..000000000 Binary files a/content/blog/positron/outgrow-your-laptop/hqdefault.jpg and /dev/null differ diff --git a/content/blog/positron/outgrow-your-laptop/images/outgrowing.jpg b/content/blog/positron/outgrow-your-laptop/images/outgrowing.jpg new file mode 100644 index 000000000..9714339bc Binary files /dev/null and b/content/blog/positron/outgrow-your-laptop/images/outgrowing.jpg differ diff --git a/content/blog/positron/outgrow-your-laptop/index.md b/content/blog/positron/outgrow-your-laptop/index.md index d97095d39..1977fa581 100644 --- a/content/blog/positron/outgrow-your-laptop/index.md +++ b/content/blog/positron/outgrow-your-laptop/index.md @@ -6,7 +6,7 @@ description: > people: - Julia Silge date: '2026-03-05' -image: https://img.youtube.com/vi/sPZsH0eaUpQ/hqdefault.jpg +image: images/outgrowing.jpg image-alt: Talk Recording from R-Ladies Abuja ported_from: positron source: positron diff --git a/content/blog/positron/outgrow-your-laptop/index.qmd b/content/blog/positron/outgrow-your-laptop/index.qmd index eec2de507..2722d40f3 100644 --- a/content/blog/positron/outgrow-your-laptop/index.qmd +++ b/content/blog/positron/outgrow-your-laptop/index.qmd @@ -5,7 +5,7 @@ description: | people: - Julia Silge date: "2026-03-05" -image: https://img.youtube.com/vi/sPZsH0eaUpQ/hqdefault.jpg +image: images/outgrowing.jpg image-alt: "Talk Recording from R-Ladies Abuja" ported_from: positron source: positron diff --git a/data/items.yaml b/data/items.yaml index d9dcf6174..972a518cc 100644 --- a/data/items.yaml +++ b/data/items.yaml @@ -1,109 +1,138 @@ blog: + author_class: "font-medium text-gray-600" badge_hide_path: "/blog/" badge_icon: "boxicons--message-filled" badge_text: "blog post" card_class: "" - description_class: "@trenta:!line-clamp-3" + description_class: "@tall:line-clamp-3 @trenta:!line-clamp-3 font-medium text-gray-600" hero_class: "" hero_content_class: "max-w-5xl mx-auto px-4 sm:px-6 lg:px-8 pt-14 pb-6 w-full" hero_image_container_class: "aspect-[40/21] max-w-[1000px] mx-auto rounded-xl overflow-hidden" hero_layout: "banner" image_class: "w-full object-cover" + metadata_class: "text-xs font-medium text-gray-500" people_show: true row_class: "" tile_class: "" + title_class: "text-sm @tall:text-base @grande:text-lg @venti:text-3xl text-gray-600" cheatsheets: + author_class: "font-medium text-gray-600" badge_hide_path: "/resources/cheatsheets/" badge_icon: "boxicons--file-code-filled" badge_text: "cheatsheet" card_class: "" + description_class: "@tall:line-clamp-3 font-medium text-gray-600" hero_class: "" hero_content_class: "py-6" hero_image_show: false hero_layout: "banner" image_class: "w-full object-cover" + metadata_class: "text-xs font-medium text-gray-500" people_show: true row_class: "" tile_class: "" + title_class: "text-sm @tall:text-base @grande:text-lg @venti:text-3xl text-gray-600" events: + author_class: "font-medium text-gray-600" badge_hide_path: "/events/" badge_icon: "boxicons--calendar-event-filled" badge_text: "event" card_class: "" + description_class: "@tall:line-clamp-3 font-medium text-gray-600" hero_class: "" hero_content_class: "max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 pt-14 pb-6 w-full" hero_image_container_class: "aspect-[40/21] max-w-[1000px] mx-auto rounded-xl overflow-hidden" hero_layout: "banner" image_class: "w-full object-cover" + metadata_class: "text-xs font-medium text-gray-500" people_show: false row_class: "" tile_class: "" + title_class: "text-sm @tall:text-base @grande:text-lg @venti:text-3xl text-gray-600" people: + author_class: "font-medium text-gray-600" badge_hide_path: "/people/" badge_icon: "boxicons--face-filled" badge_text: "person" card_class: "" date_show: true - description_class: "@max-venti:text-center" + description_class: "@max-venti:text-center font-medium text-gray-600" description_field: "role" hero_class: "" hero_layout: "profile" image_class: "object-contain rounded-xl" + metadata_class: "text-xs font-medium text-gray-500" people_show: false row_class: "" tile_class: "" - title_class: "@max-venti:self-center" + title_class: "@max-venti:self-center text-sm @tall:text-base @grande:text-lg @venti:text-3xl text-gray-600" software: + author_class: "font-medium text-gray-600" badge_hide_path: "/software/" badge_icon: "boxicons--hexagon-filled" badge_text: "software" card_class: "" + description_class: "@tall:line-clamp-3 font-medium text-gray-600" hero_class: "" hero_layout: "profile" image_class: "object-contain px-[20%] py-[5%]" + metadata_class: "text-xs font-medium text-gray-500" people_show: false row_class: "" tile_class: "" + title_class: "text-sm @tall:text-base @grande:text-lg @venti:text-3xl text-gray-600" tutorials: + author_class: "font-medium text-gray-600" badge_hide_path: "/resources/tutorials/" badge_icon: "boxicons--book-filled" badge_text: "tutorial" card_class: "" + description_class: "@tall:line-clamp-3 font-medium text-gray-600" hero_class: "" hero_image_show: false hero_layout: "banner" image_class: "w-full object-cover" + metadata_class: "text-xs font-medium text-gray-500" people_show: true row_class: "" tile_class: "" + title_class: "text-sm @tall:text-base @grande:text-lg @venti:text-3xl text-gray-600" videos: + author_class: "font-medium text-gray-600" badge_hide_path: "/resources/videos/" badge_icon: "boxicons--video-filled" badge_text: "video" card_class: "" + description_class: "@tall:line-clamp-3 font-medium text-gray-600" hero_class: "" hero_image_show: false hero_layout: "banner" image_class: "w-full object-cover" + metadata_class: "text-xs font-medium text-gray-500" people_show: true row_class: "" tile_class: "" + title_class: "text-sm @tall:text-base @grande:text-lg @venti:text-3xl text-gray-600" webinars: + author_class: "font-medium text-gray-600" badge_hide_path: "/resources/webinars/" badge_icon: "boxicons--presentation-filled" badge_text: "webinar" card_class: "" + description_class: "@tall:line-clamp-3 font-medium text-gray-600" hero_class: "" hero_image_show: false hero_layout: "banner" image_class: "w-full object-cover" + metadata_class: "text-xs font-medium text-gray-500" people_show: true row_class: "" tile_class: "" + title_class: "text-sm @tall:text-base @grande:text-lg @venti:text-3xl text-gray-600" diff --git a/layouts/partials/block/author.html b/layouts/partials/block/author.html index 2f8b48f7e..069cbd02b 100644 --- a/layouts/partials/block/author.html +++ b/layouts/partials/block/author.html @@ -1,10 +1,14 @@ {{- $pg := . -}} {{- $link := true -}} +{{- $author_class := "" -}} {{- if reflect.IsMap . -}} {{- $pg = .page -}} {{- if isset . "link" -}} {{- $link = .link -}} {{- end -}} + {{- if isset . "author_class" -}} + {{- $author_class = .author_class -}} + {{- end -}} {{- end -}} {{- $people := $pg.GetTerms "people" -}} {{- if $people -}} @@ -18,10 +22,10 @@ {{- end -}} {{- end -}} -