Skip to content

Latest commit

 

History

History
96 lines (63 loc) · 2.68 KB

File metadata and controls

96 lines (63 loc) · 2.68 KB

PSBlogger

A PowerShell library for publishing markdown files authored in markdown to Blogger. This library exists because OpenLiveWriter isn't being actively maintained and Typora and Obsidian are awesome. The intention is that you would author your blog posts in markdown and then drop to a command-prompt to publish them to Blogger.

Note:

Currently in development. Currently tested on Windows

Getting Started

  1. Install necessary dependencies:

    choco install pandoc
    

    (Future: still need to publish to PowerShell nuget library)

    Install-Module PSBlogger
    
  2. Authenticate with your Blogger account:

    Initialize-Blogger
    

    This will launch a browser and authenticate with Google.

    Notes:

    • You may need to perform this command with an elevated command-prompt (Administrator) as this activity opens a temporary port listener for oauth callbacks.

    • You may be prompted that Google hasn't verified the app yet. Working on it. Click Continue for now.

  3. List your blogs

    Get-BloggerBlogs
    
  4. Set a default blog

    Set-BloggerConfig -Name BlogId <blogid>
    
  5. List your posts for that blog

    Get-BloggerPosts
    
  6. Publish a markdown file to your blog as draft

    Publish-MarkdownBloggerPost -File .\filename.md -Draft
    

    This will post a draft to your blog and update the markdown file with the blogger postid and mark it as wip.

  7. Publish a markdown file to your blog

    Publish-MarkdownBloggerPost -File .\filename.md
    

Image Support

PSBlogger supports Google Drive for hosting your images and handles both standard markdown and Obsidian image formats.

Supported Image Formats

PSBlogger can detect and process images in both formats:

  • Standard Markdown: ![alt text](image.png "optional title")
  • Obsidian Format: ![[image.png|alt text]]

When publishing, all images are converted to standard markdown format with Google Drive URLs, ensuring compatibility across platforms.

Google Drive Integration

  • Add-GoogleDriveFile: Uploads a file to your Google Drive
  • Add-GoogleDriveFolder: Creates a folder in your Google Drive
  • Get-GoogleDriveItems: Query the contents of your Google Drive
  • Set-GoogleDriveFilePermission: Modifes the permission of a file.

Markdown Image Management

  • Find-MarkdownImages: scans the markdown file to locate images in both standard and Obsidian formats
  • Update-MarkdownImages: updates the content in the markdown file with updated urls, converting all formats to standard markdown

Future

  • Download existing posts to your machine in markdown