Better README documentation for community-generator

This commit is contained in:
kez 2023-01-10 11:57:40 -08:00 committed by kezzle
parent b1424d64e7
commit baa8fc2d76
2 changed files with 25 additions and 2 deletions

View File

@ -59,3 +59,9 @@ To help us to translate, please join the Tor Project team in [Transifex](https:/
### Getting help
If you want to contribute to the Community portal, we will be happy to help you. Join us at #tor-www in [irc.oftc.net](https://www.oftc.net).
### The community-generator plugin
This lektor site uses a special plugin called `community-generator`, you can find it in the `packages` directory. This plugin generates a special set of lektor contents files used for a js-free filtering system on the training resources page.
You shouldn't need to do anything or know anything about this plugin in order to use it. If you want to develop on this plugin, see the plugin's [README](packages/community-generator/README.md).

View File

@ -1,4 +1,21 @@
# community-generator
This is where a description of your plugin goes.
Provide usage instructions here.
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