diff options
Diffstat (limited to 'layouts')
-rw-r--r-- | layouts/page.njk | 24 | ||||
-rw-r--r-- | layouts/post.njk | 25 |
2 files changed, 49 insertions, 0 deletions
diff --git a/layouts/page.njk b/layouts/page.njk new file mode 100644 index 0000000..71912c3 --- /dev/null +++ b/layouts/page.njk @@ -0,0 +1,24 @@ +<!DOCTYPE html> +<html lang="en-US"> + <head> + <title>{{ pageTitle }}</title> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta name="author" content="{{ metadata.author.name }}"> + {% if metaDesc %}<meta name="description" content="{{ metaDesc }}">{% endif %} + <link rel="preconnect" href="https://fonts.googleapis.com"> + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> + <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;1,400;1,700&family=Noto+Sans+JP:wght@400;700&display=swap"> + <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/hack-font/3.3.0/web/hack.min.css"> + <link rel="stylesheet" href="/style.css"> + <link rel="icon" href="/favicon.png"> + </head> + <body> + <main> + <div id="invert" title="Invert Colors"></div> +{{ content | safe }} + </main> + + <script src="/main.js"></script> + </body> +</html> diff --git a/layouts/post.njk b/layouts/post.njk new file mode 100644 index 0000000..0c0e4a9 --- /dev/null +++ b/layouts/post.njk @@ -0,0 +1,25 @@ +--- +layout: page.njk +--- + <a id="up" title="Home" aria-label="Home" href="/"></a> + <a id="back" title="Back" aria-label="Back" href="javascript:history.back()"></a> + <h1>{{ title }}</h1> + + {%- if heroImg %} + <img class="hero" src="{{ heroImg }}" alt="{{ heroImgAlt }}"> + {% endif -%} + + {{ content | safe }} + +{%- if tags %} + <p id="tags">{% for tag in tags %} + <a class="tag" href="/{{ tag | slug }}/">#{{ tag }}</a>{% endfor %} + </p> +{% endif %} + <nav> + <a id="like-post" href="TODO" title="Like Post" aria-label="Like Post"><span></span></a> + {%- set prevPost = collections.all | getPreviousCollectionItem(page) %} + {%- set nextPost = collections.all | getNextCollectionItem(page) %} + {%- if nextPost %}<a id="next" rel="next" href="{{ nextPost.url }}">Next</a>{% else %}<div id="end" title="End of latest post"></div>{% endif %} + {%- if prevPost %}<a id="prev" rel="prev" href="{{ prevPost.url }}">Prev</a>{% endif -%} + </nav> |