Skip to content

Commit

Permalink
Add more raw specifiers to make jekyll not work on specific regions
Browse files Browse the repository at this point in the history
  • Loading branch information
themkat committed Oct 22, 2024
1 parent 973987a commit 61f6734
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion org/_posts/2024-10-22-how_i_blog_with_emacs.org
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ After covering the Emacs part above, you would probably guess that the rest of t

In addition to the above, I also have some additional tooling in place. The pipeline ends up as:

{% raw %}
#+BEGIN_SRC yaml
name: Jekyll site CI

Expand Down Expand Up @@ -224,7 +225,7 @@ In addition to the above, I also have some additional tooling in place. The pipe
uses: actions/deploy-pages@v4

#+END_SRC

{% endraw %}

There are a few small things here you might be puzzled at. Doesn't Github Pages have built-in support for Jekyll? Then why do I need to do all this extra setup Ruby stuff?? That is because I want more control. I use some plugins (covered in a few sections) and also a script that minifies the HTML. Running Jekyll myself, as well as doing more setup, gives me more control of the process. If you wanted a more simple sites without any Ruby plugins, you could just use the built in support from Github with a far simpler pipeline.

Expand Down Expand Up @@ -304,18 +305,21 @@ It is used for the pagination plugin (to get multiple pages of blog posts), to g

** Creating pages to show posts with a specific tag
To create tag pages, I just make a simple HTML layout in Jekyll. Like all other pages, we can give metadata in a header that the layout can read. In other words, we simply need to generate pages like the following, and Jekyll will take care of the rest:
{% raw %}
#+BEGIN_VERSE
---
title: "Tag: emacs"
layout: tag
tag: emacs
---
#+END_VERSE
{% endraw %}
(example is from the pages tagged with the Emacs tag)


If you have ever written a bash script before, you will probably figure out this one quite easily. We simply parse all the posts, filter unique tags, then make a page like the above for each tag.

{% raw %}
#+BEGIN_SRC bash
#!/bin/bash

Expand All @@ -331,6 +335,7 @@ If you have ever written a bash script before, you will probably figure out this
fi
done
#+END_SRC
{% endraw %}

This time you will probably have a harder time guessing how the HTML layout page looks. After all, what are we supposed to do there? If you think about it for a while, it is not that hard. We have the tag from the metadata, so we simply need to parse the Jekyll array structures and filter the posts that have the tag we are looking for. Fortunately, Jekyll keeps an array/list with all posts for a given tag:

Expand Down

0 comments on commit 61f6734

Please sign in to comment.