blob: 7a8cbe63fed2099a38267407cd7c096e2d48a37b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>Includes, rsync and Variables - Oh My!</title>
<style>
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
div.columns{display: flex; gap: min(4vw, 1.5em);}
div.column{flex: auto; overflow-x: auto;}
div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
/* The extra [class] is a hack that increases specificity enough to
override a similar rule in reveal.js */
ul.task-list[class]{list-style: none;}
ul.task-list li input[type="checkbox"] {
font-size: inherit;
width: 0.8em;
margin: 0 0.8em 0.2em -1.6em;
vertical-align: middle;
}
.display.math{display: block; text-align: center; margin: 0.5rem auto;}
</style>
<link rel="stylesheet" href="../style.css" />
</head>
<body>
<!-- Content placed here will appear directly after the opening <body> tag -->
<nav>
<a href="/">Home</a><span> / </span>
<a href="/blog">Blog</a><span> / </span>
<a href="/tweaks.html">Tweaks</a><span> / </span>
<a href="https://git.btxx.org/pblog">Download</a>
</nav>
<!-- Do not remove this opening article element -->
<article>
<header id="title-block-header">
<h1 class="title">Includes, rsync and Variables - Oh My!</h1>
<p class="date">Fri, 08 Jul 2022</p>
</header>
<nav id="TOC" role="doc-toc">
<ul>
<li><a href="#default-header-footer-includes" id="toc-default-header-footer-includes">Default “header” & “footer” Includes</a></li>
<li><a href="#syncing-changes-with-rsync" id="toc-syncing-changes-with-rsync">Syncing Changes with rsync</a></li>
<li><a href="#on-the-horizon" id="toc-on-the-horizon">On the Horizon…</a></li>
</ul>
</nav>
<p>Even though <code>pblog</code> was just launched a week ago, it has since been updated with some nice quality-of-life improvements.</p>
<h3 id="default-header-footer-includes">Default “header” & “footer” Includes</h3>
<p>A new variable was added to the main <code>pblog.sh</code> configuration file called <code>INC_HEAD_FOOT</code>. By default this is set to <code>true</code> and simply pulls in two HTML files:</p>
<ul>
<li><code>_header.html</code>: all content within is placed directly after the opening <code>body</code> tag</li>
<li><code>_footer.html</code>: all content within is placed directly before the closing <code>body</code> tag</li>
</ul>
<p>These includes are added to every outputted file from inside both the <code>posts</code> and <code>pages</code> directories on build.</p>
<h3 id="syncing-changes-with-rsync">Syncing Changes with rsync</h3>
<p>Although it adds another dependency to the project, I believe utilizing <code>rsync</code> for the generated files is far better then nuking the directory from orbit each time. This also provides a cleaner experience for users syncing their <code>_output</code> directory with their web server of choice.</p>
<h3 id="on-the-horizon">On the Horizon…</h3>
<p>My plan was to also tackle the issue of “auto rebuilds” when running <code>pblog</code> locally. This became more of a headache than I initially estimated - so it was dropped from this patch. My hope is to get something up-and-running in the near future, while avoiding the inclusion of yet another major dependency. Anyone more experienced than myself in the ways of “auto rebuilds” is free to open a patch if they so desire!</p>
<p>Thanks for your interest in these minor updates!</p>
<p>P.S. Don’t forget - if your website runs on <code>pblog</code> be sure to reach out and get it featured on the <a href="/">homepage</a>!</p>
</article><!-- Do not remove this closing article element -->
<!-- Content placed here will appear directly before the closing </body> tag -->
<footer>
<br>
<hr>
<p><small>Powered by <a href="https://pblog.btxx.org">pblog</a><br>
Made with ♥ for a simpler web.</small></p>
</footer>
</body>
</html>
|