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

update: use sitemap plugin from experimental-plugins #5

Merged
merged 2 commits into from
Oct 9, 2022

Conversation

wangbinyq
Copy link
Contributor

Pages that have not date attribute should ignore lastmod.

@oscarotero
Copy link
Member

@wangbinyq Thanks for this. page.data.date value must exist always, because Lume create it if it's not manually defined. Do you have any example where this value doesn't exist?

@wangbinyq
Copy link
Contributor Author

Any pages except post pages dont have page.data.date and is included in sitemap.

Here is the sitemap of the demo:
image

@oscarotero
Copy link
Member

oscarotero commented Oct 8, 2022

Mmm, Ok. This seems a bug related with remote files, I'll work on that.
Besides, the 404 page shouldn't be listed here, there must be a if to filter it.

I think this is OK as a temporary workaround put at some point the experimental plugin sitemap could be moved to Lume repo.

Could you filter out the 404.html page?

@wangbinyq
Copy link
Contributor Author

Ok, I like the sitemap plugin.
Also this fix is not needed. Should we close this pr?

@oscarotero
Copy link
Member

oscarotero commented Oct 8, 2022

Could you modify the PR to use the sitemap plugin from the experimental repo?:

import siteMap from "https://raw.githubusercontent.com/lumeland/experimental-plugins/main/sitemap/sitemap.ts";

site.use(siteMap());

@wangbinyq
Copy link
Contributor Author

Could you modify the PR to use the sitemap plugin from the experimental repo?:

import siteMap from "https://raw.githubusercontent.com/lumeland/experimental-plugins/main/sitemap/sitemap.ts";

site.use(siteMap());

Ok, I will try.

@wangbinyq
Copy link
Contributor Author

wangbinyq commented Oct 9, 2022

Could you modify the PR to use the sitemap plugin from the experimental repo?:

import siteMap from "https://raw.githubusercontent.com/lumeland/experimental-plugins/main/sitemap/sitemap.ts";

site.use(siteMap());

This sitemap still has the same problems for this blog theme, also I find a bug with author page that search.values('author') will return an object instead of string.

image

oscarotero added a commit that referenced this pull request Oct 9, 2022
@oscarotero
Copy link
Member

oscarotero commented Oct 9, 2022

Ok, there are some bugs:

  • The remote pages don't have the date value, this is why they have undefined in the sitemap. This is a Lume bug that I'll fix in the next version.
  • The author issue is related with the author key in the _data.yml file. Due it's used only for the feeds, I just remove it and now works fine.
  • I've updated the sitemap plugin to don't print the lastmod value if it doesn't exist: lumeland/experimental-plugins@b75edba.

So the only thing to do is to use plugin to generate the sitemap. This includes:

  • Import and use the plugin from the experimental plugins repo.
  • Remove the sitemap and robots.txt pages in the src folder, because they aren't needed anymore.
  • Remove these files also in the mod.ts files to don't load them remotely.

Let me know if you are going to do these changes. Or I can do them for you, if you want.

@wangbinyq wangbinyq changed the title fix sitemap lastmod update: use sitemap plugin from experimental-plugins Oct 9, 2022
@oscarotero oscarotero merged commit 62c1b62 into lumeland:main Oct 9, 2022
@oscarotero
Copy link
Member

Thank you!!

@wangbinyq wangbinyq deleted the fix/sitemap-lastmod branch October 9, 2022 09:42
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

Successfully merging this pull request may close these issues.

2 participants