Featured event card beside the hero text; Word import: tabs, quotes, callouts, dividers, videos, buttons
From lg up the featured event's photo sits beside its words, so the card is about as tall as the hero text. Word import turns a 'Tab:' line into a tab, the Quote and Intense Quote styles into quotes and callouts, '---' into a divider, a lone video link into a video and 'Button: label' into a button; Blog posts shows the whole mapping beside Import from Word. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
3b034eb00e
commit
56acedf926
8 changed files with 143 additions and 16 deletions
|
|
@ -46,7 +46,32 @@ export const blogPosts = {
|
|||
idLabel: "URL ID",
|
||||
slugFrom: "title",
|
||||
// Blog posts → Import from Word (server/src/routes/import.js).
|
||||
importer: { label: "Import from Word", endpoint: "/admin/import/docx", accept: ".docx" },
|
||||
// `guide` is what becomes what (server/src/docx.js, docs/importing.md),
|
||||
// shown beside the button.
|
||||
importer: {
|
||||
label: "Import from Word",
|
||||
endpoint: "/admin/import/docx",
|
||||
accept: ".docx",
|
||||
guide: {
|
||||
intro: "A .docx becomes a new, unpublished post. In the document:",
|
||||
rows: [
|
||||
["The Title style, or the first Heading 1", "The post's title"],
|
||||
["A date line under it, eg. Sep 28, 2026", "The post's date"],
|
||||
["Heading 1 and Heading 2", "Heading blocks"],
|
||||
["Heading 3 and smaller", "Subheading blocks"],
|
||||
["A line starting Tab:, eg. Tab: Overview (any style)", "A Tab: the post is split into tabs from there"],
|
||||
["The Quote style", "A Quote (a dash and a name at the end is who said it)"],
|
||||
["The Intense Quote style", "A Callout"],
|
||||
["Bulleted or numbered paragraphs", "One List block"],
|
||||
["Tables", "Table blocks"],
|
||||
["A line of --- alone", "A Divider"],
|
||||
["A YouTube, Vimeo or Facebook link alone on its line", "A Video"],
|
||||
["Button: Register, with Register linked", "A Button, its label and link"],
|
||||
["Other paragraphs", "Paragraphs, keeping bold, italic and links"],
|
||||
],
|
||||
outro: "Images, text boxes, footnotes, comments, colors and fonts aren't carried over: add images as Image blocks after. PDFs: save as .docx first.",
|
||||
},
|
||||
},
|
||||
|
||||
list: {
|
||||
columns: [
|
||||
|
|
|
|||
|
|
@ -691,6 +691,8 @@ function ImportedNote() {
|
|||
`${summary.paragraphs} paragraphs`,
|
||||
`${summary.lists} lists`,
|
||||
`${summary.tables} tables`,
|
||||
...(summary.tabs ? [`${summary.tabs} tabs`] : []),
|
||||
...(summary.others ? [`${summary.others} quotes, callouts, dividers, videos and buttons`] : []),
|
||||
];
|
||||
return (
|
||||
<p role="status" className="mt-4 border border-brand/20 bg-tint px-4 py-3 text-sm text-body">
|
||||
|
|
|
|||
|
|
@ -282,13 +282,40 @@ function ImportButton({ manifest }: { manifest: any }) {
|
|||
}
|
||||
}
|
||||
|
||||
const guide = manifest.importer.guide;
|
||||
|
||||
return (
|
||||
<div className="ml-auto flex items-center gap-3">
|
||||
<div className="ml-auto flex flex-wrap items-center gap-3">
|
||||
{error && (
|
||||
<span role="alert" className="text-sm text-danger">
|
||||
{error}
|
||||
</span>
|
||||
)}
|
||||
{guide && (
|
||||
<details className="relative">
|
||||
<summary className="cursor-pointer text-sm text-link hover:underline">What becomes what</summary>
|
||||
<div className="absolute right-0 z-20 mt-2 w-[min(36rem,90vw)] bg-raised p-4 text-sm shadow-xl">
|
||||
<p className="text-body">{guide.intro}</p>
|
||||
<table className="mt-3 w-full text-left">
|
||||
<thead className="text-xs uppercase tracking-wider text-muted">
|
||||
<tr>
|
||||
<th className="py-1 pr-4 font-medium">In Word</th>
|
||||
<th className="py-1 font-medium">In the post</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{guide.rows.map(([from, to]) => (
|
||||
<tr key={from} className="border-t border-muted/10 align-top">
|
||||
<td className="py-1.5 pr-4 text-body">{from}</td>
|
||||
<td className="py-1.5 text-muted">{to}</td>
|
||||
</tr>
|
||||
))}
|
||||
</tbody>
|
||||
</table>
|
||||
{guide.outro && <p className="mt-3 text-xs text-muted">{guide.outro}</p>}
|
||||
</div>
|
||||
</details>
|
||||
)}
|
||||
<label
|
||||
className={`cursor-pointer btn border border-link px-4 py-2 text-sm text-link transition-colors hover:bg-tint ${
|
||||
busy ? "pointer-events-none opacity-60" : ""
|
||||
|
|
|
|||
|
|
@ -556,10 +556,12 @@ function VideoFrame({
|
|||
|
||||
/* ── Featured event ──────────────────────────────────────────── */
|
||||
|
||||
/* The event's own card for the hero: its background photo (or its
|
||||
color), then what, when and where, then its buttons and a way
|
||||
to its page. The first action link is the filled button, since
|
||||
it's usually Register. */
|
||||
/* The event's own card for the hero: its photo (or its color), then
|
||||
what, when and where, then its buttons and a way to its page. The
|
||||
first action link is the filled button, since it's usually
|
||||
Register. Stacked on a phone; from lg up the photo sits beside the
|
||||
words, so the card stays about as tall as the hero's own text
|
||||
instead of towering over it. The photo stays whole (16:9). */
|
||||
function EventPanel({ event }: { event: HeroEvent }) {
|
||||
const color = event.color || 'var(--color-action)'
|
||||
const photo = mediaUrl(event.photo)
|
||||
|
|
@ -568,7 +570,7 @@ function EventPanel({ event }: { event: HeroEvent }) {
|
|||
|
||||
return (
|
||||
<div
|
||||
className="overflow-hidden border border-white/15 bg-white/10 text-white shadow-2xl backdrop-blur"
|
||||
className="overflow-hidden border border-white/15 bg-white/10 text-white shadow-2xl backdrop-blur lg:grid lg:grid-cols-[minmax(0,1.1fr)_minmax(0,1fr)] lg:items-center"
|
||||
style={{ boxShadow: '0 24px 48px -24px rgba(0, 16, 17, 0.6)' }}
|
||||
>
|
||||
{photo ? (
|
||||
|
|
@ -581,9 +583,9 @@ function EventPanel({ event }: { event: HeroEvent }) {
|
|||
/>
|
||||
)}
|
||||
|
||||
<div className="space-y-4 p-8">
|
||||
<div className="space-y-4 p-8 lg:space-y-3 lg:p-6">
|
||||
<div>
|
||||
<h2 className="font-display text-3xl font-bold leading-tight md:text-4xl">
|
||||
<h2 className="font-display text-3xl font-bold leading-tight md:text-4xl lg:text-2xl xl:text-3xl">
|
||||
<Link to={eventHref(event.id)} className="hover:underline">
|
||||
{event.title}
|
||||
</Link>
|
||||
|
|
@ -592,16 +594,16 @@ function EventPanel({ event }: { event: HeroEvent }) {
|
|||
</div>
|
||||
|
||||
{(when || where) && (
|
||||
<p className="text-lg text-white/85">{[when, where].filter(Boolean).join(' · ')}</p>
|
||||
<p className="text-lg text-white/85 lg:text-base">{[when, where].filter(Boolean).join(' · ')}</p>
|
||||
)}
|
||||
{event.tagline && <p className="text-white/70">{event.tagline}</p>}
|
||||
{event.tagline && <p className="text-white/70 lg:line-clamp-3 lg:text-sm">{event.tagline}</p>}
|
||||
|
||||
<div className="flex flex-wrap gap-3 pt-2">
|
||||
<div className="flex flex-wrap gap-3 pt-2 lg:gap-2 lg:pt-1">
|
||||
{event.links.map((link, index) => (
|
||||
<HomeLink
|
||||
key={link.url}
|
||||
url={link.url}
|
||||
className={`inline-flex items-center gap-2 btn px-6 py-3 transition-transform hover:scale-105 ${
|
||||
className={`inline-flex items-center gap-2 btn px-6 py-3 transition-transform hover:scale-105 lg:px-4 lg:py-2 lg:text-sm ${
|
||||
index === 0 ? 'text-[#001011]' : 'border border-white/35 text-white hover:bg-white/10'
|
||||
}`}
|
||||
style={index === 0 ? { background: 'var(--pal-amber-2)' } : undefined}
|
||||
|
|
@ -612,7 +614,7 @@ function EventPanel({ event }: { event: HeroEvent }) {
|
|||
))}
|
||||
<Link
|
||||
to={eventHref(event.id)}
|
||||
className="btn border border-white/35 px-6 py-3 text-white transition-colors hover:bg-white/10"
|
||||
className="btn border border-white/35 px-6 py-3 text-white transition-colors hover:bg-white/10 lg:px-4 lg:py-2 lg:text-sm"
|
||||
>
|
||||
Event details <ArrowRight size="1em" weight="bold" className="inline align-[-0.125em]" aria-hidden="true" />
|
||||
</Link>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue