# Generate multiple static pages from each .md file?

**URL:** <https://discourse.gohugo.io/t/generate-multiple-static-pages-from-each-md-file/9294>\
**Category:** Uncategorized\
**Created:** [November 19, 2017, 10:05am UTC](https://discourse.gohugo.io/t/generate-multiple-static-pages-from-each-md-file/9294 "2017-11-19T10:05:45Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![okgaz](https://avatars.discourse-cdn.com/v4/letter/o/b9bd4f/32.png) [@okgaz](https://discourse.gohugo.io/u/okgaz)\
**Post date:** [November 19, 2017, 10:05am UTC](https://discourse.gohugo.io/t/generate-multiple-static-pages-from-each-md-file/9294/1 "2017-11-19T10:05:45Z")

</div>

Is it possible to make more than one static page from each .md file?

For instance say I wanted:  
[red-widgets.md](http://red-widgets.md)

to generate the pages “/red-widgets/index.html” and “”/red-widgets/permissions.json"  
?

Or alternatively:

“/red-widgets/index.html” and “”/red-widgets-permissions.json"  
?

---

<div class="post-metadata">

**Author:** ![bep](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/bep/32/3332_2.png) [@bep](https://discourse.gohugo.io/u/bep)\
**Post date:** [November 19, 2017, 11:01am UTC](https://discourse.gohugo.io/t/generate-multiple-static-pages-from-each-md-file/9294/2 "2017-11-19T11:01:30Z")

</div>

> **[Custom Output Formats](https://gohugo.io/templates/output-formats/#readout)**
>
> Hugo can output content in multiple formats, including calendar events, e-book formats, Google AMP, and JSON search indexes, or any custom text format.

---

<div class="post-metadata">

**Author:** ![okgaz](https://avatars.discourse-cdn.com/v4/letter/o/b9bd4f/32.png) [@okgaz](https://discourse.gohugo.io/u/okgaz)\
**Post date:** [July 8, 2018, 11:16am UTC](https://discourse.gohugo.io/t/generate-multiple-static-pages-from-each-md-file/9294/3 "2018-07-08T11:16:12Z")

</div>

Thanks for this. I’m just revisiting the idea now. I have my site pages set in toml markdown like this:

type = “book”  
layout = “book”  
url = “harry-potter”

Is it possible to modify that to make a second page with a different layout? Something like this?

type = “book”  
layout = [“book”, “book-fullscreen”]  
url = [“harry-potter”, harry-potter-fullscreen"]

?

Or does it have to be via the config file?

---

<div class="post-metadata">

**Author:** ![regis](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/regis/32/4958_2.png) [@regis](https://discourse.gohugo.io/u/regis)\
**Post date:** [July 8, 2018, 2:55pm UTC](https://discourse.gohugo.io/t/generate-multiple-static-pages-from-each-md-file/9294/4 "2018-07-08T14:55:17Z")

</div>

You need to create a “fullscreen” output format and set its params in the config files.  
This custom output format will have to live alongside `harry-potter/index.html` as `harry-potter/index-fullscreen.html` (or something). You may be able to have it live inside a directory as `harry-potter/fullscreen/index.html` but I’m not sure…

Then, you’ll have to set up your hosts as to make url rewriting from `harry-potter-fullscreen/` to `harry-potter/index-fullscreen.html`

Study the doc on output formats and if you need help on those, hit the discourse with the info you missed from the doc!

Also this tutorial, although not dealing with html but json, [https://forestry.io/blog/build-a-json-api-with-hugo/#/](https://forestry.io/blog/build-a-json-api-with-hugo/#/) is a good starter for understanding how Output Formats work.
