@@ -11,6 +11,7 @@ import { injectParams } from 'ngxtension/inject-params';
11
11
import { ContentTextComponent } from '@app/app/components/content-text.component.js' ;
12
12
import { ContentRenderComponent } from '@app/app/components/content-render.component.js' ;
13
13
import { JSONContent } from '@tiptap/core' ;
14
+ import { Translation } from '@app/app/components/translation.js' ;
14
15
15
16
@Component ( {
16
17
selector : '[postItem]' ,
@@ -149,7 +150,7 @@ export class BlogPostDetailComponent {
149
150
<div class="articles-line"></div>
150
151
<div class="articles">
151
152
@for (post of blog.posts(); track $index) {
152
- <a routerLink="/blog/{{post.slug}}" [postItem]="post"></a>
153
+ <a routerLink="/{{translation.lang()}}/ blog/{{post.slug}}" [postItem]="post"></a>
153
154
}
154
155
</div>
155
156
` ,
@@ -175,6 +176,7 @@ export class BlogPostDetailComponent {
175
176
} )
176
177
export class BlogListComponent {
177
178
blog = inject ( BlogService ) ;
179
+ translation = inject ( Translation ) ;
178
180
}
179
181
180
182
@Injectable ( { providedIn : 'root' } )
@@ -205,7 +207,7 @@ export class BlogService {
205
207
<nav>
206
208
@for (post of blog.posts(); track $index) {
207
209
@if (!post.image) {
208
- <a routerLink="/blog/{{ post.slug }}">
210
+ <a routerLink="/{{translation.lang()}}/ blog/{{ post.slug }}">
209
211
<span>{{ post.publishedAt | date: 'dd MMM yy' }}</span>
210
212
<span>{{ post.title }}</span>
211
213
</a>
@@ -227,6 +229,7 @@ export class BlogService {
227
229
} )
228
230
export class BlogComponent {
229
231
blog = inject ( BlogService ) ;
232
+ translation = inject ( Translation ) ;
230
233
}
231
234
232
235
function tiptapToContent ( content ?: JSONContent [ ] , level : number = 1 ) : ( Content | string ) [ ] {
0 commit comments