Skip to content

Commit 383e296

Browse files
authored
Merge pull request #149 from orionrobots/fix-descriptions
Fix descriptions
2 parents 8dcb565 + 3fd8f8c commit 383e296

35 files changed

+111
-135
lines changed

_includes/layouts/common.liquid

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
---
2-
theme:
3-
name: orionrobots
4-
---
51
{% comment %}{% capture BASE_PATH %}{% if eleventy.env.runMode == "serve" %}{% else %}{{ site.production_url }}{% endif %}{% endcapture %}{% endcomment %}
62
{% capture BASE_PATH %}{{ site.production_url }}{% endcapture %}
73
{% capture ASSET_PATH %}{{ BASE_PATH }}/assets/themes/{{ theme.name }}{% endcapture %}
@@ -25,9 +21,16 @@ theme:
2521
<meta name="og:site_name" property="og:site_name" content="Orionrobots" />
2622
<meta property="og:type" name="og:type" content="article" />
2723
<meta name="og:title" property="og:title" content="{{ title }} | {{ site_title }} - {{ site_tagline }}" />
28-
{% if description %}
29-
<meta name="og:description" property="og:description" content="{{ description }}" />
30-
{% endif %}
24+
{% capture real_description -%}
25+
{% if description -%}
26+
{{ description }}
27+
{%- else -%}
28+
{{ content | strip_html | strip_newlines | truncatewords: 50 }}
29+
{%- endif -%}
30+
{%- endcapture %}
31+
<meta name="og:description" property="og:description" content="{{ real_description }}" />
32+
<meta name="description" content="{{ real_description }}">
33+
3134
{% if thumbnail %}
3235
<meta name="og:image" property="og:image" content="{{ BASE_PATH }}/{% thumbnail_from_path thumbnail %}" />
3336
<meta name="twitter:image" content="{{ BASE_PATH }}/{% thumbnail_from_path thumbnail %}" />
@@ -38,11 +41,9 @@ theme:
3841

3942
<meta name="viewport" content="width=device-width, initial-scale=1">
4043
<title>{{ title }} | {{ site_title }} - {{ site_tagline }}</title>
41-
{% if description %}<meta name="description" content="{{ description }}">{% endif %}
4244
<meta name="author" content="{{ author | default: "Danny Staple"}}">
4345
<meta name="article:author" property="article:author" content="{{ author | default: "Danny Staple"}}">
4446

45-
4647
<script type="text/javascript" src="/dist/bundle.js"></script>
4748
{% capture css %}{% include css/bootstrap-style.css %}{% endcapture %}
4849
<style>{{ css | cssmin }}
@@ -56,9 +57,35 @@ theme:
5657
<body class="template">
5758
<div class="container">
5859
<!-- Header -->
59-
{% include nav.liquid %}
60+
{% include nav.liquid %}
6061
<!-- Content -->
61-
{{ content }}
62+
<div class="row">
63+
<div id="col-main" class="content {{ content_class }}">
64+
<div class="gcse-searchresults"></div>
65+
<nav class="row g-0 border rounded tag-row">
66+
<div class="row g-0">
67+
{% unless tags == empty %}
68+
<nav>
69+
{% assign tags_list = tags %}
70+
{% include tags_list %}
71+
</nav>
72+
{% endunless %}
73+
</div>
74+
<div class="row g-0">{% include social-sharing %}</div>
75+
</nav>
76+
<h2 class="page-header">{{ title }} {% if tagline %}<small>{{tagline}}</small>{% endif %}</h2>
77+
<div class="row-fluid post-full">
78+
<div class="span12">
79+
{% block post_info %}{% endblock %}
80+
</div>
81+
</div>
82+
<article>
83+
{% block content %}{% endblock %}
84+
{{ content }}
85+
</article>
86+
</div>
87+
{% block side_bar %}{% endblock %}
88+
</div>
6289
<footer id="bottom">
6390
<div class="row" id="footer-left">
6491
<div class="co-lg-12">
@@ -83,4 +110,19 @@ theme:
83110
</footer>
84111
</div>
85112
</body>
113+
{% if using_mathjax %}
114+
<script>
115+
MathJax = {
116+
tex: {
117+
inlineMath: [['$', '$']]
118+
},
119+
svg: {
120+
fontCache: 'global'
121+
}
122+
};
123+
</script>
124+
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
125+
{% endif %}
126+
{% block footer_scripts %}
127+
{% endblock %}
86128
</html>

_includes/layouts/default.liquid

Lines changed: 17 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,24 @@
1-
---
2-
theme :
3-
name : orionrobots
4-
layout: common
5-
---
6-
<div class="row">
7-
<article id="col-main" class="content col-md-8">
8-
<div class="gcse-searchresults"></div>
9-
<nav class="row g-0 border rounded tag-row">
10-
<div class="row g-0">
11-
{% unless tags == empty %}
12-
<nav>
13-
{% assign tags_list = tags %}
14-
{% include tags_list %}
15-
</nav>
16-
{% endunless %}
17-
</div>
18-
<div class="row g-0">{% include social-sharing %}</div>
19-
</nav>
20-
<h2 class="page-header">{{ title }} {% if tagline %}<small>{{tagline}}</small>{% endif %}</h2>
21-
{{ content }}
22-
{% if comments %}
23-
{% include disqus_thread %}
24-
{% endif %}
1+
{% assign content_class="col-md-8" %}
252

26-
</article>
27-
<aside class="col-md-4">
28-
{% include sidebar-book.liquid %}
29-
{% comment %}{% include sidebar_ads.liquid %}{% endcomment %}
30-
</aside>
31-
</div>
32-
{% if using_mathjax %}
33-
<script>
34-
MathJax = {
35-
tex: {
36-
inlineMath: [['$', '$']]
37-
},
38-
svg: {
39-
fontCache: 'global'
40-
}
41-
};
42-
</script>
43-
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
44-
{% endif %}
3+
{% layout layouts/common %}
4+
5+
{% block content %}
6+
{% if comments %}
7+
{% include disqus_thread %}
8+
{% endif %}
9+
{% endblock %}
10+
11+
{% block side_bar %}
12+
<aside class="col-md-4">
13+
{% include sidebar-book.liquid %}
14+
</aside>
15+
{% endblock %}
16+
17+
{% block footer_scripts %}
4518
<script>
4619
const newSlug = "{{ date | date: '%Y-%m-%d' }}-{{ slug }}";
4720
document.addEventListener("DOMContentLoaded", function(event) {
4821
document.addPostAdminButton(newSlug);
4922
});
5023
</script>
24+
{% endblock %}

_includes/layouts/gallery.liquid

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
2-
layout: page
2+
layout: default
33
---
44
{{ content }}

_includes/layouts/index.liquid

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,2 @@
1-
---
2-
theme :
3-
name : orionrobots
4-
layout: common
5-
date: Last Modified
6-
---
7-
<div class="row">
8-
<article id="col-main" class="content col-md-12">
9-
<div class="gcse-searchresults"></div>
10-
<nav class="row g-0 border rounded tag-row">
11-
<div class="row g-0">
12-
{% unless tags == empty %}
13-
<nav>
14-
{% assign tags_list = tags %}
15-
{% include tags_list %}
16-
</nav>
17-
{% endunless %}
18-
</div>
19-
<div class="row g-0">{% include social-sharing %}</div>
20-
</nav>
21-
<h2 class="page-header">{{ title }} {% if tagline %}<small>{{tagline}}</small>{% endif %}</h2>
22-
{{ content }}
23-
</article>
24-
</div>
25-
{% if using_mathjax %}
26-
<script>
27-
MathJax = {
28-
tex: {
29-
inlineMath: [['$', '$']]
30-
},
31-
svg: {
32-
fontCache: 'global'
33-
}
34-
};
35-
</script>
36-
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
37-
{% endif %}
1+
{% assign content_class="col-md-12" %}
2+
{% layout layouts/common %}

_includes/layouts/post.liquid

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,7 @@
1-
---
2-
layout: default
3-
---
4-
<div class="row-fluid post-full">
5-
<div class="span12">
6-
<div class="date">
7-
<time>{{ page.date | date_to_long_string }}</time>
8-
<div class="author">by {{ page.author | default: author | default: "Danny Staple" }}</div>
9-
</div>
10-
11-
<article class="content">
12-
{{ content }}
13-
</article>
14-
</div>
1+
{% layout layouts/default %}
2+
{% block post_info %}
3+
<div class="date text-secondary">
4+
<time class="d-inline">{{ page.date | date_to_long_string }}</time>
5+
<div class="author d-inline">by {{ page.author | default: author | default: "Danny Staple" }}</div>
156
</div>
7+
{% endblock %}

content/2014/01/2014-01-30-my_plan.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
date: '2014-01-30'
33
description: What I plan to do first with the CNC
4-
layout: default
54
tags:
65
- cnc projects
76
- plans

content/2014/02/2014-02-03-unboxing-and-setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
date: '2014-02-03'
33
description: CNC Mill Unboxing and Setup
4-
layout: default
4+
55
tags:
66
- cnc projects
77
- stepper motors

content/2014/02/2014-02-04-connecting-it-to-grbl.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Connecting my CNC 3020 to grbl
33
description: Connecting my CNC 3020 to grbl
44
tags: [cnc projects, arduino, grbl, electronics, parallel port]
5-
layout: default
5+
66
---
77

88
## Connections

content/2014/02/2014-02-05-teardown.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
date: '2014-02-05'
33
description: Getting inside the CNC Machine electronics
4-
layout: default
4+
55
tags:
66
- cnc projects
77
- electronics

content/2014/02/2014-02-06-it-moves.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
date: '2014-02-06'
3-
layout: default
3+
44
tags:
55
- cnc projects
66
- electronics

0 commit comments

Comments
 (0)