<!DOCTYPE html>
<html lang="<txp:lang />" dir="<txp:text item="lang_dir" />">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
    <title><txp:page_title /></title>

    <!-- CSS -->
    <txp:css format="link" media="" />
    <!-- ...or you can use (faster) external CSS files e.g. <link rel="stylesheet" href="<txp:page_url type="theme_path" />/styles/default.css"> -->

    <meta name="generator" content="Textpattern CMS">

    <txp:if_search>
        <meta name="robots" content="none">
    <txp:else />
        <txp:if_author>
            <meta name="robots" content="noindex, follow">
        <txp:else />
            <txp:meta_description />
            <txp:if_category>
                <meta name="robots" content="noindex, follow">
            <txp:else />
                <txp:variable name="page" value='<txp:page_url type="pg" />' />
                <txp:if_variable name="page" value="1">
                    <meta name="robots" content="index, follow">
                    <link rel="canonical" href="<txp:site_url />">
                    <script type="application/ld+json">
                        {
                            "@context": "https://schema.org",
                            "@type": "WebSite",
                            "headline": "<txp:site_name escape="json" />",
                            <txp:if_description>"description": "<txp:meta_description format="" escape="json" />",</txp:if_description>
                            "url": "<txp:site_url escape="json" />"
                        }
                    </script>
                <txp:else />
                    <meta name="robots" content="noindex, follow">
                </txp:if_variable>
                <txp:variable name="front-page" value="1" />
            </txp:if_category>
        </txp:if_author>
    </txp:if_search>

    <!-- content feeds -->
    <txp:feed_link flavor="atom" format="link" label="Atom" />
    <txp:feed_link flavor="rss" format="link" label="RSS" />
</head>

<txp:if_variable name="front-page">
    <body class="front-page" itemscope itemtype="https://schema.org/WebPage">
<txp:else />
    <txp:if_search>
        <body class="search-page" itemscope itemtype="https://schema.org/SearchResultsPage">
    <txp:else />
        <body class="listing-page" itemscope itemtype="https://schema.org/CollectionPage">
    </txp:if_search>
</txp:if_variable>

    <txp:output_form form="body_header" />

    <div class="wrapper">
        <div class="container">

            <!-- Main content -->
            <main id="main" aria-label="<txp:text item="main_content" />" itemscope itemtype="https://schema.org/Blog">

                <!-- is this the search result page? also omits the pagination links below (uses pagination format within search_display.txp instead) -->
                <txp:if_search>
                    <txp:output_form form="search_display" />

                <txp:else />
                    <!-- else is this the front page? -->
                    <txp:if_variable name="front-page">
                        <!-- links by default to form: 'default.txp' unless you specify a different form -->
                        <txp:article limit="5" />

                    <txp:else />
                        <!-- else is this an article author list? -->
                        <txp:if_author>
                            <h1 itemprop="name"><txp:text item="author" /> <txp:author /></h1>

                        <txp:else />
                            <!-- else is this an article category list? -->
                            <txp:if_category>
                                <h1 itemprop="name"><txp:text item="category" /> <txp:category title /></h1>
                            </txp:if_category>
                        </txp:if_author>
                        <txp:article form="article_listing" limit="10" wraptag="ul" class="article-list" />
                    </txp:if_variable>

                    <!-- add pagination links to foot of front page/author listings/category listings if there are more articles available -->
                    <txp:evaluate test="newer,older">
                        <nav class="paginator" aria-label="<txp:text item="page_nav" />">
                            <txp:newer rel="prev">
                                <txp:text item="newer" />
                            </txp:newer>
                            <txp:older rel="next">
                                <txp:text item="older" />
                            </txp:older>
                        </nav>
                    </txp:evaluate>
                </txp:if_search>

            </main>

            <txp:output_form form="body_aside" />

        </div> <!-- /.container -->
    </div> <!-- /.wrapper -->

    <txp:output_form form="body_footer" />

</body>
</html>