[CNBlogs]使用Typora和MetaWeblog改善博客园书写体验

目的

  1. 本地使用Typora(所见即所得)编写Markdown
  2. 通过命令行工具自动上传图片到博客园

必要条件

  • 开启博客园rpc支持

    image-20210310221323249

项目地址

https://github.com/stulzq/dotnet-cnblogs-tool

fork更新:https://github.com/minskiter/dotnet-cnblogs-tool

更新改动为:图片上传单文件修改为多文件多线程上传

使用步骤:

下载Dotnet Core SDK

https://dotnet.microsoft.com/download

使用fork项目进行进行手动编译为单应用:

dotnet publish -c Release -r win-x64 -p:PublishReadyToRun=true -p:PublishSingleFile=true -p:PublishTrimmed=true --self-contained true -p:IncludeNativeLibrariesForSelfExtract=true

其中-r后对应不同的平台运行时,参考微软官方文档

https://docs.microsoft.com/zh-cn/dotnet/core/rid-catalog

编译后得到二进制文件:

image-20210310221809679

将这个目录加入系统环境变量,随后更改Typora的更新图片命令:

image-20210310221846836

运行Test Uploader后判断上传是否成功:

image-20210310221932379

修改插入图片时触发自动上传图片

image-20210310222035895

References:

dotnet 打包单个文件 https://stackoverflow.com/questions/65170327/net-5-publish-single-file-produces-exe-and-dlls

dotnet core 命令行工具 https://natemcmaster.github.io/CommandLineUtils/docs/arguments.html?tabs=using-attributes

原文地址:https://www.cnblogs.com/minskiter/p/14514660.html