It will help you to manage locally saved markdown to upload to Tistory
Project description
Local First Tistory
Do not be afraid of shutting down blog server.
It will help you organize the posts in local-first, server-last
rules.
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 Contents
Installation
-
Python >= 3.9
-
To install package:
pip install tistory-helper
Quick Start
You can use tistory-helper
using $ tistory [command]
.
To start off, you run:
tistory init
It will handle 3 things:
Authorization
You will see prompts and please follow the instructions.
To get App ID
and Secret Key
:
-
Go to
https://www.tistory.com/guide/api/manage/register
-
Fill out your form.
Please be aware of
CallBack
column to{blog_name}.tistory.com
, nothttp://{blog_name}.tistory.com
,https://~
norhttps://www.~
. -
Now you get
App ID
andSecret Key
. You can checkCallBack
column and if it doesn't follow the{blog_name}.tistory.com
, you can modify it here. -
Enter
App ID
andSecret key
while 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 Directory
It will be done automatically. You can check the default directory:
tree -a ~/.tistory
$HOME/.tistory
├── .categories.toml
├── .env
├── .metadata.toml
├── images
└── markdowns
Category Directory
It will create directories according to your categories from blog automatically.
tree -a ~/.tistory/markdowns
$HOME/.tistory/markdowns
├── category1
├── category2
│ ├── category3
│ └── category4
└── category5
Help
$ tistory
or $ tistory --help
.
Markdown
Markdown Location
You put all your markdown in $HOME/.tistory/markdowns/{your_category}
.
Upload Markdowns
tistory md
It will detect all the modified or create file and upload it.
Write Markdown
Put the meta data on very top of the markdown
file 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 here
visibility
(default:private
):public
:public
or3
or공개
protected
:protected
or1
or보호
private
:private
or0
or비공개
acceptComment
(default:yes
):- To accept:
yes
ory
ortrue
ort
or허용
or1
- To deny:
no
orn
orfalse
orf
or거부
or0
- To accept:
You 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 to official API.
Image
Image Location
Put your images you want to upload in $HOME/.tistory/images/
.
Upload Images
-
Make sure images extension end with
.png
,.jpg
,.jpeg
or.gif
. -
Run:
tistory img
-
Uploaded image url will be stored at
$HOME/.tistory/.images.toml
and you can useurl
when writing markdown. -
Recommend to upload images first before writing your markdowns since you need
url
in![images](url)
.
Miscellaneous
Category
If you updated category from your blog and to upgrade it:
tistory category
Reauthorization
If something went wrong while tistory init
, you can do authorization step independently:
tistory auth
Or you can modify the field at $HOME/.tistory/.env
manually.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for local-first-tistory-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4306b66916d446f475bc1d63bb9b26578d5c4266b5ecd98d531f6d353289d252 |
|
MD5 | c2dcc33628a7237c26f88c045140d0a6 |
|
BLAKE2b-256 | 650beede6ce4efa62a41087ef86c6fc5f9f7634cea41cb5a5e40516e06783562 |
Hashes for local_first_tistory-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c55c59848cc74142e59434f8f77c144d8556d1f633a9b7dfce246598d1c9d961 |
|
MD5 | 57aa814e044dc54232505a918b98999f |
|
BLAKE2b-256 | a8343bb37cc07c1efeaee5f48d2b515834f185faf602666d4aa7433728736103 |