Skip to content

Commit 404c89e

Browse files
authored
feat(content): added demo page to shared/feature lib
1 parent 7db56f5 commit 404c89e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// /src/app/pages/blog/posts.[slug].page.ts
2+
import { injectContent, MarkdownComponent } from '@analogjs/content';
3+
import { AsyncPipe } from '@angular/common';
4+
import { Component } from '@angular/core';
5+
6+
export interface PostAttributes {
7+
title: string;
8+
slug: string;
9+
description: string;
10+
coverImage: string;
11+
}
12+
13+
@Component({
14+
standalone: true,
15+
imports: [MarkdownComponent, AsyncPipe],
16+
template: `
17+
@if (post$ | async; as post) {
18+
<h1>{{ post.attributes.title }}</h1>
19+
<analog-markdown [content]="post.content"></analog-markdown>
20+
}
21+
`,
22+
})
23+
export default class BlogPostComponent {
24+
readonly post$ = injectContent<PostAttributes>();
25+
}

0 commit comments

Comments
 (0)