# {{ site.news }} renders stray \`\<!DOCTYPE html\>\`

**URL:** <https://talk.jekyllrb.com/t/site-news-renders-stray-doctype-html/5454>\
**Category:** Help\
**Created:** [January 5, 2021, 12:52am UTC](https://talk.jekyllrb.com/t/site-news-renders-stray-doctype-html/5454 "2021-01-05T00:52:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Emadmasroor](https://avatars.discourse-cdn.com/v4/letter/e/db5fbb/32.png) [@Emadmasroor](https://talk.jekyllrb.com/u/Emadmasroor)\
**Post date:** [January 5, 2021, 12:52am UTC](https://talk.jekyllrb.com/t/site-news-renders-stray-doctype-html/5454/1 "2021-01-05T00:52:42Z")

</div>

Hello,

I am building a site using this [template](https://github.com/alshedivat/al-folio). You can see my version of the source files at [my fork](https://github.com/Emadmasroor/al-folio) of this repository.

I am trying to build a `news` page similar to the `projects` page in the template, except that the news page should chronologically display each “news” item. Each such item will be a markdown file in the `_news` folder, so this should be pretty straightforward: I created a “news” page inside the `_pages` folder, with the following content:

```auto
---
layout: page
title: news
permalink: /news/
nav: true
---

Hello, world

  {% assign sorted_news = site.news | sort:"date" | reverse %}
  {% for news in sorted_news %}
    {{ news }}
  {% endfor %}

```

However, when this renders, there is stray text " `<!DOCTYPE html>` " next to each news item. I tried replacing `news` with `news.content`, but this did not work either: the text does not properly render; instead, I get the output `<p> news text .... news text </p>`.

Either way would work fine for me! I think the ‘heading’ of each news item is unnecessary on the ‘news’ page, so a nice rendering of just the dates and content (without the title) would also be fine. I primarily intend for each “news” entry to be a small one – planning to migrate my site, including the “events” page, from [this one](https://emadmasroor.github.io/Events/).

---

<div class="post-metadata">

**Author:** ![Emadmasroor](https://avatars.discourse-cdn.com/v4/letter/e/db5fbb/32.png) [@Emadmasroor](https://talk.jekyllrb.com/u/Emadmasroor)\
**Post date:** [January 5, 2021, 2:37pm UTC](https://talk.jekyllrb.com/t/site-news-renders-stray-doctype-html/5454/2 "2021-01-05T14:37:18Z")

</div>

I found a fix! Just enclose the `{{ news.content }}` inside a `<article> ... </article>`:

```auto
  {% assign sorted_news = site.news | sort:"date" | reverse %}
  {% for news in sorted_news %}
  <article class="post-content">
    {{ news.content }}
  </article>
  {% endfor %}

```
