# Post types, tumblr style

**URL:** <https://discourse.gohugo.io/t/post-types-tumblr-style/26734>\
**Category:** support\
**Created:** [July 6, 2020, 8:53am UTC](https://discourse.gohugo.io/t/post-types-tumblr-style/26734 "2020-07-06T08:53:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![willduncanphoto](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/willduncanphoto/32/11840_2.png) [@willduncanphoto](https://discourse.gohugo.io/u/willduncanphoto)\
**Post date:** [July 6, 2020, 8:53am UTC](https://discourse.gohugo.io/t/post-types-tumblr-style/26734/1 "2020-07-06T08:53:19Z")

</div>

I’d like to create a blog / posts section of my hugo site that has more of a tumblr style feed. Different content types for different kinds of posts all in one stream. I’m not really sure if that’s wise from an SEO standpoint but I dont’ want the have the same displayed format for an article as a simple link post.

Photograph, Link(s), Video, Quote, Article would cover the bases of content.

But I’m a little baffled how to best accomplish it from a template perspective in hugo. Returning different post styles/formatting on the list page specifically.

Based on what I’ve managed to figure out from the docs, the most straightforward solution is to have content types, like `content/posts/articles` and `content/posts/photos` and `content/posts/links` which would allow me to set different archetypes for each post type.

Any tips or ideas are appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![jmooring](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/jmooring/32/4214_2.png) [@jmooring](https://discourse.gohugo.io/u/jmooring)\
**Post date:** [July 6, 2020, 6:03pm UTC](https://discourse.gohugo.io/t/post-types-tumblr-style/26734/2 "2020-07-06T18:03:30Z")

</div>

1) The URL structure of your site does **not** have to mirror the structure of your `content/` directory. You can override the URL structure in the [permalinks](https://gohugo.io/content-management/urls/#permalinks) section of `config.toml`. I mention this because it sounds as if you want everything to appear under `posts/`, but it would be advantageous to organize your `content/` directory differently.

2) Organize your content like this:

```auto
content
├── article
│ ├── article-1.md
│ └── article-2.md
├── link
│ ├── link-1.md
│ └── link-2.md
├── photo
│ ├── photo-1.md
│ └── photo-2.md
├── quote
│ ├── quote-1.md
│ └── quote-2.md
└── video
    ├── video-1.md
    └── video-2.md

```

This has several benefits:

1. Hugo will infer [content _type_](https://gohugo.io/content-management/types/) from the first level directory under `content/`. You will not have to set `type` in front matter.

2. You can easily create archetypes:

3. It will be easy to override single and list templates:

3) If I understand correctly, when listing a mix of content types on a single list page, you want to format each item’s display based on its type.

layouts/\_default/list.html:

```auto
{{ define "main" }}
  {{ .Content }}
  {{ range .Site.RegularPages }}
    {{ partial (printf "list-page-item/%s.html" .Type) . }}
  {{ end }}
{{ end }}

```

Then create a directory structure for the partials:

```auto
layouts/
└── partials
    └── list-page-item
        ├── article.html
        ├── link.html
        ├── photo.html
        ├── quote.html
        └── video.html

```

For example, the partial for an article might look like this:

```auto
<div class="list-page-item list-page-item-article">
  <h2><a href="{{ .RelPermalink }}">{{ .Title }}</a></h2>
  <p>{{ .Summary }}</p>
  {{- if .Truncated }}
    <p><a href="{{ .RelPermalink }}">Continue reading...</a></p>
  {{- end }}
</div>

```

while the partial for a quote might look like this:

```auto
<div class="list-page-item list-page-item-quote">
  {{ .Content }}
</div>

```

---

<div class="post-metadata">

**Author:** ![willduncanphoto](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/willduncanphoto/32/11840_2.png) [@willduncanphoto](https://discourse.gohugo.io/u/willduncanphoto)\
**Post date:** [July 6, 2020, 6:39pm UTC](https://discourse.gohugo.io/t/post-types-tumblr-style/26734/3 "2020-07-06T18:39:50Z")

</div>

That’s quite helpful, and close to what I had in my head. I’ll tinker a little more tonight with what you posted and see where I land.

Thanks so much.

---

<div class="post-metadata">

**Author:** ![willduncanphoto](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/willduncanphoto/32/11840_2.png) [@willduncanphoto](https://discourse.gohugo.io/u/willduncanphoto)\
**Post date:** [January 26, 2022, 4:44am UTC](https://discourse.gohugo.io/t/post-types-tumblr-style/26734/4 "2022-01-26T04:44:43Z")

</div>

Want to hear something embarrassing?

I’m just now getting around to working on this.

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/system/32/1_2.png) [@system](https://discourse.gohugo.io/u/system)\
**Post date:** [June 16, 2022, 8:22am UTC](https://discourse.gohugo.io/t/post-types-tumblr-style/26734/5 "2022-06-16T08:22:01Z")

</div>

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.
