diff --git a/src/server.js b/src/server.js
index c26f332..5b65631 100644
--- a/src/server.js
+++ b/src/server.js
@@ -138,6 +138,12 @@ app.engine('handlebars', handlebars({
},
slug(string) {
return string.toLowerCase().replaceAll(/ /g, '-');
+ },
+ section(name, options) {
+ if (!this._sections) this._sections = {};
+ if (!this._sections[name]) this._sections[name] = [];
+ this._sections[name].push(options.fn(this));
+ return null;
}
}
}));
diff --git a/views/account/account.handlebars b/views/account/account.handlebars
index 0e629c6..f8bdf71 100644
--- a/views/account/account.handlebars
+++ b/views/account/account.handlebars
@@ -1,4 +1,6 @@
-
+{{#section 'head'}}
+
+{{/section}}
{{> header}}
@@ -205,4 +207,6 @@
-
+{{#section 'foot'}}
+
+{{/section}}
diff --git a/views/account/login.handlebars b/views/account/login.handlebars
index 4c2461f..f145462 100644
--- a/views/account/login.handlebars
+++ b/views/account/login.handlebars
@@ -1,4 +1,6 @@
-
+{{#section 'head'}}
+
+{{/section}}
{{> header}}
diff --git a/views/account/miieditor.handlebars b/views/account/miieditor.handlebars
index 84faca1..aeb374b 100644
--- a/views/account/miieditor.handlebars
+++ b/views/account/miieditor.handlebars
@@ -1,4 +1,6 @@
-
+{{#section 'head'}}
+
+{{/section}}
-
-
+{{#section 'foot'}}
+
+
+{{/section}}
diff --git a/views/account/register.handlebars b/views/account/register.handlebars
index 4a0b7fd..ba3fbbb 100644
--- a/views/account/register.handlebars
+++ b/views/account/register.handlebars
@@ -1,5 +1,7 @@
-
-
+{{#section 'head'}}
+
+
+{{/section}}
{{> header}}
diff --git a/views/account/upgrade.handlebars b/views/account/upgrade.handlebars
index 8dea3df..ae1ff64 100644
--- a/views/account/upgrade.handlebars
+++ b/views/account/upgrade.handlebars
@@ -1,4 +1,7 @@
-
+{{#section 'head'}}
+
+{{/section}}
+
-
+{{#section 'foot'}}
+
-
+
+{{/section}}
diff --git a/views/blog/blog.handlebars b/views/blog/blog.handlebars
index 4525c26..c0767d1 100644
--- a/views/blog/blog.handlebars
+++ b/views/blog/blog.handlebars
@@ -1,4 +1,6 @@
-
+{{#section 'head'}}
+
+{{/section}}
{{> header}}
diff --git a/views/blog/blogpost.handlebars b/views/blog/blogpost.handlebars
index 610bb41..8f8430b 100644
--- a/views/blog/blogpost.handlebars
+++ b/views/blog/blogpost.handlebars
@@ -1,4 +1,6 @@
-
+{{#section 'head'}}
+
+{{/section}}
{{> header}}
@@ -29,7 +31,9 @@
-
-
-
-
+{{#section 'foot'}}
+
+
+
+
+{{/section}}
diff --git a/views/docs/docs.handlebars b/views/docs/docs.handlebars
index b080960..c6940bc 100644
--- a/views/docs/docs.handlebars
+++ b/views/docs/docs.handlebars
@@ -1,4 +1,6 @@
-
+{{#section 'head'}}
+
+{{/section}}
@@ -48,9 +50,11 @@
-
+{{#section 'foot'}}
+
-
-
-
-
+
+
+
+
+{{/section}}
diff --git a/views/docs/install.handlebars b/views/docs/install.handlebars
index 81be478..8f5f194 100644
--- a/views/docs/install.handlebars
+++ b/views/docs/install.handlebars
@@ -1,4 +1,6 @@
-
+{{#section 'head'}}
+
+{{/section}}
@@ -64,9 +66,11 @@
-
+{{#section 'foot'}}
+
-
-
-
-
+
+
+
+
+{{/section}}
diff --git a/views/docs/search.handlebars b/views/docs/search.handlebars
index b05907a..83d087a 100644
--- a/views/docs/search.handlebars
+++ b/views/docs/search.handlebars
@@ -1,4 +1,6 @@
-
+{{#section 'head'}}
+
+{{/section}}
@@ -53,63 +55,64 @@
-
+{{#section 'foot'}}
+
-
+
-
-
+
+
-
+ input.classList.add('has-matches');
+ if (matches.length > 0) {
+ matches.forEach(match => {
+ const errorCode = match.item.padEnd(12, 'X');
+ const matchLink = document.createElement('a');
+ matchLink.innerText = errorCode;
+ matchLink.href = `/docs/errors/${errorCode}`;
+ matchesContainer.appendChild(matchLink);
+ });
+ } else {
+ const noMatch = document.createElement('p');
+ noMatch.innerText = '{{ locale.docs.search.no_match }}';
+ matchesContainer.appendChild(noMatch);
+ }
+ });
+
+{{/section}}
diff --git a/views/docs/welcome.handlebars b/views/docs/welcome.handlebars
index 76d7b25..85b541b 100644
--- a/views/docs/welcome.handlebars
+++ b/views/docs/welcome.handlebars
@@ -1,4 +1,6 @@
-
+{{#section 'head'}}
+
+{{/section}}
@@ -92,9 +94,11 @@
-
+{{#section 'foot'}}
+
-
-
-
-
+
+
+
+
+{{/section}}
diff --git a/views/layouts/blog-opengraph.handlebars b/views/layouts/blog-opengraph.handlebars
index 515fc1d..739e741 100644
--- a/views/layouts/blog-opengraph.handlebars
+++ b/views/layouts/blog-opengraph.handlebars
@@ -62,6 +62,10 @@
}
+ {{#each _sections.head}}
+ {{{this}}}
+ {{/each}}
+
@@ -72,5 +76,8 @@
+ {{#each _sections.foot}}
+ {{{this}}}
+ {{/each}}