Add Drupal headless stack with Next.js frontend
- Add Next.js frontend service (nextjs) with Dockerfile and source - Update docker-compose.yml: image names, Drupal 11.3.3, nextjs service - Add docker-compose.override.yml.disabled for dev hot-reload - Add install-headless-modules.sh for OAuth/JSON:API module setup - Add README.md with full setup and configuration guide - Update nginx/Dockerfile and nginx.conf.template for cms. subdomain - Update drupal/Dockerfile PHP-FPM build args - Gitignore **/.vscode/ to prevent IDE workspace files from being tracked
This commit is contained in:
parent
71a8dac389
commit
f8b8f53d54
85 changed files with 7802 additions and 17 deletions
34
drupal/nextjs/components/node-article-teaser.tsx
Normal file
34
drupal/nextjs/components/node-article-teaser.tsx
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import type { DrupalNode } from "@/lib/types"
|
||||
|
||||
interface NodeArticleTeaserProps {
|
||||
node: DrupalNode
|
||||
}
|
||||
|
||||
export function NodeArticleTeaser({ node }: NodeArticleTeaserProps) {
|
||||
const href = node.path?.alias || `/node/${node.id}`
|
||||
|
||||
return (
|
||||
<article className="group rounded-lg border border-gray-200 bg-white p-6 shadow-sm transition hover:shadow-md">
|
||||
<h3 className="mb-2 text-xl font-semibold">
|
||||
<a href={href} className="text-gray-900 group-hover:text-emerald-500">
|
||||
{node.title}
|
||||
</a>
|
||||
</h3>
|
||||
<div className="mb-3 flex items-center gap-3 text-sm text-gray-500">
|
||||
{node.uid?.display_name && (
|
||||
<span>By {node.uid.display_name}</span>
|
||||
)}
|
||||
<time dateTime={node.created}>
|
||||
{new Date(node.created).toLocaleDateString("en-US", {
|
||||
year: "numeric",
|
||||
month: "long",
|
||||
day: "numeric",
|
||||
})}
|
||||
</time>
|
||||
</div>
|
||||
{node.body?.summary && (
|
||||
<p className="line-clamp-3 text-gray-600">{node.body.summary}</p>
|
||||
)}
|
||||
</article>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue