Publish an Azure DevOps Wiki as a stand-alone static site

2.6k Views Asked by At

I have set up a wiki in Azure DevOps and I want to set up a pipeline that takes the markdown files, transform them into HTML and publish them as a stand-alone static web site. When someone commits changes in the markdown files I want to build new static files to the site using a pipeline in Azure DevOps.

Gatsby is a platform that I'm somewhat familiar with, but the wiki consists of markdown files only + a file called "order" that determines the order of the documents in the wiki.

Does anyone have an idea as to how I should set this up?

1

There are 1 best solutions below

2
On

You need this setup:

  1. Expose your markdown files by an API. Azure should have some kind of serverless lambda function service. The query result should be an array or list of the files you need in the order you need them. It's best to let your Azure based API deal with the order file. Gatsby should only be concerned with building your site in the right order as supplied by your API.
  2. Call your markdon API during the Gatsby build process. See the docs for how to fetch data at build time.
  3. Create a template page for all your wiki pages. See the Gatsby tutorial part 7.
  4. You need to create the wiki pages using the Gatsby node API. Use the createPages function.

PS: I'm interested in your decision what serverless lambda function service you would use because I am running into a similar use case. Feel free to comment how you solved the 1. of your setup.