Skip to content

Simple Guide with Hugo

Yunfi edited this page Nov 25, 2024 · 2 revisions

Note

WIP notice! Not fully done.

This will be a simply guide on how to use this plugin with hugo and GitHub pages. Using other site generator should have a similar approach.

Step 0

Please read the README to understand how this plugin works!

Step 1: Have a working Hugo site.

Follow Hugo's guide: Quick start | Hugo and Host on GitHub Pages | Hugo.

By doing this, you should now have

  1. A GitHub repo, whose content/posts directory containes some demo posts.
  2. A website hosted on GitHub Pages.

Step 2: Setup this plugin.

Open Obsidian Community plugins list and install this plugin. Then enable it and go to it's settings.

Most settings should be easy to understand, besides these:

  • Target Path: should be content/posts in this case
  • Post prefix: should be posts in this case
  • Published flag: I'll use is_published in this example, since hugo considers the default published value as an alias of publishedDate/

Step 3: Pick the notes you want to upload.

Add is_published: true to those notes you want to upload. Also don't forget to add a slug property.

Step 4: Upload!

Click the Upload All button on the ribbon bar. If everything goes well, your notes should be pushed to the content/posts dir in remote repo, and then deployed to the website!