This post was written as follow-up to my previous post where I implemented a custom Hugo shortcode, attachments.html, documented in attachments.html below. The implementation of this shortcode required a Hugo Page Bundles content structure and the transition to such a structure is documented below in Page Bundles Structure.


This shortcode, attachments.html, was lifted from Hugo Attachment shortcode, a blog post by Nelis Oostens. Successfull implementation of this shortcode one minor modification (my theme did not have a referenced partial) and conversion of my content/posts from individual Markdown (.md) files to a to Page Bundles Structure, as described below.

Page Bundles Structure

Transitioning this blog to a page bundles organizational strucuture involved running the script which I named I was only interested in transforming the content/posts portion of this blog so I ran the script like so:

cd ~/GitHub/dlad-blog/content/posts

The fact that you are able to read this post is proof that the script worked.

The script is listed here:

for FILE in *.md
  # remove the last dot and subsequent chars to name the folder from the .md
  mkdir -p "$DIR"
  mv "$FILE" "$DIR"
find ./ -iname '*.md' -execdir mv -i '{}' \;

PDF Creation

Before wrapping this up, it’s worth mentioning that the .pdf attachments you see in my previous post were created from Markdown (.md) files using VSCode. Specifically, I installed and used the Markdown PDF extension for VSCode. It’s really cool, so I suspect you’ll be seeing more “attachments” in my posts now that I have it.

There will probably be more before long, but for now… that’s a wrap.