m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/util.rb4
-rw-r--r--src/blog/advent-of-code-2020.html.erb (renamed from src/blog/advent-of-code-2020.html)4
-rw-r--r--src/blog/cheatsheets.html.erb (renamed from src/blog/cheatsheets.html)2
-rw-r--r--src/blog/hex-curler.html.erb (renamed from src/blog/hex-curler.html)3
4 files changed, 6 insertions, 7 deletions
diff --git a/lib/util.rb b/lib/util.rb
index f5321a0..48ac7e1 100644
--- a/lib/util.rb
+++ b/lib/util.rb
@@ -15,6 +15,6 @@ def path_to asset_id
P.path_to asset_id
end
-def git repo
- "https://git.m-chrzan.xyz/#{repo}/about"
+def git repo, path = 'about'
+ "https://git.m-chrzan.xyz/#{repo}/#{path}"
end
diff --git a/src/blog/advent-of-code-2020.html b/src/blog/advent-of-code-2020.html.erb
index 3b78433..24b2280 100644
--- a/src/blog/advent-of-code-2020.html
+++ b/src/blog/advent-of-code-2020.html.erb
@@ -11,7 +11,7 @@ problem. And I'm one of them!
</p>
<p>
-You can see my solutions <a href='https://gitlab.com/m-chrzan/aoc2020'>here</a>.
+You can see my solutions <a href='<%= git 'aoc2020' %>'>here</a>.
I started out with C, moved on to Ruby, and near the end switched to Lua. I'm
going to need some Lua knowledge for the Redis section of the databases class
I'm taking right now, so AoC was a good time to get familiar with the language.
@@ -44,7 +44,7 @@ correctly in the end.
<p>
<i>Day 19 Part 2</i>. Rather than implementing a parser generator that could
handle this grammar by hand, I bodged together a
-<a href='https://gitlab.com/m-chrzan/aoc2020/-/tree/master/19/b'>
+<a href='<%= git 'aoc2020', 'tree/19/b' %>'>
Bison (aka Yacc) solution
</a>. It's not very pretty, especially the Bash script that just calls the
parser with each input word separately and counts how many times it didn't exit
diff --git a/src/blog/cheatsheets.html b/src/blog/cheatsheets.html.erb
index 071c967..1be869a 100644
--- a/src/blog/cheatsheets.html
+++ b/src/blog/cheatsheets.html.erb
@@ -3,7 +3,7 @@ date: November 3, 2019
---
<p>
To stay productive in the command line, I maintain a personal
-<a href="https://gitlab.com/m-chrzan/cheatsheets">"cheatsheets" repository</a>.
+<a href="<%= git 'cheatsheets' %>">"cheatsheets" repository</a>.
There are many commands, or particular options of certain commands, that I don't
use often enough for them to become muscle memory, but often enough for
<code>man</code>ning them or internet searching for "how do I resize an image with
diff --git a/src/blog/hex-curler.html b/src/blog/hex-curler.html.erb
index 8f5f1c6..f3da399 100644
--- a/src/blog/hex-curler.html
+++ b/src/blog/hex-curler.html.erb
@@ -23,8 +23,7 @@ available on most Unix-like systems.
</p>
<p>
-The source code is available <a href='https://gitlab.com/m-chrzan/hex-curler'>on
-my GitLab</a>.
+The source code is available <a href='<%= git 'hex-curler' %>'>here</a>.
</p>
<h3>Let's get curling</h3>