https://github.com/mdxprograms/paqrat
A flask site that compiles to static
https://github.com/mdxprograms/paqrat
flask python3 static-site
Last synced: about 1 year ago
JSON representation
A flask site that compiles to static
- Host: GitHub
- URL: https://github.com/mdxprograms/paqrat
- Owner: mdxprograms
- Created: 2018-08-18T04:31:21.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-21T02:07:55.000Z (over 7 years ago)
- Last Synced: 2025-01-04T06:41:48.650Z (about 1 year ago)
- Topics: flask, python3, static-site
- Language: Python
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# paqrat
_currently a work in progress_
A flask site that compiles to static
### Requirements
- python3
### Getting started
- `make setup`
- `make dev`
### How it works
Data in `/data` will be associated with the `data` variable in all pages.
Each data file is added to the data `dict` and it's associated filename is added as a key to it's data varaiables
The _only_ exception is anything in config.yml will be under `data.site`.
ie: `{{ data.site.title }}` would be associated with `config.yml`
### Content
Basic content entries are under `/content`.
You can pass an array of content files to use in your route template: `get_content(['index, about'])`
This will apply it to the templates `content` variable `{{ content.index }} {{ content.about }}`
This allows for separating content into any markdown file in `/content` and using it in multiple areas and templates.
### Routing
A basic route is defined by 4 things:
1. route => `"/"`
2. template => `index.html`
3. data => `get_data()`
4. content => `get_content(['index', 'about'])`
```python
# example values
@app.route(route)
def index():
return render_template(template,
content=get_content(content),
data=data)
```
### Build
`make build`
This will create a build directory with static files ready for deployment.