community/packages/community-generator
2023-01-26 13:26:23 -08:00
..
lektor_community_generator Rename digital-safety-guides/digital-privacy-guides to digital-security-guides 2023-01-26 13:26:23 -08:00
.gitignore Initial commit of community page generator plugin 2023-01-12 15:50:27 +00:00
README.md Better README documentation for community-generator 2023-01-12 15:50:27 +00:00
setup.cfg Initial commit of community page generator plugin 2023-01-12 15:50:27 +00:00
setup.py Move file generator templates to their own file 2023-01-12 15:50:27 +00:00

community-generator

The community-generator plugin is provides a way for users to filter resources on the training resources page, without javascript or a web backend. It accomplushes this by generating a set of lektor contents files for each combination of filters.

You shouldn't need to do anything or know anything about this plugin in order to use it.

Developing

The plugin has a few different pieces:

  • The main generation logic, which resides in the community-generator/lektor_community_generator/ directory.
  • lektor templates: empty.html, resources-sortby.html resources_filter.html
  • a lektor model sortby_resources.ini generated by the plugin, and added to the top-level .gitignore
  • a set of generated lektor contents files, in content/training/resources/sortby/
  • a content/training/resources/.gitignore file, ignoring the generated lektor contents files

If you want to change what's in the generated contents.lr files, look into the lektor_community_generator/file_templates.py file, and the generate_files function in lektor_community_generator/__init__.py.

If you want to change the model of the generated contents files, look at lektor_community_generator/file_templates.py

If you want to change the templates, look into the reousrces-sortby.html, resources_filter.html, and resources_list.html templates