Skip to content
Back to skills

Github Wiki Flat

ASecurity

GitHub Wiki has a flat namespace — no real folders, sidebar ordering tricks, link gotchas

  • 4 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 3, 2026
ai-agentsjavascriptgojavadebugginggitapi

Works with

  • api

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add fabioc-aloha/Alex_Skill_Mall --skill github-wiki-flat --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Github Wiki Flat?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Github Wiki Flat
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/fabioc-aloha-github-wiki-flat/badge)](https://www.skillsdirectory.com/skills/fabioc-aloha-github-wiki-flat)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: github-wiki-flat
description: "GitHub Wiki has a flat namespace — no real folders, sidebar ordering tricks, link gotchas"
lastReviewed: 2026-04-30
---

# GitHub Wiki Is Flat

**Category**: GitHub
**Time Saved**: 1-2 hours debugging broken links
**Battle-tested**: Yes — wiki publishing automation

---

## The Problem

You organize your wiki source files in a nice folder structure:

```
wiki/
  getting-started/
    installation.md
    configuration.md
  api/
    endpoints.md
    authentication.md
```

You push to GitHub Wiki. All your internal links break. Pages appear at root level with mangled names.

## Why It Happens

GitHub Wiki has **no folder hierarchy**. Every page renders at the wiki root. Folders in your source become part of the page name (with dashes).

```
wiki/getting-started/installation.md
  → renders at: /wiki/getting-started-installation

wiki/api/endpoints.md  
  → renders at: /wiki/api-endpoints
```

## The Rules

### 1. All Pages Render at Root

```
Source: docs/guide/setup.md
URL:    github.com/user/repo/wiki/guide-setup

NOT:    github.com/user/repo/wiki/guide/setup  ❌
```

### 2. Links Must Use Flat Names

```markdown
<!-- In wiki/getting-started/installation.md -->

<!-- ❌ WRONG — relative path -->
See [configuration](./configuration.md)

<!-- ✅ CORRECT — flat wiki name -->
See [configuration](getting-started-configuration)

<!-- ❌ WRONG — assumes hierarchy -->
See [endpoints](../api/endpoints.md)

<!-- ✅ CORRECT — flat wiki name -->
See [endpoints](api-endpoints)
```

### 3. _Sidebar.md Is Ground Truth

The sidebar defines your navigation. All links in `_Sidebar.md` must use flat names:

```markdown
<!-- _Sidebar.md -->

**Getting Started**
- [Installation](getting-started-installation)
- [Configuration](getting-started-configuration)

**API Reference**  
- [Endpoints](api-endpoints)
- [Authentication](api-authentication)
```

## Link Rewriting Automation

If you maintain wiki source in a folder structure, automate link rewriting on publish:

```javascript
function rewriteWikiLinks(content, sourceDir) {
  // Convert relative paths to flat wiki names
  return content.replace(
    /\[([^\]]+)\]\(\.?\/?([^)]+)\.md\)/g,
    (match, text, path) => {
      // ./sibling.md → folder-sibling
      // ../other/page.md → other-page
      const flatName = path
        .replace(/^\.\.?\/?/, '')
        .replace(/\//g, '-');
      return `[${text}](${flatName})`;
    }
  );
}
```

## Source Code Links

Links to source code from wiki need full repo URLs:

```markdown
<!-- ❌ WRONG — wiki-relative path -->
See [source](../src/index.ts)

<!-- ✅ CORRECT — full GitHub URL -->
See [source](https://github.com/user/repo/blob/main/src/index.ts)
```

## Three Link Types to Handle

| Link Type | Source | Wiki Target |
|-----------|--------|-------------|
| Same folder | `./sibling.md` | `folder-sibling` |
| Cross folder | `../api/page.md` | `api-page` |
| Source code | `../../src/file.ts` | Full GitHub blob URL |

## Verification Checklist

- [ ] All internal links use flat wiki names
- [ ] _Sidebar.md uses flat names
- [ ] Source code links use full GitHub URLs
- [ ] Test links after wiki push
- [ ] Automate link rewriting if maintaining folder structure

## Common Symptoms

- "Wiki links work locally but break on GitHub"
- "404 errors on wiki pages"
- "Pages show folder names in titles"

## Related Skills

- `github-readme-override` — File hierarchy gotchas

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…