Sitemap
Closed this issue · 13 comments
Integrate a sitemap generator, or just create a sitemap
@arpansac sir, I want to work with sitemap issue. I found this open source https://www.npmjs.com/package/sitemap-generator sitemap generator, written in JS and working env is node. It generates XML file. I am thinking to add this as a helper tool outside the main project folder.
Go ahead, try the library, if it works fine, we'll use it!
Also try this one: https://chrome.google.com/webstore/detail/sitemap-generator/hcnjemngcihnhncobgdgkkfkhmleapah?hl=en
Should I then assign this issue to you?
I have already tried the chrome plugin that you've mentioned. And both of them yielding the same result. But I have doubt regarding the results, whether it is correct or not ? The generated sitemap contains only one url, but it supposed to map all the pages.
Would you confirm it ? Or I have mistaken somewhere ? ( I am using this url https://commudle.com for generating site-map.)Even I tried, since there are no links in the main page and other admin pages require login the programs aren't creating sitemaps that we want. I'm not sure how to proceed in this aspect
Not because of angular, I think this will be the case wherever there is lesser number of public routes.
Any solution till now?
Writing the XML manually is one option or collect the sub URLs and write a program to generate it is another option.
One such example
function generate_xml_sitemap() {
// this is the source of the URLs on the site, in this case we use a simple array, actually it could come from the database
var urls = ['about.html', 'javascript.html', 'css.html'];
// the root of your website - the protocol and the domain name with a trailing slash
var root_path = 'http://www.example.com/';
// XML sitemap generation starts here
var priority = 0.5;
var freq = 'monthly';
var xml = '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
for (var i in urls) {
xml += '<url>';
xml += '<loc>'+ root_path + urls[i] + '</loc>';
xml += '<changefreq>'+ freq +'</changefreq>';
xml += '<priority>'+ priority +'</priority>';
xml += '</url>';
i++;
}
xml += '</urlset>';
return xml;
}
@Ashwin-op
Majorly we'll be needing paths for
- All the communities
- Their events
- Sessions in these events
So it appears that we'll be looking at crawling our own website for generating a sitemap.
One solution is that we cite a couple of API's (example, of communities and all it's events) and then loop over them to generate the sitemap for at least them.
What do you think?
Yes, we can create a sitemap containing links of communities and its events using APIs. Are the sessions in these events publicly accessible without logging in? If not, is it advisable to include those links in the sitemap?
Hey, Can I Take this issue?
Hey @Sloth-Panda actually a PR already got created by @Ashwin-op even before I assigned this one to him :)