Skip to content

Commit fcddc9e

Browse files
committed
add YAML options before-content and after-content
1 parent d88e046 commit fcddc9e

File tree

7 files changed

+71
-2
lines changed

7 files changed

+71
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ One of the major changes in this version is that a lot of time was spent on reth
88
- **BREAKING CHANGE** Removed undocumented YAML options `meta-title` and `meta-description`
99
- **BREAKING CHANGE** Removed `link-tags` config parameter because it wasn't necessary. If you use tags, there will be a tags page created; if you don't use tags there is no tags page.
1010
- Added `share-title` YAML option to give control over the search engine/social media title
11-
- Added `head-extra` YAML option which is similar to `footer-extra` but is used to include custom HTML code in a page's `<head>` tag
11+
- Added `before-content` and `after-content` YAML options that allow you to add some common HTML before the main content of a page (below the title) or after the main content (above the footer). Works in a similar way to `footer-extra`.
12+
- Added `head-extra` YAML option which i s similar to `footer-extra` but is used to include custom HTML code in a page's `<head>` tag
1213
- Added `full-width` YAML option to allow having full-width pages
1314
- Improved the `footer-extra` YAML option to support multiple files instead of only a single file
1415
- Upgraded jQuery to version 3.5.1 to fix a couple security vulnerabilities with the previous version

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,9 @@ These are advanced parameters that are only useful for people who need very fine
172172
Parameter | Description
173173
----------- | -----------
174174
footer-extra | If you want to include extra content below the social media icons in the footer, create an HTML file in the `_includes/` folder (for example `_includes/myinfo.html`) and set `footer-extra` to the name of the file (for example `footer-extra: myinfo.html`). Accepts a single file or a list of files.
175-
head-extra | Works in a similar way to `footer-extra`, but used if you have any HTML code that needs to be included in the `<head>` tag of the page.
175+
before-content | Similar to `footer-extra`, but used for including HTML before the main content of the page (below the title).
176+
after-content | Similar to `footer-extra`, but used for including HTML after the main content of the page (above the footer).
177+
head-extra | Similar to `footer-extra`, but used if you have any HTML code that needs to be included in the `<head>` tag of the page.
176178
language | HTML language code to be set on the page's &lt;html&gt; element.
177179
full-width | By default, page content is constrained to a standard width. Use `full-width: true` to allow the content to span the entire width of the window.
178180
js | List of local JavaScript files to include in the page (eg. `/assets/js/mypage.js`)

_layouts/default.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,21 @@
55
<div class="intro-header"></div>
66

77
<div role="main" class="{% if page.full-width %} container-fluid {% else %} container-md {% endif %}">
8+
{% if page.before-content %}
9+
<div class="before-content">
10+
{% for file in page.before-content %}
11+
{% include {{ file }} %}
12+
{% endfor %}
13+
</div>
14+
{% endif %}
15+
816
{{ content }}
17+
18+
{% if page.after-content %}
19+
<div class="after-content">
20+
{% for file in page.after-content %}
21+
{% include {{ file }} %}
22+
{% endfor %}
23+
</div>
24+
{% endif %}
925
</div>

_layouts/minimal.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,23 @@
2121
<body>
2222

2323
<div role="main" class="{% if page.full-width %} container-fluid {% else %} container-md {% endif %} main-content">
24+
{% if page.before-content %}
25+
<div class="before-content">
26+
{% for file in page.before-content %}
27+
{% include {{ file }} %}
28+
{% endfor %}
29+
</div>
30+
{% endif %}
31+
2432
{{ content }}
33+
34+
{% if page.after-content %}
35+
<div class="after-content">
36+
{% for file in page.after-content %}
37+
{% include {{ file }} %}
38+
{% endfor %}
39+
</div>
40+
{% endif %}
2541
</div>
2642

2743
{% include footer-minimal.html %}

_layouts/page.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,24 @@
77
<div class="{% if page.full-width %} container-fluid {% else %} container-md {% endif %}" role="main">
88
<div class="row">
99
<div class="{% if page.full-width %} col {% else %} col-xl-8 offset-xl-2 col-lg-10 offset-lg-1 {% endif %}">
10+
{% if page.before-content %}
11+
<div class="before-content">
12+
{% for file in page.before-content %}
13+
{% include {{ file }} %}
14+
{% endfor %}
15+
</div>
16+
{% endif %}
17+
1018
{{ content }}
19+
20+
{% if page.after-content %}
21+
<div class="after-content">
22+
{% for file in page.after-content %}
23+
{% include {{ file }} %}
24+
{% endfor %}
25+
</div>
26+
{% endif %}
27+
1128
{% include comments.html %}
1229
</div>
1330
</div>

_layouts/post.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@
3131
</div>
3232
{% endif %}
3333

34+
{% if page.before-content %}
35+
<div class="before-content">
36+
{% for file in page.before-content %}
37+
{% include {{ file }} %}
38+
{% endfor %}
39+
</div>
40+
{% endif %}
41+
3442
<article role="main" class="blog-post">
3543
{{ content }}
3644
</article>
@@ -44,6 +52,14 @@
4452
</div>
4553
{% endif %}
4654

55+
{% if page.after-content %}
56+
<div class="after-content">
57+
{% for file in page.after-content %}
58+
{% include {{ file }} %}
59+
{% endfor %}
60+
</div>
61+
{% endif %}
62+
4763
{% if page.social-share %}
4864
{% include social-share.html %}
4965
{% endif %}

assets/css/beautifuljekyll.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,7 @@ pre {
862862

863863
#social-share-section {
864864
margin-bottom: 1.875rem;
865+
margin-top: 1.875rem;
865866
}
866867

867868
/* --- Notification boxes --- */

0 commit comments

Comments
 (0)