@bbki.ng/bbblog
v0.0.4
Published
bbblog
Readme
bbblog
A minimal web component for rendering blog posts.
Demo: b.bbki.ng
Installation
npm install @bbki.ng/bbblogOr use via CDN:
<script type="module" src="https://cdn.jsdelivr.net/npm/@bbki.ng/[email protected]/dist/index.js"></script>Usage
<bb-blog content="/posts.json">
<!-- Fallback content shown if fetch fails -->
<p>Loading...</p>
</bb-blog>Custom Logo
<bb-blog content="/posts.json" logo="data:image/svg+xml;base64,xxxxx">
</bb-blog>JSON Format
The content attribute should point to a JSON file with an array of posts:
[
{
"title": "Hello World",
"content": "<p>This is my first post.</p>"
},
{
"title": "Another Post",
"content": "<p>More content here.</p>"
}
]Components
<bb-blog>
Main container component that fetches and displays posts.
| Attribute | Description |
|-----------|-------------|
| content | URL to JSON file containing posts |
| logo | Custom logo image (base64 data URI or URL). Falls back to default if not provided |
<bb-post>
Individual post component (used internally by <bb-blog>).
| Property | Description |
|----------|-------------|
| title | Post title |
| content | Post HTML content |
| date | Post date |
License
MIT
