Skip to main content

A command-line tool to manage Hugo blog posts.

Project description

Blog Uploader

blog-uploader is a command-line tool to help you manage your Hugo blog posts. It allows you to create new posts from local markdown files, remove existing posts, and list all current posts.

Features

  • Create New Posts: Quickly create a new Hugo post from a markdown file.
  • Remove Posts: Safely delete a post by its folder name.
  • List Posts: View a list of all your current blog posts.
  • Git Integration: Automatically clones your blog's repository, and commits and pushes changes.
  • Cross-Platform: Works on Windows, macOS, and Linux.

Requirements

  • Hugo: This tool depends on Hugo. Before using blog-uploader, please ensure that Hugo is installed and accessible in your system's PATH. The tool will automatically check for Hugo's presence and guide you if it's missing.

Installation

You can install blog-uploader via pip:

pip install .

(After navigating into the blog-uploader directory)

Or, once it's published on PyPI:

pip install blog-uploader

Usage

The tool provides three main commands: new, remove, and list.

1. Create a New Post

To create a new post, use the new command and provide the path to your markdown file.

blog-uploader new /path/to/your/post.md

The tool will:

  1. Clone or pull the latest version of your blog repository.
  2. Create a new post in Hugo.
  3. Append the content of your file to the new post's index.md.
  4. Prompt you to edit the file to set the title and other metadata.
  5. After you confirm, it will rename the post's folder based on the title.
  6. Build the site with Hugo, and commit and push the changes to your repository.

2. Remove a Post

To remove a post, use the remove command with the post's folder name.

blog-uploader remove "name-of-the-post-folder"

You will be asked for confirmation before the post is deleted.

3. List All Posts

To see a list of all your posts, use the list command.

blog-uploader list

This will display the folder names of all posts in your content/post directory.

Configuration

Currently, the tool is configured with a hardcoded Git repository URL. In future versions, this will be customizable through a configuration file.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

blog_uploader-0.1.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

blog_uploader-0.1.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file blog_uploader-0.1.0.tar.gz.

File metadata

  • Download URL: blog_uploader-0.1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for blog_uploader-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9bee59e1c6100daefc9c94fad01ff4eac42535168a5a0ddd059493e68820c274
MD5 8818a263274f7fc9a9444fa40475f4ab
BLAKE2b-256 a7bb9c71edd23dfd18d91bdd47b6d7cb123b4304d1a8301f9c73520e060b4cf3

See more details on using hashes here.

File details

Details for the file blog_uploader-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: blog_uploader-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.4

File hashes

Hashes for blog_uploader-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5443bd66c330e959bf6e36448f0eb9ceafe762ce64223b84e14eff0847c26c4e
MD5 16f0a964360ca49c73230b839a9b356c
BLAKE2b-256 c521d8837cb9ae6c863aa4ec02a44009b5b4353e48aef7991007f6079ed39724

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page