Skip to content

Commit a84a272

Browse files
committed
fix(website): blog post url
1 parent 877698f commit a84a272

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

website/src/app/pages/blog.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { injectParams } from 'ngxtension/inject-params';
1111
import { ContentTextComponent } from '@app/app/components/content-text.component.js';
1212
import { ContentRenderComponent } from '@app/app/components/content-render.component.js';
1313
import { JSONContent } from '@tiptap/core';
14+
import { Translation } from '@app/app/components/translation.js';
1415

1516
@Component({
1617
selector: '[postItem]',
@@ -149,7 +150,7 @@ export class BlogPostDetailComponent {
149150
<div class="articles-line"></div>
150151
<div class="articles">
151152
@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>
153154
}
154155
</div>
155156
`,
@@ -175,6 +176,7 @@ export class BlogPostDetailComponent {
175176
})
176177
export class BlogListComponent {
177178
blog = inject(BlogService);
179+
translation = inject(Translation);
178180
}
179181

180182
@Injectable({ providedIn: 'root' })
@@ -205,7 +207,7 @@ export class BlogService {
205207
<nav>
206208
@for (post of blog.posts(); track $index) {
207209
@if (!post.image) {
208-
<a routerLink="/blog/{{ post.slug }}">
210+
<a routerLink="/{{translation.lang()}}/blog/{{ post.slug }}">
209211
<span>{{ post.publishedAt | date: 'dd MMM yy' }}</span>
210212
<span>{{ post.title }}</span>
211213
</a>
@@ -227,6 +229,7 @@ export class BlogService {
227229
})
228230
export class BlogComponent {
229231
blog = inject(BlogService);
232+
translation = inject(Translation);
230233
}
231234

232235
function tiptapToContent(content?: JSONContent[], level: number = 1): (Content | string)[] {

0 commit comments

Comments
 (0)