Package: local-first-tistory
Local First TistoryDo not be afraid of shutting down blog server.
It will help you organize the posts inlocal-first, server-lastrules.Why Use This?If you've ever been in trouble when the blog server were shut down,
(especially the one is big-tech and never expecting abnormal!) this script just
for you.You will hold all the data in the local and the script will manage all the things
to communicate with the server. You can read the data when you
(or the server 😂) are offline or migrate to the other platforms.Table of ContentsInstallationQuick StartMarkdownImageMiscellaneousInstallationPython >= 3.9To install package:pipinstalllocal-first-tistoryQuick StartYou can uselocal-first-tistoryusing$ tistory [command].To start off, you run:tistoryinitIt will handle 3 things:AuthorizationCreate Default DirectoryCreate Category DirectoryAuthorizationYou will see prompts and please follow the instructions.To getApp IDandSecret Key:Go tohttps://www.tistory.com/guide/api/manage/registerFill out your form.Please be aware ofCallBackcolumn to{blog_name}.tistory.com,
nothttp://{blog_name}.tistory.com,https://~norhttps://www.~.Now you getApp IDandSecret Key. You can checkCallBackcolumn
and if it doesn't follow the{blog_name}.tistory.com, you can modify it here.EnterApp IDandSecret keywhile following the prompts.All the data you input will be stored at$HOME/.tistory/.env.
If anything went wrong, you can modify the data manually.Default DirectoryIt will be done automatically. You can check the default directory:tree-a~/.tistory$HOME/.tistory
├──.categories.toml
├──.env
├──.metadata.toml
├──images
└──markdownsCategory DirectoryIt will create directories according to your categories from blog automatically.tree-a~/.tistory/markdowns$HOME/.tistory/markdowns
├──category1
├──category2
│├──category3
│└──category4
└──category5Help$ tistoryor$ tistory --help.MarkdownMarkdown LocationYou put all your markdown in$HOME/.tistory/markdowns/{your_category}.Upload MarkdownstistorymdIt will detect all the modified or create file and upload it.Write MarkdownPut the meta data on very top of themarkdownfile like:---
title or t or 제목: your_title [Mandatory]
visibility or vis or v or 공개: [Optional]
published: TIMESTAMP (default: current_time) [Optional]
tag or tags or 태그: tag1,tag2,tag3 (default: '') [Optional]acceptComment or ac or comment or 댓글: [Optional]---Your Content starts from herevisibility(default:private):public:publicor3or공개protected:protectedor1or보호private:privateor0or비공개acceptComment(default:yes):To accept:yesoryortrueortor허용or1To deny:noornorfalseorfor거부or0You will notice that only title is mandatory and not the others. This is the example:# markdowns/category/example.md---
t: This is my first article!
v: public
ac: 허용tag: my article,first issue---And here it is article content!For more information, go toofficial API.ImageImage LocationPut your images you want to upload in$HOME/.tistory/images/.Upload ImagesMake sure images extension end with.png,.jpg,.jpegor.gif.Run:tistoryimgUploaded image url will be stored at$HOME/.tistory/.images.tomland you can useurlwhen writing markdown.Recommend to upload images first before writing your markdowns
since you needurlin![images](url).MiscellaneousCategoryIf you updated category from your blog and to upgrade it:tistorycategoryReauthorizationIf something went wrong whiletistory init, you can do authorization step independently:tistoryauthOr you can modify the field at$HOME/.tistory/.envmanually.