A VS Code extension for managing your Pelican blog posts, making it easier to write, publish, and manage your blog content with some useful workflow features.
Warning
The extension is in a very early stage. I'm working on it for my own needs and currently it's tied to my blog structure. The templates are for example specific for my usage, at the moment.
- ✅ Draft Management: Toggle draft status of your posts
- ✅ Post Templates: Create new posts from pre-built templates (Articles, Notes, Books Reviews)
- ✅ Preview Integration: Start/stop Pelican development server and open preview in browser (with auto-reload)
- ✅ Snippet Insertion: Quick insertion of common Markdown elements
- One-click Publish: Quickly publish your blog posts with Git integration and GitHub Actions
- Build Status Monitoring: Check GitHub Actions build status directly from VS Code
- Clone this repository
- Open in VS Code
- Run
npm install
to install dependencies - Press
F5
to compile and run the extension in a new Extension Development Host window
Before using the extension, configure the following settings in VS Code:
- Open Settings (Ctrl+,)
- Search for "Pelican Blog"
- Configure:
- GitHub Token: Personal access token for GitHub API
- GitHub Owner: Repository owner username
- GitHub Repo: Repository name
- Workflow ID: GitHub Actions workflow ID
- Commit Message Template: Template for commit messages (use {title} for post title)
Pelican Blog: Publish Post
- Publish the current post with Git and GitHub ActionsPelican Blog: Toggle Draft Status
- Toggle between draft and published status
Pelican Blog: Create New Post
- Create a new post from templates (see Custom Templates below)Pelican Blog: Start Preview Server
- Start Pelican development serverPelican Blog: Stop Preview Server
- Stop the development serverPelican Blog: Open Preview
- Open blog preview in browserPelican Blog: Restart Preview Server
- Restart the development serverPelican Blog: Check Build Status
- Check GitHub Actions build statusPelican Blog: Insert Snippet
- Insert common Markdown snippets
You can define your own post templates by adding Markdown files to a folder named templates
at the root of your blog workspace (next to package.json
).
-
Each
.md
file in thetemplates
folder becomes a selectable template in the "Create New Post" command. -
The template name shown in the picker is based on the filename (without extension), with dashes (
-
) shown as spaces. -
Optionally, you can add a description to the top of your template file using an HTML comment:
<!-- desc: My custom template description --> Title: {title} Date: {date} Status: draft Category: Custom Summary: # {title} ...
-
You can use placeholders like
{title}
,{date}
,{slug}
,{description}
in your template content. These will be replaced when creating a new post. -
User templates override built-in templates if they have the same name.
Example:
If you add a file my-note-template.md
to the templates
folder, it will appear as "My note template" in the template picker.
Right-click on any Markdown file to access Pelican Blog commands from the context menu.
The status bar shows the current post status (Draft/Published) and can be clicked to toggle status.
- Install dependencies:
npm install
- Compile TypeScript:
npm run compile
- Run tests:
npm test
- Start development:
npm run watch
- VS Code 1.74.0
- Node.js (for development)
- TypeScript (for development)
MIT