obsidian-micropub/README.md

96 lines
3.6 KiB
Markdown
Raw Permalink Normal View History

2023-06-10 08:45:37 +02:00
# Micropub
2023-06-11 18:16:41 +02:00
Micropub is a community maintained plugin for [Obsidian](https://obsidian.md/) to publish notes your own site with [Micropub](https://indieweb.org/Micropub).
2022-09-22 15:34:39 +02:00
2023-06-11 18:02:52 +02:00
## Credits
2022-09-22 15:34:39 +02:00
2023-06-11 18:02:52 +02:00
- Forked from https://github.com/otaviocc/obsidian-microblog, this was used as the base, since Micro.blog also uses the Micropub standard under the hood
- With code from https://github.com/lijyze/obsidian-state-switcher, to manipulate the yaml frontmatter of notes
## Donating
Does this plugin improve your workflow? Say thanks with a coffee to the [original author](https://github.com/otaviocc).
2023-02-08 20:03:20 +01:00
2023-05-28 17:55:32 +02:00
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/Z8Z0C9KPT)
2023-02-08 20:03:20 +01:00
2023-06-11 18:02:52 +02:00
## Status
This plugin is considered alpha software. Even though the publish workflow lets you publish notes, there are a lot of things that are not implemented, most notably:
- **Proper [RelMeAuth Flow](https://indieweb.org/RelMeAuth)**, for now you need to generate a static token that is validated by the Micropub endpoint and save that token in the settings of the plugin.
- **Updating posts**, once you have published at note, it is not possible to publish it again, making use of the [Micropub update action](https://www.w3.org/TR/micropub/#h-update).
- **Writing back tags, publish date, etc. to the frontmatter**, as this requires a `q=source` call to the micropub endpoint which is missing at the moment.
2023-06-11 18:16:41 +02:00
- **More configuration options**, for setting the names of targeted frontmatter fields, or for toggling on and of optional features like fetching tags, etc.
## Micropub Details
This plugin makes use of a few micropub features, including a few non-standard extensions
- `mp-destination` for potentially selecting a publishing destination. (https://indieweb.org/Micropub-extensions#Destination)
- `q=category` for receiving a list of existing tags/categories from the server (https://indieweb.org/Micropub-extensions#Query_for_Category/Tag_List)
- `q=config` for receiving a list of publishing channels on a site (https://github.com/indieweb/micropub-extensions/issues/40)
- `q=source` for checking for existing posts before attempting to update them (https://www.w3.org/TR/micropub/#configuration)
2023-06-11 18:02:52 +02:00
2022-09-22 15:34:39 +02:00
## Installing
This plugin will be available via *Community Plugins* soon.
## Screenshots
### Preferences
2023-06-11 18:02:52 +02:00
From the preferences window it is possible to log in using Micropub.
2022-09-22 15:34:39 +02:00
2022-09-25 23:33:52 +02:00
![](images/01-preferences.png)
2023-06-11 18:16:41 +02:00
Once logged in, the plugin allows to set default values for tags, post visibility, and default blog (in case the user has more than one hosted blog). These default values will be used when posting to your site.
2022-09-25 23:33:52 +02:00
![](images/02-preferences.png)
2022-09-22 15:34:39 +02:00
### Command
2023-06-11 18:16:41 +02:00
Micropub is triggered using Obsidian's command palette.
2022-09-22 15:34:39 +02:00
2022-09-25 23:33:52 +02:00
![](images/03-command.png)
2022-09-22 15:34:39 +02:00
### Publish
2022-09-25 23:33:52 +02:00
Before publishing, it's possible to edit the title, override default values, and/or select a different blog to post to.
![](images/04-review.png)
After publishing, a confirmation window with the post links is presented.
2022-09-22 15:34:39 +02:00
2022-09-25 23:33:52 +02:00
![](images/05-confirmation.png)
2022-09-22 15:34:39 +02:00
2022-09-22 15:54:19 +02:00
## Building from source
2022-09-22 15:34:39 +02:00
Clone this repository inside the Obsidian Vault:
```
$ cd .obsidian/plugins/
2023-06-11 18:02:52 +02:00
$ git clone https://git.inhji.de/inhji/obsidian-micropub
2022-09-22 15:34:39 +02:00
```
Resolve the plugin dependencies and build it:
```
2023-06-11 18:02:52 +02:00
$ cd obsidian-micropub
2022-09-22 15:34:39 +02:00
$ npm i
$ npm run build
```
Restart Obsidian and enable the plugin from *Community Plugins* in Preferences.
## Contributing
2022-09-22 15:54:19 +02:00
1. Fork this repository and follow the steps from the previous section using the forked repository instead
2. Create a feature branch for the changes
2022-09-25 23:33:52 +02:00
3. Commit the changes and push them to the forked repository
2022-09-22 15:54:19 +02:00
4. Submit a pull request
2022-09-22 15:34:39 +02:00
## Disclaimer
2023-06-11 18:02:52 +02:00
This project is neither affiliated with Obsidian. This is a community maintained plugin.