<!DOCTYPE html>
<%- include("./snippets/timon.ejs") %>
<html lang="de-ch" data-theme="light">
    <head>
        <%- include("./snippets/head.ejs", {
            title: title,
            date: date,
            desc: desc,
            url: url,
            env: env,
            sitetype: sitetype
        }) %>
    </head>
    <body>
        <%- include("./snippets/header.ejs") %>
        <%- include("./snippets/nav.ejs") %>
        <main>
            <%- include("./snippets/hero.ejs", {
                img_alt: blog.img.alt[0],
                img_path: blog.img.img[0],
                title: title,
                subtitle: blog.preview,
                cta_text: "",
                cta_link: origin_url
            }) %>
            <%- blog.content %>
            <div class="blog_line"></div>
            <div class="blog_footer">
                <%
                function toRealDate (date) {
                    date = date.toString();
                    let time = date.slice(16, 24);
                    let day = date.slice(8, 10);
                    let year = date.slice(11, 15);
                    let month = date.slice(4, 7);
                    switch (month) {
                        case "Jan":
                            month = "Januar";
                            break;
                        case "Feb":
                            month = "Februar";
                            break;
                        case "Mar":
                            month = "MÃ¤rz";
                            break;
                        case "Apr":
                            month = "April";
                            break;
                        case "May":
                            month = "Mai";
                            break;
                        case "Jun":
                            month = "Juni";
                            break;
                        case "Jul":
                            month = "Juli";
                            break;
                        case "Aug":
                            month = "August";
                            break;
                        case "Sep":
                            month = "September";
                            break;
                        case "Oct":
                            month = "Oktober";
                            break;
                        case "Nov":
                            month = "November";
                            break;
                        case "Dec":
                            month = "Dezember";
                            break;
                    };
                    return `${day}. ${month} ${year} um ${time}`;
                };%>
                <img id="blog_footer_img" src="/img/svg/personal.svg" alt="<%= blog.author %>">
                <div>
                    <p>Autor: <%= blog.author %></p>
                    <p>Gepostet am <%= toRealDate(blog.date) %></p>
                </div>
            </div>
        </main>
        <%- include("./snippets/footer.ejs", {
            origin_url: origin_url,
            js: js
        }) %>
    </body>
</html>