# Seeking Thoughts: What to do when a page doesn’t need to be built

**URL:** <https://discourse.gohugo.io/t/seeking-thoughts-what-to-do-when-a-page-doesn-t-need-to-be-built/19038>\
**Category:** Uncategorized\
**Created:** [June 4, 2019, 8:34am UTC](https://discourse.gohugo.io/t/seeking-thoughts-what-to-do-when-a-page-doesn-t-need-to-be-built/19038 "2019-06-04T08:34:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![purrloftruth](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/purrloftruth/32/7744_2.png) [@purrloftruth](https://discourse.gohugo.io/u/purrloftruth)\
**Post date:** [June 4, 2019, 8:34am UTC](https://discourse.gohugo.io/t/seeking-thoughts-what-to-do-when-a-page-doesn-t-need-to-be-built/19038/1 "2019-06-04T08:34:53Z")

</div>

Hi there,

I have what I consider to be a potentially strange use case, and I wanted to get some thoughts from the broader community on the various ways it could be tackled, as well as what might be the best-practices for building sites like mine in the future.

I’m a writer, and part of the site I’m building is planned to act as a portfolio of my writing. Some of that writing is going to be housed on-site, of course, but I think some of it is going to be housed off-site.

The problem: I want to be able to have all of the flexibility of normal front-matter, and use all of the same normal templating that’s built into the theme I’m writing (for which I’m using Ace, because it’s easier on my brain), while not having to have individual pages for items that are only going to be outbound links anyway. Where it would normally link to a page that would contain the content, it would simply link off-site, but the list pages would maintain all of the same ability to display anything that I would have otherwise been able to put in the front-matter of a normal page.

As Hugo is right now, it doesn’t give you a super easy way to do this that gives you the option to not actually build a page. You can create individual markdown files with no content, and set up the front matter that way, but no matter what you do in terms of template hacking and custom front matter to make the site do what you want, it will still build actual pages for each of those files and link them in your sitemap, for instance. This isn’t ideal.

One thing I could do instead is set up some custom JSON with the data for the off-site links. That way, I can pull that data, read in the site pages, merge it all in together at compile time, and draw my views that way. It’s a more elegant solution in terms of not building pages. This also requires a ton of extra work on my part, maintaining a bunch of extra code, and splitting my content across two separate locations and two separate formats. It’s also far, far from ideal.

What I would really like to see is a way that I can simply declare that a page doesn’t need to be rendered, and a property that specifies the actual link that any link to that page should point to instead, specifically added to Hugo. Honestly, I think this front matter property is likely one in the same — specify it, and it automatically doesn’t build the page, and any links to that page automatically go to the URL. Additionally, there’d be a variable that templates could use to determine whether a particular page was set up this way, so they could add `target="_blank" rel="noopener noreferrer"` or whatnot more easily to those links.

I opened [an issue about this](https://github.com/gohugoio/hugo/issues/5621) a few months ago, but it never saw much attention, so I wanted to post this here to see if I could get some more people’s thoughts on the matter. I think this could be a great addition to Hugo and it would certainly make it much easier to make websites that relied on this sort of functionality! Thanks for reading!

---

<div class="post-metadata">

**Author:** ![alexandros](https://avatars.discourse-cdn.com/v4/letter/a/ecc23a/32.png) [@alexandros](https://discourse.gohugo.io/u/alexandros)\
**Post date:** [June 4, 2019, 8:38am UTC](https://discourse.gohugo.io/t/seeking-thoughts-what-to-do-when-a-page-doesn-t-need-to-be-built/19038/2 "2019-06-04T08:38:45Z")

</div>

Please have a look at Headless Bundles:

> **[Page Bundles](https://gohugo.io/content-management/page-bundles/#headless-bundle)**
>
> Content organization using Page Bundles

This is the easiest and fastest way to render outbound links in list pages.

No need for data files for this simple functionality.

---

<div class="post-metadata">

**Author:** ![HenrySkup](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/henryskup/32/8183_2.png) [@HenrySkup](https://discourse.gohugo.io/u/HenrySkup)\
**Post date:** [June 4, 2019, 8:50am UTC](https://discourse.gohugo.io/t/seeking-thoughts-what-to-do-when-a-page-doesn-t-need-to-be-built/19038/3 "2019-06-04T08:50:27Z")

</div>

def take a look at Page Bundles as @alexandros suggested.

All of this ill probably have to do with your editorial workflow. I had a situation where I wanted to, in a list page, list out the titles of pages that were still a draft with then intention that as they were ready to be published that the Hugo would not only build the pages but link to them. In this case, I also wanted to control the directory structure in a way that (i believe) a headless page bundle would not allow.

Below is the solution that I can up with:

> [@\[SOLVED\] Get Draft Front Matter without Generating Page?](https://discourse.gohugo.io/t/solved-get-draft-front-matter-without-generating-page/18259/3):
>
> Hmmm, interesting – that could work in another context. I’m building this for Forestry, so I don’t think that it would fit within their [current] editing workflow. I feel that this could be fairly useful and since Hugo is already going through all the pages to check if draft = true or not, I could imagine that it could easily store all front matter / content, and then filters out all the drafts when it writes to public/

---

<div class="post-metadata">

**Author:** ![purrloftruth](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/purrloftruth/32/7744_2.png) [@purrloftruth](https://discourse.gohugo.io/u/purrloftruth)\
**Post date:** [June 5, 2019, 8:49pm UTC](https://discourse.gohugo.io/t/seeking-thoughts-what-to-do-when-a-page-doesn-t-need-to-be-built/19038/4 "2019-06-05T20:49:10Z")

</div>

This is interesting! I don’t think this was an option when I was first looking into this at the beginning of the year, so it’s good to know that it is now. I’ll play around with the feature and see if I can get something hooked up using headless bundles. Thanks!
