Markdown Monster
Publishing HTML to GitHub
Gravatar is a globally recognized avatar based on your email address. Publishing HTML to GitHub
  Brad Patton
  All
  Nov 17, 2020 @ 03:48pm

With the creation of Azure Static Web Apps I wonder if it would be possible to publish from Markdown Monster to GitHub. From there a GitHub action is triggered which then publishes the content to Azure (see: https://docs.microsoft.com/en-us/azure/static-web-apps/overview). I suppose one could just save the file to a local GitHub branch and then use normal methods to push up the changes but wondering if it could be automated.

Gravatar is a globally recognized avatar based on your email address. re: Publishing HTML to GitHub
  Rick Strahl
  Brad Patton
  Nov 17, 2020 @ 05:27pm

Not quite sure what you mean. Can't you use the built-in Git features in MM to link the repository and simply commit and push? That will get you to GitHub and from there you can set up your publish automation.

That's what I do with a bunch of content - edit in MM. When done commit and push and then applications pull the data as needed from Github. In your case you'd need a trigger to publish to Azure (probably force a tag or publish to a specific branch).

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Publishing HTML to GitHub
  Brad Patton
  Rick Strahl
  Nov 17, 2020 @ 07:00pm

Just started using MM and hadn't seen the Git feature. That looks cool and I will check that out more.

From the overview: "When you create an Azure Static Web Apps resource, Azure sets up a GitHub Actions workflow in the app's source code repository that monitors a branch of your choice. Every time you push commits or accept pull requests into the watched branch, the GitHub Action automatically builds and deploys your app and its API to Azure."

So I think the trigger is built into the process.

I guess the open question is when I commit to Git am I saving a Markdown file or Html? Sounds like the Azure Static site would need it to be Html.

Gravatar is a globally recognized avatar based on your email address. re: Publishing HTML to GitHub
  Rick Strahl
  Brad Patton
  Nov 18, 2020 @ 10:29am

MM only saves what you write. You can export content to HTML but it's not as simple as that. You need to have a Web site with styling that provides what MM basically provides via its templates.

You can use the MM templates but that has to be set up in some sort of template and output and that will not be automatic.

The way I usually do this is, I have a Web site (ie. not a static site) that runs a Markdown rendering tool of some sort. For generic and simple cases I use my [LiveReloadServer] (https://github.com/RickStrahl/LiveReloadServer) or if more is needed just create a basic .NET Core based Web site to host using components that provide that same functionality.

The other alternative is to use generator tools like Statiq , [Jekyll] (https://jekyllrb.com/) etc. to turn your Markdown into static sites that you can publish. These things work by running a command to rebuild the site which can then be published (or pushed to Git and published that way).

MM does not provide these services internally although they can be integrated if one wants to do the work (via an Addin or Scripting).

© 1996-2024