All Projects → Zach-Johnson → bhugo

Zach-Johnson / bhugo

Licence: MIT License
A tool to transform Bear notes into Hugo-compatible markdown files

Programming Languages

go
31211 projects - #10 most used programming language

Labels

Projects that are alternatives of or similar to bhugo

hugo-geekdoc
Hugo theme made for documentation
Stars: ✭ 284 (+456.86%)
Mutual labels:  hugo
hugo-lithium
Lithium - A simple responsive Hugo theme
Stars: ✭ 68 (+33.33%)
Mutual labels:  hugo
onepress
A simple, clean, and responsive "Hugo - Static Site Generator" theme for bloggers
Stars: ✭ 20 (-60.78%)
Mutual labels:  hugo
simpleit-hugo-theme
Responsive Hugo theme for hierarchical content websites
Stars: ✭ 16 (-68.63%)
Mutual labels:  hugo
hugo-wrapper
The universal way to include Hugo binary to your project.
Stars: ✭ 27 (-47.06%)
Mutual labels:  hugo
hugo-theme-lean-launch-page
A theme for people creating pre-launch pages for a product or business. Allows you to have a landing page while collecting emails.
Stars: ✭ 26 (-49.02%)
Mutual labels:  hugo
hugo jupyter
Publish Jupyter notebooks with Hugo
Stars: ✭ 69 (+35.29%)
Mutual labels:  hugo
hugo-shortcodes-netlify-cms
Shortcodes of Hugo for Netlify CMS Text Editor
Stars: ✭ 50 (-1.96%)
Mutual labels:  hugo
markdown-github-bear-toc
Autogenerated Table of Contents for Github Markdown or Bear Notes
Stars: ✭ 79 (+54.9%)
Mutual labels:  bear
hugo-theme-mixedpaper
A Hugo theme
Stars: ✭ 17 (-66.67%)
Mutual labels:  hugo
huge
This is HUGE! A Hugo framework.
Stars: ✭ 17 (-66.67%)
Mutual labels:  hugo
hugo-apero-docs
Apéro is a Hugo theme for personal websites. This is the documentation site, made with the theme 🍋
Stars: ✭ 56 (+9.8%)
Mutual labels:  hugo
hugo-blog-template
Use This Templateからforkできます
Stars: ✭ 15 (-70.59%)
Mutual labels:  hugo
hugo-cloak-email
A Hugo theme component to cloak email adresses
Stars: ✭ 71 (+39.22%)
Mutual labels:  hugo
medium-2-md
A CLI tool that converts exported Medium posts (html) to Jekyll/Hugo compatible markdown with front matter.
Stars: ✭ 113 (+121.57%)
Mutual labels:  hugo
quartz
🌱 host your own second brain and digital garden for free
Stars: ✭ 374 (+633.33%)
Mutual labels:  hugo
hugo-atom-feed
Hugo theme component for ATOM feed custom Output Format
Stars: ✭ 29 (-43.14%)
Mutual labels:  hugo
website
The code which powers jacobtomlinson.dev
Stars: ✭ 16 (-68.63%)
Mutual labels:  hugo
hugo-shopping-product-catalogue-simple
Hugo theme for shopping product catalogue
Stars: ✭ 45 (-11.76%)
Mutual labels:  hugo
vim-hugo-helper
A small Vim plugin with a set of helpers for Hugo https://gohugo.io
Stars: ✭ 82 (+60.78%)
Mutual labels:  hugo

Bhugo

Bhugo is a simple tool written in Go that transforms Bear notes into Hugo-compatible markdown files. It runs in the background so that whenever you make changes to your Bear notes, you can immediately see the updates on your Hugo server.

Bhugo will monitor a directory of Bear notes based off of a configurable tag prefix. For example, if you prefix all your Bear notes as #blog ( #blog/finance, #blog/life etc.), configure Bhugo to monitor the blog prefix. Bhugo will preserve any custom front matter that you add to your Hugo files.

Bhugo does it’s best to stay out of your way, with only a few requirements for how you write your notes:

  • Write your notes in markdown compatibility mode.
  • The first line of your note is treated as the title and is used to create the Hugo files and insert the title into the Hugo front matter - a note titled My Great Post will generate a file called my-great-post.md.
  • The second line of your note is expected to be hashtags (and optionally other text), which will correlate to either Hugo categories or tags in the front matter.
  • You can insert images into your Bear notes and they will be formatted to match the configurable environment variable designating the image directory in your Hugo blog - so save your images in your Hugo site as you would normally and then insert them directly into your Bear note.
  • The draft tag has special meaning and will specifically mark the post as a draft in the Hugo front matter, for example #blog/draft.

Warning

Bhugo will blow away the body of an existing file in the CONTENT_DIR directory if it already exists. For example, if you title a Bear note My New Post and there is an existing file called my-new-post.md the body of that file will be truncated and replaced with the content from your Bear note. Any custom front matter in that file, however, will be preserved.


Installation

Configuration

Create a .bhugo wherever you like - a good spot is in the root of your Hugo site. You’ll need to configure this file with several values:

# Required - substitute your username and Hugo site directory.
DATABASE="/Users/<username>/Library/Group Containers/9K33E3U3T4.net.shinyfrog.bear/Application Data/database.sqlite"
HUGO_DIR=/Users/<username>/my-awesome-blog

# Optional - defaults listed below
CONTENT_DIR=content/blog
IMAGE_DIR=/img/posts
NOTE_TAG=blog
INTERVAL=1s
CATEGORIES=true
TAGS=false

Substitute your username in the DATABASE variable - this is where Bear stores it’s data. Bhugo is read-only on this database but if it makes you feel better, back up that file.

HUGO_DIR is the root directory of your Hugo blog.

CONTENT_DIR is the output directory relative to the HUGO_DIR that Bhugo will save posts to.

IMAGE_DIR is the image directory relative to HUGO_DIR/static.

NOTE_TAG is the tag prefix in Bear that Bhugo will monitor.

INTERVAL is how often Bhugo will check for changes to Bear notes. Valid values given by time.Duration.

CATEGORIES is a boolean value indicating that Bhguo will treat Bear hashtags as Hugo categories in the front matter.

TAGS is a boolean value indicating that Bhguo will treat Bear hashtags as Hugo tags in the front matter.


Example set up:

Configure a .bhugo file:

Start up Bhugo from the same directory where your .bhugo file is:

Make some changes to an existing note, with hashtags prefixed with the NOTE_TAG value from the .bhugo file:

You should see the change reflected in your Hugo content file:

And a message from Bhugo telling you it made an update:

Contributing

Pull requests, feature requests, bug reports, and general feedback are all more than welcome.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].