annotate tools/ssg101/ssg101.py @ 1200:b9514abc2a67

Initial commit of ssg101.
author Brian Neal <bgneal@gmail.com>
date Sat, 24 Jun 2023 16:06:51 -0500
parents
children
rev   line source
bgneal@1200 1 import jinja2
bgneal@1200 2
bgneal@1200 3
bgneal@1200 4 def main():
bgneal@1200 5 print('Hello World')
bgneal@1200 6
bgneal@1200 7 env = jinja2.Environment(
bgneal@1200 8 loader=jinja2.PackageLoader('ssg101'),
bgneal@1200 9 )
bgneal@1200 10 template = env.get_template('home.html')
bgneal@1200 11
bgneal@1200 12 with open('output/home.html', 'w') as fp:
bgneal@1200 13 fp.write(template.render())
bgneal@1200 14
bgneal@1200 15
bgneal@1200 16 if __name__ == '__main__':
bgneal@1200 17 main()