# Custom Template for Documentation

**URL:** <https://ziggit.dev/t/custom-template-for-documentation/14025>\
**Category:** Help\
**Tags:** build-system, zig-docs\
**Created:** [January 21, 2026, 7:25am UTC](https://ziggit.dev/t/custom-template-for-documentation/14025 "2026-01-21T07:25:36Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lygaen](https://ziggit.dev/user_avatar/ziggit.dev/lygaen/32/7197_2.png) [@Lygaen](https://ziggit.dev/u/Lygaen)\
**Post date:** [January 21, 2026, 7:25am UTC](https://ziggit.dev/t/custom-template-for-documentation/14025/1 "2026-01-21T07:25:36Z")

</div>

Heya !

I was wondering, is there a way to pass a custom template for documentation ? I mean the default one used when generating docs from a module.

The default one seems to be here :

> **[zig/lib/docs/index.html at master](https://codeberg.org/ziglang/zig/src/branch/master/lib/docs/index.html)**
>
> zig - General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.

But I don’t see a clear reference as to where to inject a custom template. I would like if possible to avoid modifying the compiler directly.

Thanks 😄

---

<div class="post-metadata">

**Author:** ![Southporter](https://ziggit.dev/user_avatar/ziggit.dev/southporter/32/2500_2.png) [@Southporter](https://ziggit.dev/u/Southporter)\
**Post date:** [January 21, 2026, 3:03pm UTC](https://ziggit.dev/t/custom-template-for-documentation/14025/2 "2026-01-21T15:03:26Z")

</div>

Hi @Lygaen,  
Can you explain a bit more what you are trying to accomplish? That documentation file is only for the std library for Zig. If you are trying to build your own docs, you may want to look at other codebases that generate docs.  
For example, [DVUI docs](https://david-vanderson.github.io/docs/) are generated with a build step that uses a custom index.html. I believe this is copied from the zig lib docs and modified for the look and feel of DVUI. You could do something similar. The build.zig file for DVUI has a build step for [generating the docs files](https://github.com/david-vanderson/dvui/blob/bdfd5afac3f0539b1ff2a4adffb2ca81ba7ec850/build.zig#L207)

---

<div class="post-metadata">

**Author:** ![Lygaen](https://ziggit.dev/user_avatar/ziggit.dev/lygaen/32/7197_2.png) [@Lygaen](https://ziggit.dev/u/Lygaen)\
**Post date:** [January 21, 2026, 3:05pm UTC](https://ziggit.dev/t/custom-template-for-documentation/14025/3 "2026-01-21T15:05:47Z")

</div>

Heya !

I was trying to modify the default index.html template used during the build process to generate the docs.

Aka. customize the ouput of `zig build docs` in my project.

What I linked was the current template, which is “embedded” in the compiler and as such doesn’t seem to be modifiable.

I’ll have a look at DVUI which seems to resolve my provlem.

---

<div class="post-metadata">

**Author:** ![Southporter](https://ziggit.dev/user_avatar/ziggit.dev/southporter/32/2500_2.png) [@Southporter](https://ziggit.dev/u/Southporter)\
**Post date:** [January 21, 2026, 3:08pm UTC](https://ziggit.dev/t/custom-template-for-documentation/14025/4 "2026-01-21T15:08:27Z")

</div>

Yeah, you will have to go the DVUI route for that. If you want a custom logo or anything like that, you will need to copy it out and generate it yourself.

---

<div class="post-metadata">

**Author:** ![Lygaen](https://ziggit.dev/user_avatar/ziggit.dev/lygaen/32/7197_2.png) [@Lygaen](https://ziggit.dev/u/Lygaen)\
**Post date:** [January 21, 2026, 3:09pm UTC](https://ziggit.dev/t/custom-template-for-documentation/14025/5 "2026-01-21T15:09:03Z")

</div>

Thanks ! I’ll try the DVUI way !

---

<div class="post-metadata">

**Author:** ![Southporter](https://ziggit.dev/user_avatar/ziggit.dev/southporter/32/2500_2.png) [@Southporter](https://ziggit.dev/u/Southporter)\
**Post date:** [January 21, 2026, 3:10pm UTC](https://ziggit.dev/t/custom-template-for-documentation/14025/6 "2026-01-21T15:10:30Z")

</div>

That being said, I thing this will be something people run into more in the future. It would be convenient if `getEmittedDocs` took an optional parameter that allowed for custom templates.
