Skip to content

Commit 0d59c5d

Browse files
committed
wrapped ppost and page slug in decodedURIComponent for emoji support in slug
1 parent e982ef5 commit 0d59c5d

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

gatsby-wordpress-theme-libre/gatsby-node.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ exports.createSchemaCustomization = ({ actions, schema }) => {
1919
extend() {
2020
return {
2121
resolve(source, args, context, info) {
22+
console.log(source.featured_media___NODE, "feature media node");
2223
if (source.featured_media___NODE) {
2324
return context.nodeModel.getNodeById({
2425
id: source.featured_media___NODE,
@@ -278,7 +279,7 @@ exports.createPages = async ({ graphql, actions, reporter }) => {
278279

279280
posts.forEach((post, i, arr) => {
280281
createPage({
281-
path: `${post.node.slug}`,
282+
path: `${decodeURIComponent(post.node.slug)}`,
282283
component: postTemplate,
283284
context: {
284285
slug: post.node.slug,
@@ -288,7 +289,7 @@ exports.createPages = async ({ graphql, actions, reporter }) => {
288289
});
289290

290291
createPage({
291-
path: `${post.node.slug}amp`,
292+
path: `${decodeURIComponent(post.node.slug)}amp`,
292293
component: postAmpTemplate,
293294
context: {
294295
slug: post.node.slug,
@@ -322,7 +323,7 @@ exports.createPages = async ({ graphql, actions, reporter }) => {
322323
.filter((page) => !page.node.slug.startsWith("contact"))
323324
.forEach((page) => {
324325
createPage({
325-
path: `/${page.node.slug}`,
326+
path: `${decodeURIComponent(page.node.slug)}`,
326327
component: pageTemplate,
327328
context: {
328329
slug: page.node.slug,

gatsby-wordpress-theme-libre/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@draftbox-co/gatsby-wordpress-theme-libre",
3-
"version": "1.0.29",
3+
"version": "1.0.30",
44
"license": "MIT",
55
"resolutions": {
66
"sharp": "0.23.4"

0 commit comments

Comments
 (0)