title: Commentaire Hacker News sur Next Gen Static Blogging
url: https://news.ycombinator.com/item?id=25701053
hash_url: 6a8fadb032ab4c1951319268a1315655

<span class="commtext c00">Note that closing &lt;/p&gt; tags are optional<i>†</i>, so one can be an HTML purist and still write a decent HTML document with a relatively clean markup like this:<p></p><pre><code>    &lt;!DOCTYPE html&gt;
    &lt;html lang="en"&gt;
    &lt;title&gt;Lorem Ipsum&lt;/title&gt;
    &lt;h1&gt;Lorem Ipsum&lt;/h1&gt;
    &lt;p&gt;
    Lorem ipsum dolor sit amet, consectetur adipiscing elit.
    Duis id maximus tortor. Sed nisi ante, fermentum vel nunc
    et, tincidunt sagittis magna. In ultrices commodo lacus, id
    tristique ipsum euismod laoreet.
    &lt;p&gt;
    Maecenas at neque posuere, aliquet erat at, vehicula est.
    Duis aliquet elit et arcu laoreet, id pulvinar eros pretium.
    Quisque consectetur, enim semper facilisis feugiat, velit
    sapien semper arcu, eu mollis libero est et odio.
    &lt;p&gt;
    Curabitur fringilla interdum ante vel ultricies. Mauris
    volutpat nisi sed turpis elementum elementum. Mauris nec
    eleifend lorem. Sed ac vulputate libero.
</code></pre>
A valid HTML5 document does not require<i>†</i> explicit &lt;head&gt;, &lt;body&gt;, or the closing &lt;/p&gt;, &lt;/html&gt; tags. See the spec for optional tags at <a href="https://html.spec.whatwg.org/multipage/syntax.html#optional-tags" rel="nofollow">https://html.spec.whatwg.org/multipage/syntax.html#optional-...</a> for more details. Similarly, the markup for lists and tables can be cleaned up too because the closing &lt;/li&gt;, &lt;/tr&gt;, &lt;/th&gt;, &lt;/td&gt; tags are optional<i>†</i>.<p>Note that the opening &lt;html&gt; tag is optional<i>†</i> too but I retained it in the above example to specify the lang attribute otherwise the W3 markup validator warns, "Consider adding a lang attribute to the html start tag to declare the language of this document."</p><p><i>† These tags are optional provided certain conditions are met. See the spec for full details. In practice, one rarely has to worry about these conditions.</i>
</p>
