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

Automate the creation of django templates from the design files #14

Open
gbozee opened this issue Jan 30, 2018 · 4 comments
Open

Automate the creation of django templates from the design files #14

gbozee opened this issue Jan 30, 2018 · 4 comments

Comments

@gbozee
Copy link

gbozee commented Jan 30, 2018

Since we are currently implementing the designs in such a way that looks familar to any one who has worked with a templating language, this feature would make it possible such that the current templates can be easily converted to the django templating system by just running them through a command.

@danidee10
Copy link

I think Staticfy can help with this 😄

@danidee10
Copy link

danidee10 commented Feb 6, 2018

@gbozee and @depecode I've created a Django posthtml plugin for Staticfy. It's on a new branch called plugins.

You can install it from pip with:

pip install git+https://github.com/danidee10/Staticfy.git@plugins

and run it with:

staticfy base.html base.html --framework django. It should convert all the tags to valid Django templates.

example with the base.html template

@gbozee
Copy link
Author

gbozee commented Feb 7, 2018

This is great. Would take a look at this

@danidee10
Copy link

danidee10 commented Feb 12, 2018

@gbozee and @depecode I don't know if you guys have installed Staticfy. I made a new change so you might have issues. It now uses a yaml file to specify plugins.

I've started re-writing the core (Flask, Django and Laravel) as separate plugins that would be available by default. Without plugins, it would be difficult to do some kind of things without messing up the code or affecting other frameworks.
For example, Staticfy should automatically insert {% load staticfiles %} into any html template that has at least one static file/asset. But Flask (with Jinja2) doesn't have a static template tag.

The command is still the same. You just need to create a staticfy.yaml file in the root directory of the project and specify django_posthtml like this:

plugins: [django_posthtml]

There's an example here too: https://github.com/danidee10/Staticfy/blob/plugins/staticfy.yaml

If I complete the Django plugin before we start using it, then you'll have to specify

plugins: [django, django_posthtml] and the cli argument --framework would change to --plugins

Right now, the Django functionality is still in the core.

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

No branches or pull requests

2 participants