|
1 | 1 | --- |
2 | | -title: Wiki files, structure, and conventions |
| 2 | +title: Wiki Files, Folder Structure, Git Repo Conventions |
3 | 3 | titleSuffix: Azure DevOps |
4 | | -description: Learn about the file conventions of the Git repository and project wikis in Azure DevOps. |
| 4 | +description: Explore the file and folder structure for provisioned wikis or wikis published as code in Azure DevOps, including naming and location conventions for the Git repository. |
5 | 5 | ms.subservice: azure-devops-wiki |
6 | 6 | ms.custom: wiki, devdivchpfy22 |
7 | | -ms.topic: conceptual |
| 7 | +ms.topic: concept-article |
8 | 8 | ms.author: chcomley |
9 | 9 | ms.reviewer: gopinach |
10 | 10 | author: chcomley |
11 | | -monikerRange: "<=azure-devops" |
12 | | -ms.date: 01/05/2024 |
| 11 | +ms.date: 05/29/2025 |
| 12 | +#customer intent: As an Azure DevOps developer, I want to understand the wiki file and folder structure in the Git repository, so I can follow the naming and location conventions. |
13 | 13 | --- |
14 | 14 |
|
15 | | -# Wiki files and file structure |
| 15 | +# Wiki file and folder structure in Git |
16 | 16 |
|
17 | 17 | [!INCLUDE [version-lt-eq-azure-devops](../../includes/version-lt-eq-azure-devops.md)] |
18 | 18 |
|
19 | | -Learn about the files and file structure for project wikis and code wikis. The following guidance might specify code wikis, but it applies to both types of wiki. |
| 19 | +This article describes the files and folder structure for provisioned wikis and wikis published as code. For both types of wiki, the files are stored in a Git repository. Files can include Markdown pages, code, images, attachments, or other artifacts. To establish the presentation sequence of the files, Git adds a special file (_.order_) in each repo folder. |
20 | 20 |
|
21 | | -When you create a team project, a wiki isn't created by default. For more information, see [Create a wiki](wiki-create-repo.md), [Create a README](../../repos/git/create-a-readme.md), or [Provisioned wikis vs. published code as a wiki](provisioned-vs-published-wiki.md). |
| 21 | +When you create a project, a wiki isn't created by default. You can [provision a wiki](wiki-create-repo.md), [create a README](../../repos/git/create-a-readme.md), or [publish project code as a wiki](../../project/wiki/publish-repo-to-wiki.md). |
22 | 22 |
|
23 | | -Each code wiki is powered by a Git repository in the back-end. This repository stores the Markdown pages, images, attachments, and the sequence of pages and subpages. You create your wiki via the Azure DevOps user interface, and then you can edit the wiki via your [Git repository URL path](wiki-create-repo.md#how-can-i-go-to-the-git-repository). For more information about publishing code wikis, see [Publish a Git repository to a wiki](publish-repo-to-wiki.md). |
| 23 | +You create your wiki by using the Azure DevOps user interface. Then you can edit the wiki from your [Git repository URL path](wiki-create-repo.md#how-can-i-go-to-the-git-repository). |
24 | 24 |
|
25 | | -## Wiki file and folder structure |
| 25 | +## Repository files and folder structure |
26 | 26 |
|
27 | | -The team project wiki Git repositories are assigned the following labels. |
| 27 | +The Git repository for a wiki has two naming conventions: |
28 | 28 |
|
29 | | -- Wiki repo for a team project: `ProjectName.wiki` |
30 | | -- Main branch: `wikiMain` |
| 29 | +- The wiki repo name is `<ProjectName>.wiki` where `<ProjectName>` is the name of your project. |
| 30 | +- The name of the root branch for the wiki repo is `wikiMain`. |
31 | 31 |
|
32 | | -Manage your wiki repo in the same way you manage any other Git repo, by defining branch policies on the wikiMain branch. But, you can make changes to your local wikiMain branch and push them directly to the remote branch without defining any policies. |
| 32 | +You manage a wiki repo in the same way you manage other Git repos by defining branch policies on the `wikiMain` branch. You can also make changes to your local `wikiMain` branch and push them directly to the remote branch without defining any policies. |
33 | 33 |
|
34 | | -The wiki repository has the following files and folders: |
35 | | -- File for each Markdown page entered at the root level |
36 | | -- File labeled `.order` at the root and under each folder |
37 | | -- Folder for each page that has subpages |
38 | | -- `.attachments` folder, storing all the attachments of the wiki |
| 34 | +A wiki repo consists of the following files and folders: |
| 35 | + |
| 36 | +- A file for each Markdown page located at the root level |
| 37 | +- A file named _.order_ located at the root level and also within each subfolder |
| 38 | +- A subfolder for each wiki page that has subpages |
| 39 | +- A folder named _.attachments_ to store all attachments used in the wiki |
39 | 40 |
|
40 | 41 | ## File naming conventions |
41 | 42 |
|
42 | | -Each file requires using hyphens instead of spaces in the page title. For example, the *How to contribute* page title corresponds to the `How-to-contribute.md` file name. The page name gets added to the URL, ensuring that links you share remain intact as the wiki changes over time. |
| 43 | +The file name for each wiki page corresponds to the wiki page title. In the file name, a hyphen (`-`) represents a space in the page title. For example, the page title "How to contribute" corresponds to the file name _How-to-contribute.md_. The URL path to the wiki page includes the file name. For example, `https://github.com/ExampleWiki/How-To/How-to-contribute.md`. This approach helps ensure bookmark links to the page remain intact as the wiki changes over time. |
43 | 44 |
|
44 | 45 | [!INCLUDE [temp](./includes/wiki-naming-conventions.md)] |
45 | 46 |
|
46 | | -## *.order* file |
| 47 | +## Page sequence and the .order file |
| 48 | + |
| 49 | +The _.order_ file defines the wiki page sequence. Git looks for this file in each folder to identify the sequence to present files at that location. The default page sequence is alphabetical order (A to Z) by file name. |
| 50 | + |
| 51 | +### Define custom page sequence |
| 52 | + |
| 53 | +When a folder doesn't have an _.order_ file, Git uses the default alphabetical sequence. |
| 54 | + |
| 55 | +You can define a custom sequence for any folder by updating the _.order_ file in the folder, including at the root level. |
| 56 | + |
| 57 | +The following visual shows an example of a wiki table of contents (TOC) and the corresponding _.order_ file that creates the TOC. |
| 58 | + |
| 59 | +:::row::: |
| 60 | +:::column span=""::: |
| 61 | + |
| 62 | +**Wiki TOC displays in the web browser** |
| 63 | + |
| 64 | +:::image type="content" source="media/wiki/wiki-toc-example.png" border="false" alt-text="Screenshot of the TOC for a wiki with several folders expanded to show subfolders."::: |
| 65 | + |
| 66 | +:::column-end::: |
| 67 | +:::column span=""::: |
| 68 | + |
| 69 | +**.order file defines the TOC page sequence** |
| 70 | + |
| 71 | +:::image type="content" source="media/wiki/wiki-repo-order-file-example.png" border="false" alt-text="Screenshot of a wiki folder and file list in a Git repository. The .order file is open and shows the definition for the TOC page sequence."::: |
| 72 | + |
| 73 | +:::column-end::: |
| 74 | +:::row-end::: |
47 | 75 |
|
48 | | -The *.order* file defines the sequence of pages within the wiki. The following visual shows an example of a wiki TOC and it's corresponding .order file. |
| 76 | +The _.order_ file changes the sequence from alphabetical to "Marketing" followed by "Fabrikam Fiber." |
49 | 77 |
|
50 | | -| **Wiki TOC** | ***.order* file** | |
51 | | -|--------------|--------------------------------------------| |
52 | | -| :::image type="content" source="media/wiki/wiki-toc-example.png" alt-text="Screenshot of wiki TOC example."::: | :::image type="content" source="media/wiki/wiki-repo-order-file-example.png" alt-text="Screenshot of Wiki example order file."::: | |
| 78 | +For more information about how to reorder wiki pages, see [Add, edit, and reorder wiki pages](add-edit-wiki.md#reorder-a-wiki-page). |
53 | 79 |
|
54 | | -The default hierarchy is in alphabetical sequence, however you can change this hierarchy in the *.order* file. For more information about how to reorder wiki pages, see [Add and edit wiki pages, Reorder a wiki page](add-edit-wiki.md#reorder-a-wiki-page). |
| 80 | +### Restore alphabetical sequence |
55 | 81 |
|
56 | | -### Delete the *.order* file to revert to alphabetical sorting |
| 82 | +If a folder has a custom sequence, you can revert the sort method to alphabetical by following these steps: |
57 | 83 |
|
58 | | -When there's no *.order* file the pages get sorted alphabetically. To revert to alphabetical sorting, do the following steps: |
| 84 | +1. Copy the clone URL for the wiki and open it in a browser. The Git repository for the wiki opens. |
59 | 85 |
|
60 | | -1. Copy the clone URL for the wiki and open it in a browser. |
61 | | - Doing so opens the Git repository (files hub), which backs the wiki. |
62 | | -2. Go to the *.order* file and delete it. |
63 | | - The file gets automatically (re)created after deletion, for example, in a drag and drop action on an article. |
| 86 | +1. Go to the _.order_ file that you want to revert and delete the file. After the file is deleted, Git automatically creates a new _.order_ file for that location. The new file uses the default sequence. |
64 | 87 |
|
65 | | -## Related articles |
| 88 | +## Related content |
66 | 89 |
|
67 | 90 | - [Set up wiki vs. publish code as wiki](provisioned-vs-published-wiki.md) |
68 | 91 | - [Create a wiki for your team project](wiki-create-repo.md) |
69 | | -- [Publish a Git repository to a wiki](publish-repo-to-wiki.md) |
70 | | -- [Update wiki pages offline](wiki-update-offline.md) |
71 | | -- [Manage README and wiki permissions](manage-readme-wiki-permissions.md) |
| 92 | +- [Publish a Git repository to a wiki](publish-repo-to-wiki.md) |
0 commit comments