3

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?

tkahn
  • 1,407
  • 2
  • 21
  • 37
  • A small point of clarification re: "wiki consists of markdonwn files only + a file called order" PLUS the root level ".attachments" folder where the files attached to any wiki page(s) reside. – ScottWelker Nov 07 '19 at 23:55
  • Please consider tagging this `azure-devops-wiki`. I would have done it but there is a five tag limit and I did not want to remove any of your tags. – ScottWelker Feb 28 '22 at 17:19

1 Answers1

1

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.

EliteRaceElephant
  • 7,744
  • 4
  • 47
  • 62
  • 3
    We solved it by changing the wiki from being a code wiki to a regular wiki in Azure DevOps. The reason for this whole question in the first place was to make the wiki accessible to all employees - not just the developers. If you have a code wiki you need a developer account in DevOps. But if you use a regular wiki people with free accounts can access and edit it. A regular wiki is still git based and you can check it out and edit as usual. Best of both worlds. – tkahn Nov 11 '19 at 06:28
  • 2
    @tkahn Thanks for sharing your solution . Could you convert it into an answer ,this could benefit other community members with the same issue and we could archive this thread, thanks. – Hugh Lin Nov 13 '19 at 07:00