~bt/barf

d64a18df2c43927b787dc3ae1d567814fc38a31e — Bradley Taunt 2 months ago 96eb6e2
Add new post about running barf on MacOS
6 files changed, 207 insertions(+), 2 deletions(-)

M README.md
M build/atom.xml
M build/index.html
A build/macos/index.html
M build/posts.tsv
A posts/macos.md
M README.md => README.md +6 -0
@@ 93,6 93,12 @@ your patches or bug fixes. Thanks!

---

## Running on MacOS

Please refer to the [main tutorial on setting up barf on MacOS](https://barf.bt.ht/macos)

---

## FAQs

### How do I test locally?

M build/atom.xml => build/atom.xml +28 -2
@@ 2,9 2,9 @@
<feed xmlns="http://www.w3.org/2005/Atom">
	<title>barf</title>
	<link href="https://barf.bt.ht/atom.xml" rel="self" />
	<updated>2023-01-06T14:45:05Z</updated>
	<updated>2023-01-18T10:34:50Z</updated>
	<author>
		<name>Bradley Taunt</name>
		<name></name>
	</author>
	<id>https://barf.bt.ht,2023-01-04:default-atom-feed/</id>
	<entry>


@@ 247,4 247,30 @@ tags.&lt;/p&gt;</content>
		<updated>2023-01-05T00:00:00Z</updated>
		<published>2023-01-05T00:00:00Z</published>
	</entry>
	<entry>
		<title>Running `barf` on MacOS</title>
		<content type="html">&lt;h1&gt;Running &lt;code&gt;barf&lt;/code&gt; on MacOS&lt;/h1&gt;
&lt;p&gt;2023-01-18&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;barf&lt;/code&gt; project was built on Linux and was catered towards Linux users. The core of the project will remain focused on Linux/GNU tools, but that doesn&#39;t mean MacOS needs to be left out in the cold.&lt;/p&gt;
&lt;p&gt;There are some very minor changes you&#39;ll need to make in the main &lt;code&gt;barf&lt;/code&gt; script if you plan to run it on MacOS.&lt;/p&gt;
&lt;h2&gt;Download Packages&lt;/h2&gt;
&lt;p&gt;This walkthrough assumes that you already have &lt;a href=&quot;https://brew.sh/&quot;&gt;homebrew&lt;/a&gt; installed on your machine.&lt;/p&gt;
&lt;p&gt;You will need to install the GNU versions of both &lt;code&gt;date&lt;/code&gt; and &lt;code&gt;sed&lt;/code&gt; in order to avoid breaking things when &lt;code&gt;barf&lt;/code&gt; tries to build.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;brew install coreutils
brew install gnu-sed
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;The Script Tweaks&lt;/h2&gt;
&lt;p&gt;Now open the main &lt;code&gt;barf&lt;/code&gt; file in your project and replace all instances of &lt;code&gt;sed&lt;/code&gt; with &lt;code&gt;gsed&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Then change the following variable:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;published_date=$(date -d $basic_date +%FT%TZ)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;published_date=$(gdate -d $basic_date +%FT%TZ)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;After that everything should work perfectly fine. There is probably a cleaner way to do this, but I like to keep things simple.&lt;/p&gt;</content>
		<link href="https://barf.bt.ht/macos"/>
		<id>https://barf.bt.ht/macos</id>
		<updated>2023-01-18T00:00:00Z</updated>
		<published>2023-01-18T00:00:00Z</published>
	</entry>
</feed>

M build/index.html => build/index.html +1 -0
@@ 117,6 117,7 @@
<p>Blogs Are Really Fun</p>
</blockquote>
<hr />
<span class='created'>2023-01-18 &mdash; <a href="macos/">Running `barf` on MacOS</a></span>
<span class='created'>2023-01-05 &mdash; <a href="markdown-examples/">Markdown Examples in barf</a></span>
<footer role="contentinfo">
    <span><a href="#">↑ Back to Top</a></span><br><br>

A build/macos/index.html => build/macos/index.html +135 -0
@@ 0,0 1,135 @@
<!doctype html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Running `barf` on MacOS</title>
	<link href="https://barf.bt.ht/atom.xml" type="application/atom+xml" rel="alternate" title="Atom feed for blog posts" />
	<style>
		* {
			box-sizing: border-box;
		}
		body {
			font-family: sans-serif;
			line-height: 1.45;
			margin: 0 auto;
			max-width: 45rem;
			padding: 0 15px;
		}
		hr {
			background-color: grey;
			border: 0;
			height: 1px;
			margin: 2rem 0;
		}
		nav {
			margin: 2rem 0 0;
		}
		main {
			hyphens: auto;
		}
		main p {
			margin: 1rem;
		}
		h1,h2,h3,h4 {
			margin: 2rem 0 0;
		}
		h1 {
			margin-bottom: 0.5rem;
		}
		h1 + p {
			margin: 0 0 1rem;
		}
		span.created {
			display: block;
			margin: 4px 15px;
		}
		img {
			border: 1px solid lightgrey;
			height: auto;
			max-width: 100%;
			width: auto;
		}
		blockquote {
			background-color: linen;
			border-left: 4px solid lightcoral;
			margin: 2rem 0;
			padding: 10px;
		}
		blockquote p {
			margin: 0;
		}
		figure {
			margin: 2rem 0;
		}
		figcaption {
			color: slategrey;
		}
		code {
			background: #eee;
			padding: 0.3rem;
			tab-size: 4;
		}
		pre {
			background: #eee;
		}
		pre code {
			background: none;
			display: block;
			overflow-x: auto;
			padding: 0.3rem 0.6rem;
		}
		table {
			border-collapse: collapse;
			margin: 2rem 0;
			text-align: left;
			width: 100%;
		}
		tr {
			border-bottom: 1px solid lightgrey;
		}
		tr:nth-of-type(odd) td {
			background-color: #f8f8f8;
		}
		th,td {
			padding: 6px;
		}
		footer {
			border-top: 1px dashed grey;
			margin: 2rem 0;
			padding: 1rem 15px;
		}
	</style>
</head>

<nav>
	<a href="/">Home</a><span> | </span><a href="/about">About</a><span> | </span><a href="/websites">Websites</a><span> | </span><a href="https://git.sr.ht/~bt/barf">Source Code</a>
</nav>

<main>
<h1>Running <code>barf</code> on MacOS</h1>
<p>2023-01-18</p>
<p>The <code>barf</code> project was built on Linux and was catered towards Linux users. The core of the project will remain focused on Linux/GNU tools, but that doesn't mean MacOS needs to be left out in the cold.</p>
<p>There are some very minor changes you'll need to make in the main <code>barf</code> script if you plan to run it on MacOS.</p>
<h2>Download Packages</h2>
<p>This walkthrough assumes that you already have <a href="https://brew.sh/">homebrew</a> installed on your machine.</p>
<p>You will need to install the GNU versions of both <code>date</code> and <code>sed</code> in order to avoid breaking things when <code>barf</code> tries to build.</p>
<pre><code>brew install coreutils
brew install gnu-sed
</code></pre>
<h2>The Script Tweaks</h2>
<p>Now open the main <code>barf</code> file in your project and replace all instances of <code>sed</code> with <code>gsed</code>.</p>
<p>Then change the following variable:</p>
<pre><code>published_date=$(date -d $basic_date +%FT%TZ)
</code></pre>
<p>to this:</p>
<pre><code>published_date=$(gdate -d $basic_date +%FT%TZ)
</code></pre>
<p>After that everything should work perfectly fine. There is probably a cleaner way to do this, but I like to keep things simple.</p>
<footer role="contentinfo">
    <span><a href="#">↑ Back to Top</a></span><br><br>
    <small>
        Built with <a href="https://git.sr.ht/~bt/barf">barf</a>. <br>
        The <a href="https://git.sr.ht/~bt/barf">code for this site</a> is <a href="https://git.sr.ht/~bt/barf/tree/master/item/LICENSE">MIT</a>.
    </small>
</footer>
\ No newline at end of file

M build/posts.tsv => build/posts.tsv +1 -0
@@ 1,1 1,2 @@
posts/markdown-examples.md	Markdown Examples in barf		
posts/macos.md	Running `barf` on MacOS		

A posts/macos.md => posts/macos.md +36 -0
@@ 0,0 1,36 @@
# Running `barf` on MacOS

2023-01-18

The `barf` project was built on Linux and was catered towards Linux users. The core of the project will remain focused on Linux/GNU tools, but that doesn't mean MacOS needs to be left out in the cold.

There are some very minor changes you'll need to make in the main `barf` script if you plan to run it on MacOS.

## Download Packages

This walkthrough assumes that you already have [homebrew](https://brew.sh/) installed on your machine.

You will need to install the GNU versions of both `date` and `sed` in order to avoid breaking things when `barf` tries to build.


    brew install coreutils
    brew install gnu-sed


## The Script Tweaks

Now open the main `barf` file in your project and replace all instances of `sed` with `gsed`.

Then change the following variable:


    published_date=$(date -d $basic_date +%FT%TZ)


to this:


    published_date=$(gdate -d $basic_date +%FT%TZ)


After that everything should work perfectly fine. There is probably a cleaner way to do this, but I like to keep things simple.