Home
Main landing page
Real-world examples showing what you can build with @plushveil/pages
<div class="page-list"> ${pages.map(page => ` <article> <h3>${page.title}</h3> <p>${page.description}</p> <a href="${page.url}"> Visit page </a> </article> `).join('')} </div> <script target="div.page-list"> export const pages = [ { title: 'Home', description: 'Main landing page', url: '/' }, // ... more pages ] </script>
Main landing page
Complete guide and API reference
Real-world code examples
<div class="team-grid"> ${team.map(member => ` <div class="member-card"> <img src="${member.image}" alt="${member.name}" /> <h3>${member.name}</h3> <p>${member.role}</p> </div> `).join('')} </div> <script target="div.team-grid"> export const team = [ { name: 'Alice Johnson', role: 'Developer', image: 'alice.jpg' }, // ... more team members ] </script>
Developer
Designer
Manager
<div class="div.banner"> ${isProduction ? ` <!-- Production analytics --> <script src="analytics.js"></script> ` : ` <!-- Development mode --> <div class="dev-banner"> Development Mode </div> `} </div> <script target="banner"> export const isProduction = process.env.NODE_ENV === 'production' </script>
Generate multiple pages from a single file using arrays in canonical URLs:
<html> <head> <link rel="canonical" href="/articles/${articleId}" /> <title>${article.title}</title> </head> <body> <article> <h1>${article.title}</h1> <p>${article.content}</p> </article> </body> </html> <script target="html"> // Array generates multiple pages export const articleId = [ 'getting-started', 'advanced-guide', 'deployment' ] </script> <script target="body"> // Import current page context import page from 'page:page' const articles = { 'getting-started': { title: 'Getting Started', content: 'Learn the basics...' }, 'advanced-guide': { title: 'Advanced Guide', content: 'Deep dive into...' }, 'deployment': { title: 'Deployment', content: 'Deploy your site...' } } // Extract ID from current page URL const currentId = page.url.pathname.split('/').pop() export const article = articles[currentId] </script>
Result:This single file generates three separate pages:
/articles/getting-started/articles/advanced-guide/articles/deploymentEach page has access to its specific article data via page.url.
<header class="site-header"> <nav> <a href="/">Home</a> <a href="/about">About</a> <a href="/contact">Contact</a> </nav> </header>
<!DOCTYPE html> <html> <head>...</head> <body> ${import('./snippets/header.html')} <main> <h1>Page Content</h1> </main> ${import('./snippets/footer.html')} </body> </html>
<ul> ${products.map(product => ` <li> <h3>${product.name}</h3> <p>$${product.price}</p> </li> `).join('')} </ul> <script target="ul"> import { readFileSync } from 'fs' import { fileURLToPath } from 'url' import { dirname, join } from 'path' const __dirname = dirname( fileURLToPath(import.meta.url) ) const data = readFileSync( join(__dirname, 'data/products.json'), 'utf-8' ) export const products = JSON.parse(data) </script>
Perfect for project documentation with multiple pages, code examples, and navigation.
Build marketing sites with landing pages, team pages, and contact forms.
Create a blog with post listings, individual pages, and RSS feed.
Showcase your work with project galleries and case studies.
Start creating your own pages today