-
Notifications
You must be signed in to change notification settings - Fork 22
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
Template Plugin #53
Comments
I'd suggest a I'd also suggest that loading all the templates at startup won't scale. There may need to be some caching, but that can be in a later version. This is separate from the renderer cache, which is of course essential. I'm not sure about the last point - perhaps just an expiring cache, with a default of 10 minutes' life, instead? (I like the general "backend events" concept, of course) |
These are what the Mojolicious renderers do: All templates are cached upon first load from the filesystem or the data section and stored forever. The Mojolicious::Renderer cache does not expire. Reloading the app is the only way to reload the templates. For the Yancy plugin, expiring the cache could happen on set/create/delete and then wait for the cache to be repopulated by a request (but why not just update the cache during the edit request and save the other users from having to wait?). You're right that we will also need to expire the cache regularly through a timer: Only the one worker that responds to the editor's API request to change the template will get the backend event to fire. The Mojolicious::Renderer's I don't anticipate users having thousands of templates via this. If they do, they are modeling their data very wrongly. A basic markdown-based page content area can share space with this to have both static (markdown) and dynamic (template) content. We don't need to optimize for pathological cases. If someone wants to change how templates are loaded (if not from the Yancy backend), they can write their own renderer like Yancy is. If some compelling arguments can be made for editing the Mojo::Template objects after they're created, we can add some events there. |
It would be nice if the editor could edit the application's templates. To do this, we need to:
templates
) to the existing Yancy backendhtml
] and template handler [e.g.ep
]) and atemplate
, which is the code of the template.ep
handlerThe text was updated successfully, but these errors were encountered: