Hash-Dian: An Obsidian Plugin for Hashnode Blog Publishing

Hash-Dian: An Obsidian Plugin for Hashnode Blog Publishing

A bridge between your Obsidian notes and your Hashnode blog

Hello All, here is my submission for Hashnode Api hackathon with Hash-dian

Hash-Dian is an innovative Obsidian plugin designed to streamline the process of publishing directly to your Hashnode blog. With Hash-Dian, you can effortlessly push your notes to Hashnode, apply predefined templates, and even utilise advanced templates with variables.

Features

  • Direct Publishing: Push your Obsidian notes directly to your Hashnode blog with a single click.

  • Templates: Apply predefined templates to your notes, or use advanced templates with variables.

  • Integrated Command Palette: All operations are easily accessible from the command palette.

Why Hash-Dian?

Participating in the Hashnode Hackathon is an opportunity to bring my ideas into reality. I aimed to build any kind of application I liked, as the hackathon was open track. I wanted to solve real problems and create solutions for real-world challenges. Moreover, I saw it as a chance to learn and grow, make new connections in the developer community, and add knowledgeable resources to my network.

Creating Hash-Dian was driven by the desire to simplify the process of publishing my obsidian notes directly to a Hashnode blog. I observed that while there were many tools and methods for content creation and distribution, there was a gap in the market for a simple, integrated solution that leveraged the power of Obsidian and Hashnode. Hence, Hash-Dian was born to fill this gap by providing a straightforward, intuitive interface for publishing directly from Obsidian to Hashnode.

How to Use Hash-Dian?

To get started with Hash-Dian, follow these steps:

Installation:

Currently, the plugin is not available in the Obsidian community plugins list. You will need to manually install it. Follow these steps:

  • Download the(main.js, manifest.json, styles.css)files from latest release assets release page .

  • Create a folder and add these files to the folder and copy the folder to your Obsidian vault's .obsidian/plugins/ directory.

  • Enable the plugin in Obsidian's settings.

    if you encounter any issues, you can follow the below youtube video for successful installation into your obsidian app.

    %[youtube.com/watch?v=ffGfVBLDI_0]

Configuration

To configure Hash-Dian, you need to set up two pieces of information: the Hashnode Personal Access Token and the Hashnode Personal Publication Id.

Hashnode Personal Access Token

The Personal Access Token is like a private key to your Hashnode account. You can use this personal access token to interact with your Hashnode account using the Hashnode API. Here is how to generate your Hashnode Developer Access Token:

  1. Log in to your Hashnode account.

  2. Click on your profile picture at the bottom-left corner of the page on desktop screen or top-right corner on mobile screen.

  3. Click on the Account Settings option from the popup modal to access the settings page.

  4. Click on the DEVELOPER tab.

  5. Click the Generate New Token button to generate a new token for your account.

  6. Copy auto-generated token in the Your Tokens section.

  7. Go to Obsidian's settings and paste the token in HashDian Community Settings Hashnode Personal Access Token.

Hashnode Personal Publication Id

The ID of publication the post belongs to.This can be found in your Hashnode Dashboard url : https://hashnode.com/{PublicationId}/dashboard.

Copy the Publication ID and paste it in HashDian Community Settings Hashnode Personal Publication Id.


Hashnode Community Discord Server

There is a funny story for finding this publication Id. I was playing with hashode graph-ql api at API Playground . To publish the article , we need the publicationId in the payload. I was unable to process which value to pass. I then thought of giving up but at last I wanna try one last time when I saw this.

So I joined in hashnode discord server and asked for help. With in few seconds I got a reply and resolved my query

Thank you Sandro for the help to make this hashDian plugin.


Usage

Once installed, you can access Hash-Dian from Obsidian's command palette. In Obsidian, the command palette is a powerful tool that allows you to quickly perform operations. For the Hash-Dian plugin, you can add three operations: "Publish to Hashnode", "Basic Hashnode Blog Template", and "Advanced Hashnode Blog Template".

Publish to Hashnode

This operation allows users to publish their notes directly to their Hashnode blog. This command parses the markdown content the user currently in and extracts the meta data, blog content and convert it into the format required by the Hashnode API, and then send a POST request to the API endpoint for creating a new post.

Basic Hashnode Blog Template

This operation should allow users to apply basic template which is enough to publish a Hashnode blog. This command inserts the below properties for your blog:


---
title:
subtitle:
coverImageURL.coverImageOptions:
tags:
  -
---

adding this block , it will add properties in Obsidian

Advanced Templates

This operation is similar to "Basic Hashnode Blog Template", but it allows users to apply more complete payload required for POST Call hashnode publishPost mutation payload

References:

publish a post

blogpub github action to publish blogs to dev and medium

api usage reference

Github HashDian

Github Release

Conclusion

Hash-Dian is a powerful tool for Obsidian users who frequently publish to their Hashnode blog. By simplifying the publishing process and offering flexible templating options, Hash-Dian helps you focus on creating content rather than managing technical details. Give it a try today and experience the seamless integration of Obsidian and Hashnode!


Thank you for reading this introduction to Hash-Dian. I hope you find it as useful as I do. If you have any questions or suggestions, please feel free to contact me or comment under this post. And remember, the best way to show your appreciation for my work is to spread the word! Share this post with friends, family, and fellow Hashnode users who might benefit from Hash-Dian.

Stay tuned for more updates and features coming soon!

Did you find this article valuable?

Support vasanth kumar by becoming a sponsor. Any amount is appreciated!