-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnext.config.js
33 lines (26 loc) · 862 Bytes
/
next.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const wp = require("nextjs-wp");
module.exports = {
async exportPathMap() {
/* URL to WordPress */
let url = "https://agency.raconteur.net/wp-json/wp/v2/posts";
/* Points /burgers/wp-slug/ to our burgers.js page */
const allPosts = await wp.getPostUrl(url, "posts", [["id", "id"]], "posts");
/* Points /burgers/wp-slug/details to our details.js page */
const postDetails = await wp.getPostUrl(
url,
"details",
[["id", "id"]],
"posts/details"
);
/* Some other pages we defined manually */
const otherPages = {
"/": { page: "/" }
};
/* Combining everything */
return wp.combineRoutes([allPosts, postDetails, otherPages]);
}
};
const withImages = require("next-images");
module.exports = withImages();
const withSass = require("@zeit/next-sass");
module.exports = withSass();