Skip to main content

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 local-first-tistory
    

Quick Start

You can use local-first-tistory 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:

  1. Go to https://www.tistory.com/guide/api/manage/register

  2. Fill out your form.

    Please be aware of CallBack column to {blog_name}.tistory.com, not http://{blog_name}.tistory.com, https://~ nor https://www.~.

    retrieve_app_id_and_secret_key

  3. Now you get App ID and Secret Key. You can check CallBack column and if it doesn't follow the {blog_name}.tistory.com, you can modify it here. result_app_id_and_secret_key

  4. Enter App ID and Secret key while following the prompts.

  5. 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 or 3 or 공개
    • protected: protected or 1 or 보호
    • private: private or 0 or 비공개
  • acceptComment (default: yes):
    • To accept: yes or y or true or t or 허용 or 1
    • To deny: no or n or false or f or 거부 or 0

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 use url 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.

Release files for local-first-tistory 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for local-first-tistory 0.0.2
File Size Uploaded
local-first-tistory-0.0.2.tar.gz 8.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for local-first-tistory 0.0.2
File Interpreter ABI Platform
local_first_tistory-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 19.1 kB

Release files / local-first-tistory-0.0.2.tar.gz

Download URL local-first-tistory-0.0.2.tar.gz
Size 8.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b0f81fa4e879306135de2edfe949f7e8b245d891b5a4c89bf7b53d50cbbb3106
BLAKE2b-256 checksum
How to use checksums
0034f49121a6ce3383e7f8872d2e62f8785296393bcd17e1ff641c8bad90912c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release files / local_first_tistory-0.0.2-py3-none-any.whl

Download URL local_first_tistory-0.0.2-py3-none-any.whl
Size 10.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
56497db81b33bdfb615acf9155814ac713fc322e85f3a63ec6ff8d4b9b2820d3
BLAKE2b-256 checksum
How to use checksums
295e46258b2bda3e6b67f583b22edf5d89aace57989c2c29cb62db1e26c7458d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.3

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page