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

Generator plugin #215

Closed
oscarotero opened this issue Jul 13, 2022 · 6 comments
Closed

Generator plugin #215

oscarotero opened this issue Jul 13, 2022 · 6 comments
Labels
Milestone

Comments

@oscarotero
Copy link
Member

A plugin that inject the lume global variable with the lume version and other environment variables that can be used in the page, for example to create a <meta name="generator"> tag.

"Inspired" by https://www.11ty.dev/docs/data-eleventy-supplied/#eleventy-variable

@binyamin
Copy link
Contributor

I don't think this needs a separate plugin. Just expose a global lume.version data property. This also makes room for other build metadata, such as site.options.dev (as lume.dev), or lume.mode to represent whether lume is in build, serve, or watch mode.

@binyamin
Copy link
Contributor

It could be added to the "metas" plugin, for easy usage.

@oscarotero
Copy link
Member Author

It could be added to the "metas" plugin, for easy usage.

Good idea!

@oscarotero
Copy link
Member Author

I just added the generator property to the metas plugin. It can be true (so it's generated automatically) or a string (to customize the value).

I'm not going to add other values for now.
BTW, the dev mode will be deprecated soon: #201.

@binyamin
Copy link
Contributor

Gotcha. I do think it would be useful to expose the Lume version as a global variable.

@oscarotero
Copy link
Member Author

You can do it in the _config.ts file:

import { getLumeVersion } from "lume/core/utils.ts";

site.data("lume_version", getLumeVersion());

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

No branches or pull requests

2 participants