{"id":19286815,"url":"https://github.com/cuyu/blogging","last_synced_at":"2025-04-22T03:33:47.096Z","repository":{"id":57434558,"uuid":"99064270","full_name":"cuyu/blogging","owner":"cuyu","description":"🖊A smart cmdline tool to help you managing Github blogs","archived":false,"fork":false,"pushed_at":"2024-09-30T08:52:41.000Z","size":2406,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-31T13:52:16.795Z","etag":null,"topics":["blogging","cmdline","github-page","github-pages"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cuyu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-02T02:40:56.000Z","updated_at":"2024-09-30T08:51:05.000Z","dependencies_parsed_at":"2022-08-27T23:11:23.305Z","dependency_job_id":null,"html_url":"https://github.com/cuyu/blogging","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuyu%2Fblogging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuyu%2Fblogging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuyu%2Fblogging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cuyu%2Fblogging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cuyu","download_url":"https://codeload.github.com/cuyu/blogging/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223888471,"owners_count":17220082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blogging","cmdline","github-page","github-pages"],"created_at":"2024-11-09T22:04:26.777Z","updated_at":"2024-11-09T22:04:27.298Z","avatar_url":"https://github.com/cuyu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 🖊blogging\n\n\u003e A smart tool to help you to manage blogs\n\n![screencast](/screencast.gif)\n\nThis cmdline tool was initially created to help managing [my own blog](http://cuyu.github.io), and it really saves my time. So I'd like to abstract the tool (suit for more scenario) here to benefit you!\n***Note**: the tool is only tested on macOS, but it should work on Linux as well.*\n\n### Installation \u0026 Setup\n\n```bash\npip3 install github-blogging\n```\n\nEnable the auto-complete feature:\n\n```bash\necho 'eval \"$(register-python-argcomplete blogging)\"' \u003e\u003e ~/.zshrc\n```\n\n#### Initial setup\n\nFor the first time you use the tool, you **must** do some settings (e.g. set the blog project root path). To get settings done, just type:\n\n```\nblogging\n```\n\n*Or you can manually create and edit the `~/.blogging` file.*\n\n\n### How this tool can help you\n\n#### Create a new blog\n\nAssume you just get a good idea and want to write it down to the disk. So you will create a file and name it, and write some metadata like categories and tags at first.\n\nWith this tool, you just need to type one command, and it will do all the things above (it even opens the file automatically for you):\n\n```sh\nblogging new {title} {category} {tag1} {tag2}\n```\n\n#### Save drafts to cloud\n\nThe writing work is almost done, but you have something more urgent to handle. You feel not very safe to only save the file on the disk. So here, a single command will save all the drafts to the cloud (GitHub):\n\n```sh\nblogging save\n```\n\n#### Continue the writes\n\nThe urgent work is done, and you'd like to continue the writes just saved.\n\nThis tool gives you the convenience (just press `tab`, and pick from all the drafts) to open the draft:\n\n```sh\nblogging continue {file_name}\n```\n\n#### Publish the blog\n\nThe writes is done. You'd like to publish the blog to the web. To achieve this, you may need to move the file from the drafts folder to the publish folder and push the changes to the server side.\n\nWith `blogging`:\n\n```sh\nblogging publish {file_name}\n```\n\n#### Edit the published blog\n\nThe blog is published, and you'd like to edit the published blog again. However, you cannot remember the exact title of the blog. \n\nWith `blogging`, you can open the published blog conveniently with `--filter` option. This option will search the title/category/tags of all published  blogs, and pop up (need to press `space` and  `tab`  after the keyword) candidate blogs in the terminal.\n\n```sh\nblogging edit --filter {keyword} {file_name}\n```\n\nThe `--filter` is optional and is case-insensitive (i.e. 'Abc' works the same as 'abc').\n\n#### Insert images\n\nSometimes, you may need to insert images into the blog. This tool can help you to insert images into the markdown file with correct url path and also move the images to the blog git repo (which can be uploaded to GitHub later when publishing).\n\n```sh\nblogging image {image_local_path} {file_name}\n```\n\nThis command will generate the markdown image tag and add to your clipboard. You can paste it to the markdown file directly.\n\n***Super easy, right?***\n\nAll you need to do is open your terminal and execute:\n\n```sh\npip install github-blogging\n```\n\n**To enable the auto-complete (press `tab`) feature, you need to open a new shell session after installation.*\n\n### File structures\n\nThis tool assume you have the following file structures for the blog project:\n\n```\nYOUR_PROJECT_PATH\n├── _drafts\n│   ├── first_draft.md\n│   ├── second_draft.md\n│   └── third_draft.md\n├── _posts\n│   ├── first_blog.md\n│   ├── second_blog.md\n│   └── third_blog.md\n├── _images\n│   ├── screenshot1.png\n│   └── screenshot2.png\n├── index.html\n└── ...\n```\n\nAll markdown files under `_posts` folder will be compiled into html files and hosted on your site. \n\n**The folder names above (e.g. `_posts`) can be configured when you use the tool for the first time*\n\n### Compatibility\n\nThe supportability of auto complete feature is depend on [argcomplete](https://github.com/kislyuk/argcomplete).\n\n### Known issue\n\n- ~~Auto complete feature is not work when inputs contain unicode. (See this [issue](https://github.com/kislyuk/argcomplete/issues/228) for details)~~ (Fixed with a monkey patch)\n\n- For zsh, it shows `command not found: complete`. To fix this, pls add following lines to your `~/.zshrc` file and source it:\n\n  ```\n  autoload bashcompinit\n  bashcompinit\n  ```\n\n\n\n### TODO\n\n- ~~Support more shell types~~\n- ~~More flexible blog project structure (e.g. can customise the draft/publish folder name)~~\n- ~~An option to open and edit published blogs, also support add `-filter` option to filter by word, category, tags, etc.~~\n- ~~Add a gif screenshot to show this tool~~\n- Cache the blogs' meta info to improve performance (For now, I have near 80 blogs, performance is not the bottleneck)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuyu%2Fblogging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcuyu%2Fblogging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcuyu%2Fblogging/lists"}