I am not sure if this is the best way to solve this problem and someone may have a better solution.
I need to have a good way to have a specific picture, title and description for each page in a wix web site for facebook sharing. It is crazy to me but it seems you can only specify one picture / description for the entire site for the facebook share function – this needs be fixed. The whole purpose of having people share pages to facebook for the site is to get great info on the specific topic on the web site – not a general picture and desc.
I found I could solve the problem with wix-code. I added the pages to a router and then modified the sitemap in order to modify the meta-tags for each page. It works great (I have not filled in the image and title fields yet). But my problem is performance. When I navigate from page to page there is a delay after the click and before the code gets called. Pages that are not part of the router perform well. It is about a 1 second or so delay.
Here is the code. I have not published the web site yet. The URL of the site is http://kidsintmin.wixsite.com/newkidsim You will noice that when you naviage on the ‘HOME’ page which just moves to new anchors it is fast but when you go to the other pages, navigation is slow.
import {ok, notFound, WixRouterSitemapEntry} from “wix-router”;
const pagesData3 = {
“nffch” :
{ title: "test title ",
description: “test desc”,
image: “https://static.wixstatic.com/media/9d0395_9751f44c0fc94804aab5d2e8352b5e6b~mv2.jpg”,
metaTags: {“og:a”: “”,
“og:b”: “”
}
},
“volunteer” :
{ title: “”,
description: “”,
image: “”,
metaTags: {“og:a”: “”,
“og:b”: “”
}
},
“ccs” :
{ title: “”,
description: “”,
image: “https://static.wixstatic.com/media/9d0395_abc1aaf86a574737852c2b9baeb47586.jpg”,
metaTags: {“og:a”: “”,
“og:b”: “”
}
},
“partnership-nffch” :
{ title: “Partner with NFFCH”,
description: “In order to run the Children’s home with excelence, KIDS needs your help. Please consider being a partner with the ministry by setting up a monthly donation. We cannot do this without all of you.”,
image: “https://static.wixstatic.com/media/9d0395_1a374591303d40d79e4b2fbd220ad4ca~mv2.jpg”,
metaTags: {“og:a”: “”,
“og:b”: “”
}
},
“partnership-ccs” :
{ title: “”,
description: “”,
image: “”,
metaTags: {“og:a”: “”,
“og:b”: “”
}
},
“community-ministry” :
{ title: “test title”,
description: “test desc”,
image: “https://static.wixstatic.com/media/9d0395_7936507dde4a4d6e96cadd00bba1c3c1.jpg”,
metaTags: {“og:a”: “”,
“og:b”: “”
}
},
“volunteer-stories” :
{ title: “”,
description: “”,
image: “”,
metaTags: {“og:a”: “”,
“og:b”: “”
}
},
“instagram” :
{ title: “”,
description: “”,
image: “”,
metaTags: {“og:a”: “”,
“og:b”: “”
}
},
“upload-pictures” :
{ title: “”,
description: “”,
image: “”,
metaTags: {“og:a”: “”,
“og:b”: “”
}
},
“pictures-nffch” :
{ title: “”,
description: “”,
image: “”,
metaTags: {“og:a”: “”,
“og:b”: “”
}
},
“meet-the-missionaries” :
{ title: “”,
description: “”,
image: “”,
metaTags: {“og:a”: “”,
“og:b”: “”
}
},
“pictures-ccs” :
{ title: “”,
description: “”,
image: “”,
metaTags: {“og:a”: “”,
“og:b”: “”
}
},
“pictures-best-of-kids” :
{ title: “”,
description: “”,
image: “”,
metaTags: {“og:a”: “”,
“og:b”: “”
}
},
“pictures-community-ministry” :
{ title: “”,
description: “”,
image: “”,
metaTags: {“og:a”: “”,
“og:b”: “”
}
},
“pictures-your-team” :
{ title: “”,
description: “”,
image: “”,
metaTags: {“og:a”: “”,
“og:b”: “”
}
},
“pictures-philippines-beauty” :
{ title: “”,
description: “”,
image: “”,
metaTags: {“og:a”: “”,
“og:b”: “”
}
}
};
export function kids_Router(request) {
console.log(“kids_Router - enter”);
var data = pagesData3[request.path]
if (data)
{
const seoData = {
title: data.title,
description: data.description,
noIndex: false,
metaTags: {
“og:title”: data.title,
“og:image”: data.image
}
};
console.log("kids_Router - exit");
return ok(request.path, "" ,seoData);
}
console.log(“kids_Router - exit”);
return notFound();
}
export function kids_SiteMap(sitemapRequest) {
console.log(“sitemapRequest - enter”);
var siteMapEntries = ;
for(var i=0;i < sitemapRequest.pages.length;i++)
{
var entry = new WixRouterSitemapEntry(sitemapRequest.pages[i]);
entry.pageName = sitemapRequest.pages[i]; // The name of the page in the Wix editor to render
entry.url = “/kids/” + sitemapRequest.pages[i]; // Relative URL of the page
entry.title = “”; // For better SEO - Help Google
siteMapEntries.push(entry);
}
console.log(“sitemapRequest - exit”);
return siteMapEntries;
}