Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamically generated pages are not included in the sitemap #153

Open
lgradzki-cksource opened this issue Apr 17, 2023 · 2 comments
Open

Comments

@lgradzki-cksource
Copy link

lgradzki-cksource commented Apr 17, 2023

generating blog author pages

hexo.extend.generator.register(
	'authors',
	function (locals) {
	
		authorsData = ['array of data'];

		return authorsData.reduce((result, author) => {
			const data = pagination(
				'/blog/authors/' + author.slug,
				author.posts,
				{
					layout: ['page'],
					perPage: 10,
					data: {
						title: author.name ,
					},
				}
			);

			return result.concat(data);
		}, []);
	},
	1
);

seems like pages generated dynamically with the code above are not included in the sitemap plugin output

is it that the moment the plugin is registered the newly created pages are not there yet?
vide https://github.com/hexojs/hexo-generator-sitemap/blob/master/lib/generator.js#L23

note: pages are properly generated and are fully functional

any feedback is highly appreciated 🙇

@uiolee
Copy link
Member

uiolee commented May 16, 2023

My understanding is that the generator just generate a file.
The generator does not declare this file as page or post.
So this file does not belong to the pages or posts.

@lgradzki-cksource
Copy link
Author

lgradzki-cksource commented May 16, 2023

@uiolee exactly
it is a dynamically generated file based on the data fetched from the CMS
that is pushed to production as a standalone .html page and therefore it would be great
if it was reflected in the sitemap.xml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants