https://github.com/synw/django-togo
A management command to convert Django templates to Go templates
https://github.com/synw/django-togo
Last synced: 2 months ago
JSON representation
A management command to convert Django templates to Go templates
- Host: GitHub
- URL: https://github.com/synw/django-togo
- Owner: synw
- Created: 2018-03-26T15:10:55.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-27T12:32:44.000Z (about 7 years ago)
- Last Synced: 2025-02-19T12:51:11.149Z (3 months ago)
- Language: Python
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Django Togo
A management command to convert Django templates to Go templates. This does:
- Remove all the `{% load %}` tags
- Transform all the `{% static "foo/bar" %}` tags in `/static/foo/bar`
- Remove all the `{% block foo %}{% endblock %}` tags
- Transform all the `{% include "foo.html" %}` into `{{ template "foo.html" . }}`
- Change the `{{ variable }}` to `{{ .variable }}`## Install
Add `"togo",` to installed apps
## Run
```
python3 manage.py togo destination_folder
```This will copy and transform all the files in `templates` to the destination directory.
## Options
Support for [Hugo](https://gohugo.io/) static sites generator format:
```
python3 manage.py togo destination_folder -hugo
```