TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Next Gen Static Blogging

227 pointsby mmackhover 4 years ago

47 comments

susamover 4 years ago
Note that closing &lt;&#x2F;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><pre><code> &lt;!DOCTYPE html&gt; &lt;html lang=&quot;en&quot;&gt; &lt;title&gt;Lorem Ipsum&lt;&#x2F;title&gt; &lt;h1&gt;Lorem Ipsum&lt;&#x2F;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;&#x2F;p&gt;, &lt;&#x2F;html&gt; tags. See the spec for optional tags at <a href="https:&#x2F;&#x2F;html.spec.whatwg.org&#x2F;multipage&#x2F;syntax.html#optional-tags" rel="nofollow">https:&#x2F;&#x2F;html.spec.whatwg.org&#x2F;multipage&#x2F;syntax.html#optional-...</a> for more details. Similarly, the markup for lists and tables can be cleaned up too because the closing &lt;&#x2F;li&gt;, &lt;&#x2F;tr&gt;, &lt;&#x2F;th&gt;, &lt;&#x2F;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, &quot;Consider adding a lang attribute to the html start tag to declare the language of this document.&quot;<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>
评论 #25703695 未加载
评论 #25702389 未加载
评论 #25702582 未加载
评论 #25702481 未加载
评论 #25705703 未加载
评论 #25705636 未加载
评论 #25715467 未加载
评论 #25704419 未加载
onion2kover 4 years ago
I think it&#x27;s a bit of a shame that this discussion has focused on the tech and (slightly odd) HTML choices here. Those are probably the least interesting parts of any discussion around what a &quot;next gen&quot; blog platform might look like.<p>Where the author is correct about next-gen blogging (in my opinion anyway) is in the attempt to reduce the friction to publishing a new post. What tech stack you use, whether it&#x27;s static, what your HTML looks like, are all entirely secondary to whether or not you actually use your blog to build a corpus of content that shows off your opinions, expertise, and insights over time. That&#x27;s what a blog is. It isn&#x27;t HTML tags and CSS. It&#x27;s the content within the tags. For me any next-gen blog tech has to make 3 things trivially easy -<p>- it needs to be simple to set up and maintain. If my laptop dies and I can&#x27;t just clone my blog&#x27;s repo and run a couple of commands to get back to where I was it won&#x27;t work.<p>- it needs to be <i>really</i> simple to publish a post. Most blogs use Markdown with either front matter or a specific file path. That&#x27;s OK but it puts most of the cognitive load on me. I&#x27;m sure there&#x27;s a better way but I don&#x27;t know what it is. I use 11ty for my blog which is very good, and if I didn&#x27;t worry about URLs as much as I do it would be could actually work. But I do.<p>- there&#x27;s nothing that pushes me to write more. This is the kicker, and no one has ever solved it. I think a blog platform that recommends posts I should write, and that praises me for writing, would drive me to actually write far more than I do. So far the only blog platform I&#x27;ve seen come close is Hashnode, but even that doesn&#x27;t do it very well.
评论 #25705513 未加载
评论 #25705348 未加载
评论 #25705943 未加载
sedatkover 4 years ago
It&#x27;s funny that we&#x27;ve come full circle. The web had started with static web sites. Many of them had misused HTML tags to take shortcuts, and to achieve a certain look, including `&lt;pre&gt;`, `&lt;table&gt;`, etc. That had eventually caused so many compatibility issues that we thought malformed documents were a problem, so we defined a rigid structure for HTML called XHTML. We discovered the value of semantics and separated style from content with CSS. Then, we thought XHTML was too much work and just went back to loose style with HTML5 for ease of use. Then, people thought CSS was so much work that they applauded Tailwind for brining styling back into HTML. And three decades later, &quot;next-gen static blogging&quot; is about misusing HTML tags to take shortcuts, and to achieve a certain look. :)
评论 #25705772 未加载
rayragover 4 years ago
So, instead of using semantic html and css like &#x27;white-space: pre-line&#x27; and &#x27;max-width: 40ch&#x27; author wrapped content of his blog post into &#x27;code&#x27; tag and called it &#x27;next-gen&#x27;. What is &#x27;next-gen&#x27; about it? Either I am missing something or I&#x27;m not drunk enough. Worst thing it has 100 upvotes :&#x2F;<p>&gt;Simplicity is key<p>This isn&#x27;t simplicity...<p>I need a beer.
评论 #25705904 未加载
评论 #25707304 未加载
评论 #25702990 未加载
评论 #25706125 未加载
ffpipover 4 years ago
Your site is too hard to read on. Make the color of the font darker or the background lighter please.<p>I had to copy to a notepad so I could read it.<p>Edit:<p>Apparently, dark mode users get this - <a href="https:&#x2F;&#x2F;i.imgur.com&#x2F;5PHYac1.png" rel="nofollow">https:&#x2F;&#x2F;i.imgur.com&#x2F;5PHYac1.png</a><p>I get this - <a href="https:&#x2F;&#x2F;i.imgur.com&#x2F;5PHYac1.png" rel="nofollow">https:&#x2F;&#x2F;i.imgur.com&#x2F;5PHYac1.png</a><p>Light mode is terrible, dark mode is okay. Please increase the contrast in both places.
评论 #25704752 未加载
评论 #25702324 未加载
评论 #25702306 未加载
robertoandredover 4 years ago
Why is he bragging about being awful at web dev? &lt;p&gt; tags exist for a reason. You&#x27;re not cool for omitting them, you&#x27;re hurting your users.
评论 #25711724 未加载
Priem19over 4 years ago
I applaud that simplicity seems to be trending, but the benefits of not having paragraph tags don&#x27;t seem to outweigh the downsides. It&#x27;s not that big of a deal, and it enables reader mode.<p>Leaving as much as possible left to default is what I prefer; it supports the greatest number of browsers and assume is the fastest. <a href="https:&#x2F;&#x2F;www.quitfacebook.org&#x2F;file&#x2F;play.html" rel="nofollow">https:&#x2F;&#x2F;www.quitfacebook.org&#x2F;file&#x2F;play.html</a>
评论 #25707102 未加载
Scaevolusover 4 years ago
Many static site generators, including Hugo and Jekyll, have file watching support and even automatic page reloads, so their workflow is barely different from editing raw html. You have to jump through some more hoops for raw html, but I expect you save time overall.
chacha2over 4 years ago
It would be nice to read a static blog that talks about more than creating a static blog.
codazodaover 4 years ago
I ran to my desktop to load this up and have a look. I&#x27;m ALWAYS looking for a more simple blogging solution. I was hoping for mostly plain text plus an em tag here or there. It&#x27;s a little more involved than that, but it&#x27;s given me some ideas.<p>Shameless plug, I created the NeatCSS framework to have this &quot;simple&quot; look and feel. On that, however, I didn&#x27;t try to avoid your typical HTML code.<p><a href="https:&#x2F;&#x2F;neat.joeldare.com" rel="nofollow">https:&#x2F;&#x2F;neat.joeldare.com</a>
评论 #25702278 未加载
pickpuckover 4 years ago
If the only thing being removed were &lt;div&gt; tags, which don&#x27;t have structural or semantic meaning, it would probably be just as easy to parse for screen readers and robots.<p>Two problems I see:<p>1. Where you have a heading you may want it and its associated content wrapped in a &lt;section&gt;. Where you have a separated paragraph you really do probably want a &lt;p&gt;.<p>So these newlines aren&#x27;t always just replacing &lt;div&gt;s. The page has no structure except what can be derived from headings.<p>2. Wrapping everything in a &lt;code&gt; tag seems like it could cause issues. It would probably be better to use &lt;main&gt; and apply the clever one line of CSS mentioned in the post.
martinsbover 4 years ago
How well is this handled from the accessibility point of view? I imagine that wrapping text in consecutive “p” tags is semantically clearer, however on the other side it shouldn’t be too hard for any accessibility software to recognize this pattern described in the article.<p>EDIT: some wording changes.
tomtomtom777over 4 years ago
I like the white-space: pre-line trick and very much like the omission of unnecessary &lt;html&gt; and &lt;head&gt; tags as the parsing of such valid source is neatly prescibed.<p>But abusing &lt;code&gt;, &lt;h4&gt; and &lt;h5&gt; like that is a horrendous and pointless. Please use the proper tags to keep the web clean.
throwaway4goodover 4 years ago
So instead of a body tag you have a code tag?! Is that next gen?
beefmanover 4 years ago
Is this better than my 2001 solution of wrapping everything in a &lt;pre&gt; tag?<p><a href="http:&#x2F;&#x2F;lumma.org&#x2F;microwave&#x2F;" rel="nofollow">http:&#x2F;&#x2F;lumma.org&#x2F;microwave&#x2F;</a>
评论 #25701916 未加载
评论 #25701735 未加载
andyp-kwover 4 years ago
Maybe an expert can confirm, but my understanding is that this would be poor from an SEO standpoint.<p>I don&#x27;t really see how this can be next-gen when it strips out any semantic elements.
mmackhover 4 years ago
Author here: Sorry for not considering accessibility more. I use solarize everywhere - I’ll look into fixing the low contrast issue. As for whether my approach is correct from an SEO or HTML5 validation perspective - evidently not. But I do value the feedback and will take your comments into consideration when expanding my personal site. It’s still a WIP.
评论 #25707931 未加载
评论 #25704802 未加载
评论 #25706175 未加载
hashkbover 4 years ago
&gt; No need for JavaScript or any other complicated backend or client-side frameworks. I can use PHP to introduce dynamic elements to the page, but that&#x27;s optional.<p>This isn&#x27;t the same &quot;dynamic&quot; - the author must know that JS can provide interaction without a page refresh; PHP (alone) cannot.
codingdaveover 4 years ago
Excellent performance, sketchy accessibility. But I applaud the effort to look for simplicity, even if it wouldn&#x27;t work for many production use cases.
MoOmerover 4 years ago
This was my experience...<p>1. Read first sentence,<p><pre><code> Take a look at the source code of this page - I rely mostly on CSS for the rendering of this article. </code></pre> 2. Right click, &quot;View Page Source&quot; on Firefox (`84.0.2 (64-)bit)`)<p><pre><code> Edit: adding that I do have `NoScript 11.1.8` and `uBlock origin 1.32.4` installed. </code></pre> 3. Close source pop-up&#x2F;tab.<p>4. It takes ~10 seconds to re-render the page (with spinner gif running, in the meanwhile).<p>5. Tab completely frozen.
john-doeover 4 years ago
If you&#x27;re into the monospace look, .txt is cool too.
评论 #25703846 未加载
评论 #25703755 未加载
komeover 4 years ago
it&#x27;s like a, messy, non-standard semantic web... at this point, and i&#x27;m totally serious, why not starting again to work on XHTML 2.0 standard? We need it badly.
Enneaover 4 years ago
That &lt;date&gt; tag you are using does not exist in the specs. You may want to change that to &lt;time&gt;.
meiselover 4 years ago
Agree that static blogging is nice, but I think this specific look needs some tweaking - for example, there&#x27;s too low contrast in color between the links and the background at <a href="https:&#x2F;&#x2F;inoads.com&#x2F;blog" rel="nofollow">https:&#x2F;&#x2F;inoads.com&#x2F;blog</a>
评论 #25701803 未加载
评论 #25701869 未加载
timwisover 4 years ago
Wow, never heard of that CSS property — cool!<p>Regarding medium, I think the biggest barrier is the network&#x2F;promotion you get from medium. Discovery and sharing within the network brings audiences you&#x27;d otherwise have to work quite hard for on your own site.
评论 #25701509 未加载
评论 #25701483 未加载
Brajeshwarover 4 years ago
Cool. Go one step further and render the CSS inline.<p>Of late, I have been writing with just MarkDown and dropping in some of the simplest tool (Pandoc, Jekyll) possible to render as HTML.
评论 #25701783 未加载
swyxover 4 years ago
Anyone else found the color contrast absolutely terrible to read? i suspected this and then ran a lighthouse check and.. yup. contrast check fail. you can also use <a href="https:&#x2F;&#x2F;color.a11y.com&#x2F;Contrast&#x2F;" rel="nofollow">https:&#x2F;&#x2F;color.a11y.com&#x2F;Contrast&#x2F;</a><p>There&#x27;s no point pontificating about the next generation of static blogging when you forget the basics - make the writing easy to read.
thotsBgoneover 4 years ago
&gt; The experience to writing this blog entry is very similar to using a dedicated word processor<p>Except for the fact that a word processor does more than break lines. For example, when you type &quot;, your word processor will convert this to a left opening quote or a right closing quote based on context. But the &quot; in this article are still &quot;. I guess they could have used a word processor after all.
xwdvover 4 years ago
This is ridiculous, only two articles on this blog and one is about static blogging.<p>In the next generation, I implore people to focus on <i>content</i>, not the tech.
评论 #25702480 未加载
bndwover 4 years ago
Running this site through an HTML validator generates quite a few errors.<p><a href="https:&#x2F;&#x2F;validator.w3.org&#x2F;nu&#x2F;?doc=https%3A%2F%2Finoads.com%2Farticles%2F2020-01-09-Next-Gen-Static-Blogging" rel="nofollow">https:&#x2F;&#x2F;validator.w3.org&#x2F;nu&#x2F;?doc=https%3A%2F%2Finoads.com%2F...</a>
sradmanover 4 years ago
<p><pre><code> &lt;body style=&quot;white-space: pre-line&quot;&gt; The idea is that an extra newline within a block with style=&quot;white-space: pre-line&quot; acts like &amp;lt;p&amp;gt; paragraph elements. This is a separate paragraph. &lt;&#x2F;body&gt;</code></pre>
ricardolopesover 4 years ago
Interesting concept. This seems to simplify the writing part. What about the rest? Is the list of posts generated automatically (if so, how?), or does it require manual management? Do you need the code tag, or could it be something more semantically relevant, such as article?
评论 #25702116 未加载
评论 #25701717 未加载
arvindamirtaaover 4 years ago
A neat little css property aside, isn&#x27;t the separation of concerns a cornerstone of web pages?<p>Html - structure of the document CSS - appearance JS - interactivity<p>I could be wrong, but that&#x27;s how I remember it. Is there an advantage to moving away from this fairly simple and unambiguous paradigm?
评论 #25701724 未加载
评论 #25702836 未加载
评论 #25701853 未加载
toddmoreyover 4 years ago
Build setups can get complicated and simple sites can send way to much javascript to the browser. But neither one of these are required outcomes.<p>I think it&#x27;s ok to have build tools that do small automations to make writing more pleasant yet keep the markup semantic and accessible.
akkartikover 4 years ago
<a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;CSS&#x2F;white-space#browser_compatibility" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;CSS&#x2F;white-space...</a>
egeozcanover 4 years ago
If I&#x27;m understanding correctly, here, the semantic value of the &lt;code &#x2F;&gt; element is ignored to increase DX.<p>I personally wouldn&#x27;t make that compromise, why is pre-processing not simple enough?
评论 #25703815 未加载
评论 #25701658 未加载
teekertover 4 years ago
Yeah if browsers would just render markdown nicely that&#x27;d be great.
herokuover 4 years ago
I&#x27;ve built the simplest static site generator. <a href="https:&#x2F;&#x2F;github.com&#x2F;eguneys&#x2F;jener" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;eguneys&#x2F;jener</a>
Ryan_Gooslingover 4 years ago
So I&#x27;m guessing this isn&#x27;t accessible for screen readers?
chinathrowover 4 years ago
I think you have the year off by one (2020) on your datestamp.
评论 #25702870 未加载
thayneover 4 years ago
So how would you do a code snippet with syntax highlighting?
varajelleover 4 years ago
What I think is missing for static blogs are comments.
评论 #25706873 未加载
评论 #25703448 未加载
ms123over 4 years ago
I&#x27;ve been using this technique on midnight.pub as well, and it&#x27;s working surprisingly well.
lrossiover 4 years ago
Even simpler: serve txt files. Browsers display them just fine.
chiefalchemistover 4 years ago
How does this play with Assistive Technology?
Tomteover 4 years ago
It is a neat idea, but the purist in me misses those &lt;p&gt; tags, even though they are the main reason why I don&#x27;t like writing HTML by hand.
评论 #25701539 未加载
demifiendover 4 years ago
I&#x27;m glad I&#x27;m not so blind that I need a screenreader for this site, because @mmackh doesn&#x27;t seem to have given any consideration to accessibility.<p><a href="https:&#x2F;&#x2F;wave.webaim.org&#x2F;report#&#x2F;https:&#x2F;&#x2F;inoads.com&#x2F;articles&#x2F;2020-01-09-Next-Gen-Static-Blogging" rel="nofollow">https:&#x2F;&#x2F;wave.webaim.org&#x2F;report#&#x2F;https:&#x2F;&#x2F;inoads.com&#x2F;articles&#x2F;...</a><p>If this is &quot;next gen&quot;, I think I&#x27;ll stick to using emmet-mode in Emacs to write raw HTML, templating with m4 macros, validating with tidy, and doing the build and deployment with a makefile.
评论 #25703376 未加载
评论 #25703669 未加载
评论 #25704016 未加载