File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
libs/shared/feature/src/pages/blog Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments