{% macro ephemeral_nav_link(what, where, selected=False) -%}
<li class="ephemeral{% if selected %} selected{% endif %}"><a href="{{ SITEURL }}/{{ where }}">{{what}}</a></li>
{%- endmacro -%}

<!DOCTYPE html>
<html lang="{{ DEFAULT_LANG }}">
<head>
    {% block head %}
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>{% block title %}{{ SITENAME }}{% endblock title %}</title>
    {# favicon #}
    <link rel="shortcut icon" type="image/png" href="{{ SITEURL }}/favicon.png">
    <link rel="shortcut icon" type="image/x-icon" href="{{ SITEURL }}/favicon.ico">
    {% if FEED_ALL_ATOM %}
    <link href="{{ FEED_DOMAIN }}/{{ FEED_ALL_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Full Atom Feed" />
    {% endif %}
    {% if FEED_ALL_RSS %}
    <link href="{{ FEED_DOMAIN }}/{{ FEED_ALL_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Full RSS Feed" />
    {% endif %}
    {% if FEED_ATOM %}
    <link href="{{ FEED_DOMAIN }}/{{ FEED_ATOM }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Atom Feed" />
    {% endif %}
    {% if FEED_RSS %}
    <link href="{{ FEED_DOMAIN }}/{{ FEED_RSS }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" />
    {% endif %}
    {% if CATEGORY_FEED_ATOM and category %}
    <link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_ATOM.format(slug=category.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Categories Atom Feed" />
    {% endif %}
    {% if CATEGORY_FEED_RSS and category %}
    <link href="{{ FEED_DOMAIN }}/{{ CATEGORY_FEED_RSS.format(slug=category.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Categories RSS Feed" />
    {% endif %}
    {% if TAG_FEED_ATOM and tag %}
    <link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_ATOM.format(slug=tag.slug) }}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Tags Atom Feed" />
    {% endif %}
    {% if TAG_FEED_RSS and tag %}
    <link href="{{ FEED_DOMAIN }}/{{ TAG_FEED_RSS.format(slug=tag.slug) }}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Tags RSS Feed" />
    {% endif %}
    <link rel="stylesheet" href="https://files.stork-search.net/basic.css" />
    <link rel="stylesheet" href="{{ SITEURL }}/theme/css/screen.css" type="text/css" />
    <link rel="stylesheet" href="{{ SITEURL }}/theme/css/pygments.css" type="text/css" />
    <link rel="stylesheet" href="{{ SITEURL }}/theme/css/print.css" type="text/css" media="print" />
    <meta name="generator" content="Pelican" />
    <meta name="description" content="{{ SITEDESCRIPTION }}" />
    <meta name="author" content="{{ AUTHOR }}" />
    <meta property="og:type" content="website" />
    <meta property="og:url" content="{{ SITEURL }}" />
    <meta property="og:title" content="{{ SITENAME }}" />
    <meta property="og:image" content="{{ SITEURL }}/images/LogoCraftLetter-800px.png" />
    <meta property="og:image:width" content="800" />
    <meta property="og:image:height" content="222" />
    <meta property="og:image:type" content="image/png" />
    <meta property="og:description" content="{{ SITEDESCRIPTION }}" />

    {% endblock head %}
</head>
<body>
    {% if DISPLAY_HEADER or DISPLAY_HEADER is not defined %}
    <header>
        {% if DISPLAY_MENU or DISPLAY_MENU is not defined %}
        <nav>
            <ul>
            {% block ephemeral_nav %}{% endblock %}
                <!-- {% if DISPLAY_HOME or DISPLAY_HOME is not defined %} -->
                <!-- <li{% if output_file == "index.html" %} class="selected"{% endif %}><a href="{{ SITEURL }}/">Home</a></li> -->
                <!-- {% endif %} -->
                {% if DISPLAY_PAGES_ON_MENU %}
                {% for p in pages %}
                <li{% if p == page %} class="selected"{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ p.title }}</a></li>
                {% endfor %}
                {% endif %}
                {% for title, link in MENUITEMS %}
                <li><a href="{{ link }}">{{ title }}</a></li>
                {% endfor %}
                {% for name, link, file in MENU_INTERNAL_PAGES %}
                <li{% if output_file == file %} class="selected"{% endif %}><a href="{{ SITEURL }}/{{ link }}">{{ name }}</a></li>
                {% endfor %}
            </ul>
            <ul>
                <search>Rechercher : <input data-stork="sitesearch" />
                    <div data-stork="sitesearch-output"></div>
                </search>
            </ul>
        </nav>
        {% endif %}
        <div class="header_box">
            <h1><a href="{{ SITEURL }}/">{{ SITENAME }}</a></h1>
            {% if SITESUBTITLE %}
            <h2>{{ SITESUBTITLE }}</h2>
            {% endif %}
        </div>
    </header>
    {% endif %}
    <div id="wrapper">
        <div id="content">
            <main>
                {%- block content -%}{%- endblock %}
            <!-- </main> -->

            {% if DISPLAY_FOOTER or DISPLAY_FOOTER is not defined %}
            <footer>
                <script>
                  (function (s, e, n, d, er) {
                    s['Sender'] = er;
                    s[er] = s[er] || function () {
                      (s[er].q = s[er].q || []).push(arguments)
                    }, s[er].l = 1 * new Date();
                    var a = e.createElement(n),
                        m = e.getElementsByTagName(n)[0];
                    a.async = 1;
                    a.src = d;
                    m.parentNode.insertBefore(a, m)
                  })(window, document, 'script', 'https://cdn.sender.net/accounts_resources/universal.js', 'sender');
                  sender('7ce69975e53330')
                </script>

                <div style="text-align: center" class="sender-form-field" data-sender-form-id="av2kqL"></div>
                <p>
                Thème dérivé de <a href="https://github.com/jody-frankowski/blue-penguin">Blue Penguin</a> 
                &middot;
                Propulsé par <a href="https://getpelican.com">Pelican</a>
                 {% if FEED_ALL_RSS %}
                &middot;
                <a href="{{ SITEURL }}/{{ FEED_ALL_RSS }}" rel="alternate">Flux RSS</a>
                 {% endif %}
                <p>
                    <a href="https://www.craftletter.fr">Craft Letter</a> © 2025 - 2026 par <a href="https://www.linkedin.com/in/pascal-le-merrer/">Pascal Le Merrer</a> est sous licence <a href="https://creativecommons.org/licenses/by-nc-nd/4.0/">CC BY-NC-ND 4.0</a><div><img src="https://mirrors.creativecommons.org/presskit/icons/cc.svg" alt="CC" style="max-width: 1em;max-height:1em;margin-left: .2em;"><img src="https://mirrors.creativecommons.org/presskit/icons/by.svg" alt="BY" style="max-width: 1em;max-height:1em;margin-left: .2em;"><img src="https://mirrors.creativecommons.org/presskit/icons/nc.svg" alt="NC" style="max-width: 1em;max-height:1em;margin-left: .2em;"><img src="https://mirrors.creativecommons.org/presskit/icons/nd.svg" alt="ND" style="max-width: 1em;max-height:1em;margin-left: .2em;"></div>
                <p/>
                <img id="noai" src="images/NO-AI.svg"/>
            </footer>
            {% endif %}
        </div>
        <div class="clear"></div>
    </div>
    <script src="https://files.stork-search.net/releases/v1.5.0/stork.js"></script>
    <script>
        stork.register("sitesearch", "{{ SITEURL }}/search-index.st");
    </script>
</body>
</html>
