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

Introduce resources #87

Closed
bartfeenstra opened this issue Apr 6, 2019 · 2 comments · Fixed by #231
Closed

Introduce resources #87

bartfeenstra opened this issue Apr 6, 2019 · 2 comments · Fixed by #231

Comments

@bartfeenstra
Copy link
Owner

bartfeenstra commented Apr 6, 2019

#25 shows we want features that require we know more about the resources (pages) we render:

  • Created time
  • Last modified time (rendered time?)
  • Media (images, are other types relevant?)
  • Authors

We can create a resource object when starting the rendering process of a new page, give templates read/write access, and destroy it once the process ends.

Can we keep a record of all rendered resources, so static assets such as the sitemap can inspect them?

@bartfeenstra
Copy link
Owner Author

Because we cannot call just any function from our template files, without them being registered as filters, this won't work.

However, we can add preprocessing in render.py to build our resource/page object.

@bartfeenstra
Copy link
Owner Author

#222 could use this to get the target of the current page in order to render URLs to its translations. Page templates are rendered through dedicated Python functions such as render_entity() and render_entity_type(). Other templated pages are rendered through render_file() as a result of render_tree(), usually after copytree(). Both approaches would need to know the target (an object or the public path string) of the page they are rendering for these locale links to work. For render_file(), when do we know if a file is page? When its name, without extension, is index?

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 a pull request may close this issue.

1 participant