Skip to content

Commit

Permalink
Convert to tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Jan 23, 2023
1 parent 1f09716 commit e6dc55c
Show file tree
Hide file tree
Showing 14 changed files with 253 additions and 255 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
root = true

[*]
indent_style = space
indent_style = tab
indent_size = 2
end_of_line = lf
insert_final_newline = true
Expand Down
18 changes: 9 additions & 9 deletions _data/metadata.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"title": "Your Blog Name",
"url": "https://example.com/",
"language": "en",
"description": "I am writing about my experiences as a naval navel-gazer.",
"author": {
"name": "Your Name Here",
"email": "[email protected]",
"url": "https://example.com/about-me/"
}
"title": "Your Blog Name",
"url": "https://example.com/",
"language": "en",
"description": "I am writing about my experiences as a naval navel-gazer.",
"author": {
"name": "Your Name Here",
"email": "[email protected]",
"url": "https://example.com/about-me/"
}
}
82 changes: 41 additions & 41 deletions _includes/layouts/base.njk
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
<!doctype html>
<html lang="{{ metadata.language }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title or metadata.title }}</title>
<meta name="description" content="{{ description or metadata.description }}">

{#- Uncomment this if you’d like folks to know that you used Eleventy to build your site! #}
{#- <meta name="generator" content="{{ eleventy.generator }}"> #}

<link rel="stylesheet" href="/css/index.css">
<link rel="stylesheet" href="/css/prism-okaidia.css">
<link rel="stylesheet" href="/css/prism-diff.css">

<link rel="alternate" href="/feed/feed.xml" type="application/atom+xml" title="{{ metadata.title }}">
<link rel="alternate" href="/feed/feed.json" type="application/json" title="{{ metadata.title }}">
</head>
<body>
<a href="#skip" class="visually-hidden">Skip to main content</a>

<header>
<a href="/" class="home-link">{{ metadata.title }}</a>

{#- Read more about `eleventy-navigation` at https://www.11ty.dev/docs/plugins/navigation/ #}
<nav>
<ul class="nav">
<h2 class="visually-hidden">Top level navigation menu</h2>
{%- for entry in collections.all | eleventyNavigation %}
<li class="nav-item"><a href="{{ entry.url }}"{% if entry.url == page.url %} aria-current="page"{% endif %}>{{ entry.title }}</a></li>
{%- endfor %}
</ul>
</nav>
</header>

<main id="skip">
{{ content | safe }}
</main>

<footer></footer>

<!-- Current page: {{ page.url | htmlBaseUrl }} -->
</body>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ title or metadata.title }}</title>
<meta name="description" content="{{ description or metadata.description }}">

{#- Uncomment this if you’d like folks to know that you used Eleventy to build your site! #}
{#- <meta name="generator" content="{{ eleventy.generator }}"> #}

<link rel="stylesheet" href="/css/index.css">
<link rel="stylesheet" href="/css/prism-okaidia.css">
<link rel="stylesheet" href="/css/prism-diff.css">

<link rel="alternate" href="/feed/feed.xml" type="application/atom+xml" title="{{ metadata.title }}">
<link rel="alternate" href="/feed/feed.json" type="application/json" title="{{ metadata.title }}">
</head>
<body>
<a href="#skip" class="visually-hidden">Skip to main content</a>

<header>
<a href="/" class="home-link">{{ metadata.title }}</a>

{#- Read more about `eleventy-navigation` at https://www.11ty.dev/docs/plugins/navigation/ #}
<nav>
<ul class="nav">
<h2 class="visually-hidden">Top level navigation menu</h2>
{%- for entry in collections.all | eleventyNavigation %}
<li class="nav-item"><a href="{{ entry.url }}"{% if entry.url == page.url %} aria-current="page"{% endif %}>{{ entry.title }}</a></li>
{%- endfor %}
</ul>
</nav>
</header>

<main id="skip">
{{ content | safe }}
</main>

<footer></footer>

<!-- Current page: {{ page.url | htmlBaseUrl }} -->
</body>
</html>
14 changes: 7 additions & 7 deletions _includes/layouts/home.njk
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ layout: layouts/base.njk
---
<!-- Delete this message -->
<div class="message-box">
<link rel="stylesheet" href="/css/message-box.css">
<ol>
<li>Edit the <code>_data/metadata.json</code> with your blog’s information.</li>
<li>(Optional) Edit <code>eleventy.config.js</code> with your <a href="https://www.11ty.dev/docs/config/">configuration preferences</a>.</li>
<li>Delete this message from <code>_includes/layouts/home.njk</code>.</li>
</ol>
<p><em>This is an <a href="https://www.11ty.dev/">Eleventy project</a> created from the <a href="https://github.com/11ty/eleventy-base-blog"><code>eleventy-base-blog</code> repo</a>.</em></p>
<link rel="stylesheet" href="/css/message-box.css">
<ol>
<li>Edit the <code>_data/metadata.json</code> with your blog’s information.</li>
<li>(Optional) Edit <code>eleventy.config.js</code> with your <a href="https://www.11ty.dev/docs/config/">configuration preferences</a>.</li>
<li>Delete this message from <code>_includes/layouts/home.njk</code>.</li>
</ol>
<p><em>This is an <a href="https://www.11ty.dev/">Eleventy project</a> created from the <a href="https://github.com/11ty/eleventy-base-blog"><code>eleventy-base-blog</code> repo</a>.</em></p>
</div>
<!-- Stop deleting -->

Expand Down
18 changes: 8 additions & 10 deletions _includes/layouts/post.njk
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,22 @@ layout: layouts/base.njk
<h1>{{ title }}</h1>

<ul class="post-metadata">
<li><time datetime="{{ page.date | htmlDateString }}">{{ page.date | readableDate }}</time></li>
{%- for tag in tags | filterTagList %}
{%- set tagUrl %}/tags/{{ tag | slugify }}/{% endset %}
<li><a href="{{ tagUrl }}" class="post-tag">{{ tag }}</a>{%- if not loop.last %}, {% endif %}</li>
{%- endfor %}
<li><time datetime="{{ page.date | htmlDateString }}">{{ page.date | readableDate }}</time></li>
{%- for tag in tags | filterTagList %}
{%- set tagUrl %}/tags/{{ tag | slugify }}/{% endset %}
<li><a href="{{ tagUrl }}" class="post-tag">{{ tag }}</a>{%- if not loop.last %}, {% endif %}</li>
{%- endfor %}
</ul>

{{ content | safe }}

<hr>

{%- if collections.posts %}
{%- set previousPost = collections.posts | getPreviousCollectionItem %}
{%- set nextPost = collections.posts | getNextCollectionItem %}
{%- if nextPost or previousPost %}
<ul>
{%- if previousPost %}<li>Previous: <a href="{{ previousPost.url }}">{{ previousPost.data.title }}</a></li>{% endif %}
{%- if nextPost %}<li>Next: <a href="{{ nextPost.url }}">{{ nextPost.data.title }}</a></li>{% endif %}
<ul class="links-nextprev">
{%- if previousPost %}<li>Previous: <a href="{{ previousPost.url }}">{{ previousPost.data.title }}</a></li>{% endif %}
{%- if nextPost %}<li>Next: <a href="{{ nextPost.url }}">{{ nextPost.data.title }}</a></li>{% endif %}
</ul>
{%- endif %}
{%- endif %}
8 changes: 4 additions & 4 deletions _includes/postslist.njk
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<ol reversed class="postlist" style="counter-reset: start-from {{ (postslistCounter or postslist.length) + 1 }}">
{% for post in postslist | reverse %}
<li class="postlist-item{% if post.url == url %} postlist-item-active{% endif %}">
<a href="{{ post.url }}" class="postlist-link">{% if post.data.title %}{{ post.data.title }}{% else %}<code>{{ post.url }}</code>{% endif %}</a>
<time class="postlist-date" datetime="{{ post.date | htmlDateString }}">{{ post.date | readableDate("LLLL yyyy") }}</time>
</li>
<li class="postlist-item{% if post.url == url %} postlist-item-active{% endif %}">
<a href="{{ post.url }}" class="postlist-link">{% if post.data.title %}{{ post.data.title }}{% else %}<code>{{ post.url }}</code>{% endif %}</a>
<time class="postlist-date" datetime="{{ post.date | htmlDateString }}">{{ post.date | readableDate("LLLL yyyy") }}</time>
</li>
{% endfor %}
</ol>
8 changes: 4 additions & 4 deletions blog/blog.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"tags": [
"posts"
],
"layout": "layouts/post.njk"
"tags": [
"posts"
],
"layout": "layouts/post.njk"
}
Loading

2 comments on commit e6dc55c

@JosefJezek
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why tabs?

@zachleat
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.