Skip to content

Commit

Permalink
wrapped ppost and page slug in decodedURIComponent for emoji support …
Browse files Browse the repository at this point in the history
…in slug
  • Loading branch information
shyamlohar committed Jun 26, 2020
1 parent e982ef5 commit 0d59c5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions gatsby-wordpress-theme-libre/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ exports.createSchemaCustomization = ({ actions, schema }) => {
extend() {
return {
resolve(source, args, context, info) {
console.log(source.featured_media___NODE, "feature media node");
if (source.featured_media___NODE) {
return context.nodeModel.getNodeById({
id: source.featured_media___NODE,
Expand Down Expand Up @@ -278,7 +279,7 @@ exports.createPages = async ({ graphql, actions, reporter }) => {

posts.forEach((post, i, arr) => {
createPage({
path: `${post.node.slug}`,
path: `${decodeURIComponent(post.node.slug)}`,
component: postTemplate,
context: {
slug: post.node.slug,
Expand All @@ -288,7 +289,7 @@ exports.createPages = async ({ graphql, actions, reporter }) => {
});

createPage({
path: `${post.node.slug}amp`,
path: `${decodeURIComponent(post.node.slug)}amp`,
component: postAmpTemplate,
context: {
slug: post.node.slug,
Expand Down Expand Up @@ -322,7 +323,7 @@ exports.createPages = async ({ graphql, actions, reporter }) => {
.filter((page) => !page.node.slug.startsWith("contact"))
.forEach((page) => {
createPage({
path: `/${page.node.slug}`,
path: `${decodeURIComponent(page.node.slug)}`,
component: pageTemplate,
context: {
slug: page.node.slug,
Expand Down
2 changes: 1 addition & 1 deletion gatsby-wordpress-theme-libre/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@draftbox-co/gatsby-wordpress-theme-libre",
"version": "1.0.29",
"version": "1.0.30",
"license": "MIT",
"resolutions": {
"sharp": "0.23.4"
Expand Down

0 comments on commit 0d59c5d

Please sign in to comment.