You are currently viewing Order Azure Wiki Pages Using .Order File

Order Azure Wiki Pages Using .Order File

In this article, we will take a look at the use of .order files to order azure wiki pages. At the end of this article, you should be comfortable in creating a .order file through Azure devops web UI and git repository.

REFERENCE LINK – Official Documentation 

Introduction

Azure devops wiki is a collaborative content management system where you can create project-related documents in the markdown format. It offers two solutions to create documents.

  • Project Wiki
  • Publish Code As Wiki

PROJECT WIKI – The project wiki allows you to create pages in a hierarchical structure. You will get access to a built-in markdown editor where you can create and publish the content directly from the web UI. Alternatively, you can also clone the project wiki git repository and make changes offline. Take a look at the below article where a detailed explanation of the project wiki is provided.

REFERENCE LINK: Project wiki link

PUBLISH CODE AS WIKI – The publish code as wiki allows you to publish the documents through the git repository. You can link one or more folders from multiple git repositories. Take a look at the below article where a detailed explanation of the publish code as wiki is provided.

REFERENCE LINK: Publish code a wiki

What Is .order File in Azure Devops Wiki?

By default, the wiki pages are displayed in the alphabetical sequence. The .order file will help you to display the wiki pages in the sequence you need. All you have to do is add the file name without the .md extension to the .order file.

Order Azure Wiki Pages

In the Azure devops project wiki, you can either use the drag-and-drop approach to move the pages or clone the project wiki repo and add the .order file. In the below image you can see my project structure and all the files are arranged in ascending order.

Azure project wiki page ordering
Azure Devops Project Wiki – Page Ordering

As foretold, you can drag and move the page. Automatically the .order file will be created for the drag-and-drop operation.

  • Drag and move any file in your wiki.
  • Now clone the wiki and you will see a .order file created and it will match the order in your wiki.
Azure Wiki - UI vs Repo Comparison
Azure Wiki – UI vs Repo Comparison

NOTE:

  • The .order file will not be visible in the web UI.
  • The .order file will only arrange the pages in the current directory. If you have multiple nested directores then you need to create .order file under all nested directories.

If you are working with the wiki offline, then you can create the .order file manually and add the file names without the .md extension. Commit and push the changes.

Azure Devops Publish Code As Wiki Order Pages

The publish code as wiki is based on the files in Azure repos. It also supports drag-and-drop features similar to Project Wiki. You can create the .order file directly in your repo by using any of the following methods.

  • Drag and drop the page which will create a commit in the Azure repo.
  • Directly through web UI. From the azure repos, click on the ellipsis next to the folder and click “New -> File”.
  • Clone the repo to your local machine. Create the .order file, commit and, push the change to Azure repo.

The below image shows my Azure repo and the corresponding wiki.

Project wiki vs provisioned wiki

STEP 1 – Clone the repo.

$ git clone <repo-url>

STEP 2 – Create the .order file and add the file order. In my case, I am just adding the project-requirement.md file to be displayed as the first file.

# .order file
project-requirement

STEP 3 – Commit and push the changes. In my case, I am directly pushing the change to the main branch but in real time you may have to create a pull request to merge it with the main branch.

$ git add .
$ git commit -m ".orders file modified"
$ git push -u origin main

Now the wiki page order will be modified.

Revert Changes

If you wish to revert the ordering you can either drag and drop the page again or clone the repo and delete the associate line. Delete the .order file to revert everything and organize the pages alphabetically.

Wrap Up

In this short article, we have seen what is the .order file and how to use it to order publish cod as wiki and project wiki pages.

Leave a Reply

five − 5 =