Skip to content

Commit 195d52d

Browse files
committed
Fix url
1 parent 45aeffb commit 195d52d

File tree

5 files changed

+32
-3
lines changed

5 files changed

+32
-3
lines changed

data/osa-1/4-laskentaa-luvuilla.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
path: "/osa-1/4-muuttujat"
2+
path: "/osa-1/4-laskentaa"
33
title: "Laskentaa luvuilla"
44
---
55

gatsby-config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ module.exports = {
143143
},
144144
{
145145
resolve: "gatsby-transformer-moocfi-exercises"
146-
}
146+
},
147+
`gatsby-plugin-meta-redirect` // make sure to put last in the array
147148
]
148149
};

gatsby-node.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,14 @@
77
const path = require("path")
88

99
exports.createPages = ({ actions, graphql }) => {
10-
const { createPage } = actions
10+
const { createPage, createRedirect } = actions
11+
12+
createRedirect({
13+
fromPath: `/osa-1/4-muuttujat`,
14+
isPermanent: true,
15+
redirectInBrowser: true,
16+
toPath: `/osa-1/4-laskentaa`,
17+
})
1118

1219
const courseMaterialTemplate = path.resolve(
1320
`src/templates/CourseContentTemplate.js`,

package-lock.json

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"gatsby-plugin-catch-links": "^2.0.9",
2020
"gatsby-plugin-google-analytics": "^2.0.8",
2121
"gatsby-plugin-manifest": "^2.0.13",
22+
"gatsby-plugin-meta-redirect": "^1.1.1",
2223
"gatsby-plugin-react-helmet": "^3.0.5",
2324
"gatsby-plugin-sharp": "^2.0.17",
2425
"gatsby-plugin-sitemap": "^2.0.4",

0 commit comments

Comments
 (0)