Skip to content

Commit e20018f

Browse files
committed
chore: add configs do next-intl
1 parent fed4652 commit e20018f

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

contentlayer.config.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,17 @@ import { group } from "console";
99

1010
const Blog = defineDocumentType(() => ({
1111
name: "Blog",
12-
filePathPattern: "**/**/*.mdx",
12+
filePathPattern: "**/**/**/*.mdx",
1313
contentType: "mdx",
1414
fields: {
1515
title: {
1616
type: "string",
1717
required: true,
1818
},
19+
lang: {
20+
type: "string",
21+
required: true,
22+
},
1923
publishedAt: {
2024
type: "date",
2125
required: true,
@@ -45,7 +49,7 @@ const Blog = defineDocumentType(() => ({
4549
computedFields: {
4650
url_path: {
4751
type: "string",
48-
resolve: (doc) => `/blogs/${doc._raw.flattenedPath}`,
52+
resolve: (doc) => `/blogs/${doc._raw.flattenedPath.replace(/^[^\/]*\//, '')}`,
4953
},
5054
readingTime: {
5155
type: "json",

next.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
/** @type {import('next').NextConfig} */
22

33
const { withContentlayer } = require("next-contentlayer");
4+
const withNextIntl = require('next-intl/plugin')();
45

56
const nextConfig = {
67
compiler: {
7-
removeConsole: true,
8-
}
8+
removeConsole: false,
9+
},
910
}
1011

11-
module.exports = withContentlayer({...nextConfig});
12+
module.exports = withNextIntl(withContentlayer({...nextConfig}));

0 commit comments

Comments
 (0)