🏡 Go Home My GitHub My Twitter My Discord Email Me

Integrating Obsidian into my blog

May 25th 2021, 12:12 PM (UTC)

## Finding Obsidian This week, at work I was listening to the [latest episode of connected](https://www.relay.fm/connected/344), and I heard [Federico Viticci](https://twitter.com/viticci) talking about [Obsidian](https://obsidian.md). The thing that intrigued me the most about it was the ability to write custom plugins. I love being able to make little changes to the services that I use, so this really sparked my interest. ### Finding my idea I needed an idea to get into Obsidian, so I decided I would integrate it into [my blogging platform](https://blog.actuallyzach.com/posts/88). At first, I thought I could directly integrate it by just editing Quill to support reading from Markdown files, but I decided against that. Mostly because that would require me to rethink a big chunk of how it works. After some thinking, I decided it would be best if I created a custom plugin that allows me to upload my current Obsidian note right onto the blog. ## Development I spent most of the morning looking at the [sample project for Obsidian Plugins](https://github.com/obsidianmd/obsidian-sample-plugin). This is a perfect example of what a sample project should be. It shows off what seems to be every feature of the Obsidian API that someone jumping into making plugins needs. After I got the sample project downloaded and running using NPM I started developing. Since my idea is super simple it was actually fairly easy to implement, the hardest part was dealing with [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS), but once I figured out I can just place `mode: "no-cors"` into my fetch call everything was fixed. Once the Obsidian plugin was written I spent some time tweaking Quill, fixing bugs that popped up while doing this much work with it. ### How does the plugin work? The plugin takes the current file's text and then parses it to extract the title and the date. Once these are extracted a form is constructed and then sent as a POST request to the Quill API. Then, Quill does its magic and the post is uploaded. It is not much different from when I would just email Quill, but it does remove the need for a Zapier integration and allow me to publish right from my text editor. ## Where Obsidian sits now I so far i'm really liking Obsidian. I love the graph view, even though mine is not that impressive right now. It just really pleases me to see all of my notes connected in one giant graph. Other than that I am really liking the customizability and mod-ability of the entire platform. I do wish NPM packages worked better and there was more documentation on what parts of JavaScript just will not work. But besides that being able to just build features into the editor is exactly what I want. It is going to be awesome, and I can't wait to keep diving into it more.

Read More ➔

Making Quill - A Developer Log

March 26th 2021, 3:03 AM (UTC)

I wanted a blogging platform that I could quickly publish new content without much hassle. I also wanted it to be secure and on my own terms. So I did what I always do; barely look for something that already exists and then decide to make my own. I am going to make the rest of this post a developer log about the creation of the platform. Enjoy! ## The idea The purpose of the blog is to be quick and easy to add a new post. The way I am planning to currently do this is by using email. You will email a post in markdown format to a specific email. This will then be converted to HTML and added to the site. ## How it's gonna work When you send an email to the specific email address, it is detected using IFTTT webhooks and Gmail integration. This webhook then sends the body, subject, date, and email to the Quill API. The API will then take that data and form it into a blog post. It will then clone the site, update the HTML for the blog, and commit and push its changes. # Day 1 - Overview Day 1 was planning day. I tried out a variety of methods to see what will be the best way to handle submitting new posts to the blog. ## Choosing the Stack I originally tried to write the API with node.js and express, but my knowledge of PostgreSQL is extremely limited and the node.js integration is quite confusing. This is why I decided to go with Django, as I am much more familiar with Django and Sqlite3. My choice of Django also lets me easily make templates for the HTML that, in the end, will be uploaded to the site. # Day 2 - Overview The python site is now up and running, mostly. I had a lot of success getting the email to be received by the API and double-checked based on the API Key provided. Currently what will happen is that when a post is submitted, it is checked to make sure it has the right API key attached. If it does, the blog post will be submitted; if it does not, the post will be rejected. ### Running git A big part of the site is the ability to upload directly to Github from the API so the website can be updated after you submit a new post. I ran into a lot of issues using GitPython For some reason my files were only sometimes being committed, and when they were, they were usually blank. This is why I decided to go with the current solution of running git through a Python Subprocess. This allows me to essentially use git basically in a command-line environment where I do not have to worry about any libraries. This didn't solve my problem completely, but now commits are actually being committed. However, files are still bank. # Day 3 - Overview Today I took a break and just had some fun doing other things and working on other projects. Always remember to take breaks! # Day 4 - Overview So, it turns out that you need to use `file.close()`. If you don't, files won't update on the file system. Once I implemented this across the code, everything started to work. This one change killed a lot of the project until I found out about it. This is also probably the reason that GitPython was not working correctly, I may try and work GitPython back into the project eventually. # Day 5 - Overview Day 5 was just some cleanup of the code. I switched all of my git code back over to GitPython because it is a lot cleaner than running subprocesses. I also added a refresh API so you can refresh your blog by making a post request to the refresh API. # What next? Quill is just getting started. I am hoping to continue working on it, with bug fixes and new features. The final goal for Quill is to turn it into a bigger blogging service that people can easily spin up their copies of using a robust API and app. However, this is super far down the road and not something I have time to do right now.

Read More ➔

Hello World!

March 18th 2021, 1:01 PM (UTC)

This is the first post on my new blogging engine, Quill. I'm going to be continuously working on this project to make it even better. I have a bunch of plans for this platform and once they are mostly built I plan to open-source it and allow anyone to make a blog with Quill. I will soon be posting a blog post outlining the making of Quill, but for now, Welcome!

Read More ➔