Package: wordpress-markdown-blog-loader
wordpress-markdown-blog-loaderThis utility loads markdown blogs into Wordpress as a post. It allows you to work on your blog
in your favorite editor and keeps all your blogs in git.featuresconverts markdown into plain html, with syntax hightlighting supportuploads and synchronizes any locally referenced imagesgenerates an opengraph image including the title, subtitle and author in Binx.io or xebia.com stylesets the Yoast focus keywordssets the canonical url, if specifiedcaveatschanging the slug may orphan imagesremoving images from the markdown, will leave dangling images in Wordpressyou cannot edit via WP and via the uploader, without confusing yourselfrequired Wordpress PluginsYoast SEOREST API Meta SupportFurthermore, you have to enable the Rest API for theCustom Field Groupfor the fieldshow_header_image.InstallationInstall it withpipxor use Docker (see below):pipxinstallwordpress-markdown-blog-loaderconfigurationto configure the access credentials, you need to add your WordPress application password to the file~/.wordpress.iniand add a section for your Wordpress installation:[DEFAULT]
host = xebia.com

[xebia.com]
username = <your wordpress username>
password = <your application password>Note that the application password is different from the password you use to login to your WordPress installation.If the site is served through a CDN, you can also set theapi_hostwhich will be used as the hostname to invoke the WP REST API.Never touch the WP editor againOnce you start to manage your blogs via this uploader,do not editthe blog via one of the WP editors. The editors are weird,
because it appears to make a copy of the content on which you get a WYSIWIG viewer. Unfortunately, it does not detect changes
in the actual blog content. It will look like your uploaded changes are not applied (but they are).Using the docker imageTo use the docker image as a command line utility, create the following alias:aliaswp-md='dockerrun-v$HOME:$HOME-v$HOME/.wordpress.ini:/root/.wordpress.ini-v$PWD:/$PWD-w$PWDghcr.io/binxio/wordpress-markdown-blog-loader:1.2.0start a new blogTo start a new blog, type:$wp-mdpostsnew\--title"How to create a WordPress blog without touching WordPress"\--subtitle"using the wp-md utility"\--author"Mark van Holsteijn"\--image~/Downloads/background-image.jpg\--image-credits"image by xyz"INFO:resizing1920x1920to1200x1200
INFO:croppingtomaximumheightof630px
INFO:starteditingindex.mdin./how-to-create-a-wordpress-blog-without-touching-wordpressA skaffold frontmatter blog is created, and you can start writing in the index.md.frontmatter propertiesYou can set the following properties in the frontmatter:Namedescriptiontitleof the blogsubtitleof the blog, used in the og.imagefocus-keywordsthe SEO focus keywordsexcerptexcerpt of the blogauthordisplay name of the author in Wordpresscategorieslist of wordpress categories for this blogslugslug of the blogdateon which the blog should be published ISO timestamp formatstatusdraft or publish. if publish, the blog will be published on thedatecanonicalurl of the blog, to be used in cross postsimagethe banner image of the blogog.imagethe open graph image of the blog, used in links from social mediaog.descriptionthe open graph description of the blog, used in links from social mediaguidthe physical URL of the blog. Written by wp-md on upload and downloadbrandxebia.com or xebia.com. defaults to xebia.comadding imagesTo add an image to your blog, add the images in the ./images subdirectory and add a relative reference in markdown. For instance:![](./images/architecture.png)uploading a blogTo upload a blog, type:$ wp-md posts upload --host xebia.com .
INFO: generating og:image based on images/banner.jpg
INFO: generating new image in how-to-create-a-wordpress-blog-without-touching-wordpress/images/og-banner.jpg
INFO: add logo
INFO: add title
INFO: add subtitle
INFO: add author
INFO: og image saved to how-to-create-a-wordpress-blog-without-touching-wordpress/images/og-banner.jpg
INFO: uploaded blog 'How to create a WordPress blog without touching WordPress' as post https://xebia.com/?p=9625
INFO: updating opengraph image to https://xebia.com/wp-content/uploads/2023/01/how-to-create-a-wordpress-blog-without-touching-wordpress-og-banner.jpg
INFO: post available at https://xebia.com/?p=9625
INFO: uploading image as how-to-create-a-wordpress-blog-without-touching-wordpress-og-banner.jpg
INFO: uploading image as how-to-create-a-wordpress-blog-without-touching-wordpress-banner.jpgupdating / publishing a blogYou can update the blog, by uploading it again.  If you change the status to 'publish' in the frontmatter metadata,
the blog will be published on the specified date.$ wp-md posts upload --host xebia.com .updating banner and open graph imagesYou can update the banner and open graph images as follows:$ wp-md posts update-banner . new-banner.jpgdownloading an existing blogto download an existing blog and convert it to markdown, type:$ wp-md posts download --host xebia.com --directory /tmp 9625
INFO: downloading https://xebia.com/wp-content/uploads/2023/01/how-to-create-a-wordpress-blog-without-touching-wordpress-banner.jpg as banner.jpg
INFO: downloading https://xebia.com/wp-content/uploads/2023/01/how-to-create-a-wordpress-blog-without-touching-wordpress-og-banner.jpg as og-banner.jpg
INFO: writing /tmp/2023/01/how-to-create-a-wordpress-blog-without-touching-wordpress/index.md