Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elchead/blog-cli
used to draft posts inside obsidian and publish conveniently to my Github blog
https://github.com/elchead/blog-cli
Last synced: 3 months ago
JSON representation
used to draft posts inside obsidian and publish conveniently to my Github blog
- Host: GitHub
- URL: https://github.com/elchead/blog-cli
- Owner: elchead
- License: mit
- Archived: true
- Created: 2021-11-04T15:23:33.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-08-19T16:31:40.000Z (about 2 years ago)
- Last Synced: 2024-03-24T02:45:47.351Z (8 months ago)
- Language: Go
- Homepage:
- Size: 2.25 MB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Blog-CLI ✍️
The utility is built for my blog workflow using Github pages with Hugo. It avoids a few repetitive steps I had to do before.
I like to use Obsidian for writing and the CLI allows me to publish my blog posts from Obisidian.It should be easy to adjust the workflow, so feel free to reuse :)
## Features
`blog post `:
- create new blog post skeleton (including metadata) in my writing app and (symbolically) links it to the corresponding `post` directory in my Github repo.
- after file creation, it opens the file in Obsidian`--book | -B`: create book note from template file
---
`blog draft `:
- same as `post` without linkage in repo
`--book | -B`: create book note from template file
---
`blog preview-post `:
- use existing Obsidian article to create linkage in repo. Then locally render blog (`hugo serve`) and open preview in Browser. Finally, it asks if you want to publish the post.
`--book | -B`: create book note from template file
---
`blog preview`:
- render the blog (`hugo serve`) and open in Browser
---
### Still missing
Note: the file structure for linking the markdown file in the repo, is currently hardcoded to my blog structure: `content/posts/`, you can change this inside the `constructRepoPostFilePath()` in `blog/blog.go`.
- media (images) for posts still need to be manually added to the repo
- modify Metadata inside book template
- separate config file for setting paths## Build
The current git implementation asssumes that `git` is installed and available in `PATH`. For the rendering, it assumes that `hugo` is installed and available in `PATH`.
1. Modify the config paths inside `cmd/cmd.go`.
2. Change into the repo directory, then:
`go build -o ./bin/blog ./cmd/cmd.go`
3. (Optional): create link in PATH (Mac):
`` ln -s `pwd`/bin/blog /usr/local/bin/blog ``