Introducing ai-blog.el: Streamline Your Blogging Process with OpenAI and Emacs

Are you tired of staring at a blank screen, struggling to come up with blog post ideas? Do you dread the process of finding the right images for your posts? ai-blog.el, an Emacs package that leverages the power of OpenAI’s ChatGPT, OpenAI’s DALL-E, Pexels, Google Images, and Bing Image Search, can take the pain out of the blogging process and streamline your workflow.

ai-blog.el offers a range of features to help you write blog posts more efficiently in Hugo. With persona-based content generation, you can create content that suits different styles and tones. The package provides functions to generate tags that can improve the SEO of your content. Moreover, you can easily download and insert images into your blog posts, either as part of the content or as a featured image.

Installation is straightforward. Clone the repository into your preferred directory, load it, and add it to your configuration. You’ll need API keys for each service you want to use, which you can add to your configuration as well.

Once you’ve installed and configured the package, you can generate blog posts with ChatGPT and easily add them to your blog. To write blog posts, ai-blog.el uses a custom system prompt and a user prompt prefix. To add a new persona, simply create files named personas/NAME.system and personas/NAME.prompt.

Tag Generation

To generate SEO-friendly tags for your blog post, you can use the ai-blog-generate-tags function. And when it comes to adding images, you have the choice of using ChatGPT and OpenAI’s DALL-E, Pexels, Google Images, or Bing Image Search. By default, ai-blog.el generates five images with DALL-E and retrieves ten images with Pexels. You can tweak these settings to suit your needs.

As for image generation and search, ai-blog.el provides the following functions:

  • ai-blog-insert-image-dall-e to insert an image generated using DALL-E.
  • ai-blog-insert-image-pexels to insert an image downloaded from Pexels.
  • ai-blog-insert-image-google to insert an image downloaded from Google Images through SerpApi.
  • ai-blog-insert-image-bing to insert an image downloaded from Bing Image Search.

These will add a {{ figure }} macro to your post, including alt and longdesc attributes.

For adding a featured image to your blog post, you can use the following functions:

  • ai-blog-insert-featured-image-dall-e to insert a featured image generated using DALL-E.
  • ai-blog-insert-featured-image-pexels to insert a featured image downloaded from Pexels.
  • ai-blog-insert-featured-image-google to insert a featured image downloaded from Google Images through SerpApi.
  • ai-blog-insert-featured-image-bing to insert a featured image downloaded from Bing Image Search.

These will add a image: field to the top of your front matter. This field can be customized with ai-blog-featured-image-field-name.

As with any open-source project, contributions are welcome. Whether you find a bug, have a feature request, or want to contribute some code, the project’s GitHub repository is the place to go.

comments powered by Disqus