<commit_before>import os
from jinja2 import Template
import jinja2
import yaml
import settings

f = open('site.yaml')

structure = yaml.safe_load(f)
f.close()

print structure

# Templates can live anywhere, define them in settings.py
template_dir = settings.template_path
#loader = jinja2.FileSystemLoader(template_dir)
loader = jinja2.FileSystemLoader(
        [template_dir,
         os.path.join(os.path.dirname(__file__),"templates/includes"),
         os.path.join(os.path.dirname(__file__),"templates")])
environment = jinja2.Environment(loader=loader)

for section in structure:
    # loop over the sections
    print section
    section_data = structure[section]
    print(section_data['name'])
    for page in section_data:
        # loop over its pages
        print(page)

template = Template('Hello {{ name }}!')
template.render(name='<NAME>')<commit_msg>Some templating stuff, configurable site config path<commit_after>import os
from jinja2 import Template
import jinja2
import yaml
import settings

# Templates can live anywhere, define them in settings.py
f = open(os.path.join(setting.project_path, 'site.yaml'))

print('Reading structure from ' + os.path.join(setting.project_path, 'site.yaml'))

structure = yaml.safe_load(f)
f.close()

print structure

# Templates can live anywhere, define them in settings.py
template_dir = settings.template_path
#loader = jinja2.FileSystemLoader(template_dir)
loader = jinja2.FileSystemLoader(
        [template_dir,
         os.path.join(os.path.dirname(__file__), 'templates/includes'),
         os.path.join(os.path.dirname(__file__), 'templates')])
environment = jinja2.Environment(loader=loader)

template = environment.get_template('base.html')

for section in structure:
    # loop over the sections
    print section
    section_data = structure[section]
    print(section_data['name'])
    for page in section_data:
        # loop over its pages
        print(page)

#template = Template('Hello {{ name }}!')
template.render(name='<NAME>')
{'fraction_non_alphanumeric': 0.1106679960119641, 'fraction_numerical': 0.004985044865403789, 'mean_word_length': 4.498630136986302, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1713413', 'n_tokens_mistral': 607, 'n_tokens_neox': 592, 'n_words': 151}