-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuilder.py
More file actions
32 lines (25 loc) · 802 Bytes
/
builder.py
File metadata and controls
32 lines (25 loc) · 802 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python3
import yaml
import jinja2
# Import Meetup Data from YAML file
with open('meetup.yml') as f:
data = yaml.load(f, Loader=yaml.FullLoader)
# Load the template
templateLoader = jinja2.FileSystemLoader(searchpath="./")
templateEnv = jinja2.Environment(loader=templateLoader)
TEMPLATE_FILE = "template.html"
template = templateEnv.get_template(TEMPLATE_FILE)
# Render the template
renderedTemplate= template.render(
Meetup = data['Meetup'],
Saludo = data['Saludo'],
Actividades = data['Actividades'],
Datos = data['Datos'],
Expositores = data['Expositores'],
Patrocinantes = data['Patrocinantes'],
Testimonios = data ['Testimonios'],
MeetupURL = data['MeetupURL']
)
# Output the file
with open('site/index.html', 'w') as writer:
writer.write(renderedTemplate)