Skip to content

Commit 2320178

Browse files
committed
Set defaults for fields and components so bad empty states don't occur
1 parent 2fb8d8c commit 2320178

File tree

8 files changed

+14
-8
lines changed

8 files changed

+14
-8
lines changed

_includes/button.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<a class="button" href="{{ include.link }}"{% if include.color %} style="background: {{ include.color }}"{% endif %}>{{ include.text }}{% if include.icon %}&nbsp; {% include icon.html id=include.icon %}{% endif %}</a>
1+
<a class="button" href="{{ include.link | default: "#" }}"{% if include.color %} style="background: {{ include.color }}"{% endif %}>{{ include.text | default: "Button" }}{% if include.icon %}&nbsp; {% include icon.html id=include.icon %}{% endif %}</a>

_includes/figure.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% if include.alt %}{% assign altText = include.alt %}{% else %}{% assign altText = include.caption %}{% endif %}
22
<figure class="figure{% if include.position %} figure--{{ include.position }}{% endif %}">
3-
<img class="image" src="{{ include.image }}" {% if altText %}alt="Image - {{ altText }}"{% endif %}>
3+
{% if include.image %}<img class="image" src="{{ include.image }}" {% if altText %}alt="Image - {{ altText }}"{% endif %}>{% else %}<small>Image not found</small>{% endif%}
44
{% if include.caption %}<figcaption class="caption">{{ include.caption }}</figcaption>{% endif %}
55
</figure>

_includes/icon.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<svg class="icon icon--{{ include.id }}" role="img"{% if include.title %} aria-label="{{ include.title }} icon"{% endif %}>{% if include.title %}<title>{{ include.title }}</title>{% endif %}<use xlink:href="#{{ include.id }}"{% if include.color %} fill="{{ include.color }}"{% endif %}></use></svg>
1+
<svg class="icon icon--{{ include.id | default: "link" }}" role="img"{% if include.title %} aria-label="{{ include.title }} icon"{% endif %}>{% if include.title %}<title>{{ include.title }}</title>{% endif %}<use xlink:href="#{{ include.id | default: "link" }}"{% if include.color %} fill="{{ include.color }}"{% endif %}></use></svg>

_includes/map.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<div class="map">
2-
<iframe src="https://www.google.com/maps/d/u/0/embed?mid={{ include.id }}"></iframe>
2+
{% if include.id %}<iframe src="https://www.google.com/maps/d/u/0/embed?mid={{ include.id }}"></iframe>{% else %}<small>Map not found</small>{% endif %}
33
</div>

_includes/nav-default.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<nav class="nav">
22
<ul class="list list--nav">
3-
{% for item in site.pages %}
4-
{% unless item.title == false or item.url contains "/page" or item.url contains "/404.html" or item.url contains "/feed." or item.url contains ".json" %}
3+
{% for item in site.html_pages %}
4+
{% unless item.title == false or item.url contains "/page" or item.url contains "/404.html" %}
55
<li class="item item--nav{% if item.url == page.url %} item--current{% endif %}">
66

77
{% if item.url contains '://' %}

_includes/site-header.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<header class="header">
22
<div class="container">
3-
{% include site-logo.html %}
3+
{% if site.logo %}{% include site-logo.html %}{% endif %}
44

55
{% include nav-header.html %}
66
</div>

_layouts/default.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
<link rel="stylesheet" href="{{ "/assets/styles.css" | relative_url }}">
2424

25-
{% include site-favicons.html %}
25+
{% if site.avatarurl %}{% include site-favicons.html %}{% endif %}
2626
</head>
2727
<body class="layout-{{ page.layout }}{% if page.title %} {{ page.title | slugify }}{% endif %}">
2828
{% include site-icons.svg %}

assets/styles.scss

+6
Original file line numberDiff line numberDiff line change
@@ -432,4 +432,10 @@ pre code {
432432
margin: 0;
433433
}
434434
}
435+
.nav a {
436+
padding-left: 0;
437+
padding-right: 0;
438+
margin-left: .2rem;
439+
margin-right: .2rem;
440+
}
435441
}

0 commit comments

Comments
 (0)