{% import gramexwebsite %} {% import gramex.cache %} {% set gramex.cache.reload_module(gramexwebsite) %} {% set config = gramexwebsite.config(handler) %} {% set uri = handler.request.path.strip('/') or 'home' %} {% set base = '.' if uri == 'home' else '..' %} {% if uri.count("/") > 0 %} {% for i in range(uri.count("/")) %} {% set base = "{}{}".format(base,'/..') %} {% end %} {% end %} {% set page = config['main'] %} {% set page = gramexwebsite.get_pagedata(page, uri, 'page') %} {% set seo = config['seo'] %} {% set seo = gramexwebsite.get_pagedata(seo, uri, 'page')%} {% if seo is None %} {% else %} {% set seo = seo.fillna('') %} {% end %} {{ seo.seo_title.iloc[0] }} {% for component, page_section in page.groupby(['component'], sort=False) %} {% set section = config[page_section.section.iloc[0]] %} {% set component_list = component.split('_') %} {% set component_number = '_{}'.format(component.split('_')[1]) if(len(component_list) == 2) else '' %} {% raw gramexwebsite.template_extend(component_list[0], section=section, uri=uri, base=base, handler=handler, navcolor='body-color', component_number=component_number, component_id=page_section.component_id.fillna('').iloc[0]) %} {% end %}