Development

What is a neat blog (from tech view)

What makes a "good" blog from a code perspective?

The operation "Firewood" manages numerous blog applications and evaluates both surface and backend functionality. Many blogs lack proper code regularity, causing issues in data crawling and processing. Essential aspects for a well-structured blog include correct RSS output, Open Graph info, sitemaps, comprehensive `<head>` data, HTTPS configuration, and mobile-friendliness. Despite these standards, good content remains paramount.

  1. #blogging
  2. #web development
  3. #SEO
  4. #RSS
  5. #Open Graph
  6. #serverless hosting

36

一双手在木桌上写字,旁边有一杯咖啡和一个羊角面包。一双手在木桌上写字,旁边有一杯咖啡和一个羊角面包。

The operation has been Firewood for half a year, handling hundreds of blog applications, so I have also seen too many independent blogs. And because of my role, I not only pay attention to the surface effects of the blogs but also look at the backend implementation.

I only realized that there are so many irregular blogs.

The term "irregular" seems to be easily misunderstood, so let me first talk about what I consider to be a "regular" blog.

Taking design as an example, suppose there are two design drafts. Their export results are exactly the same, but the source files of the designs are completely different: one with a clear layer structure and logical naming; one with layers randomly placed without hierarchy and automatically named as "frame 149" and the like. Although they look the same, I prefer the one with a clear structure.

Why do I attach importance to the code aspect of regularity?

Because the Firewood needs to crawl the data of the blog and store it as structured data. If the code is irregular, it is easy to make mistakes.

And when people talk about the standards of excellent blogs, it is often evaluated from aspects such as content, interface, etc., with few standards at the code level. Today, from the perspective of a blog directory site developer, I will talk about what kind of blog is "regular" in terms of code.

Server friendly

The most important thing about blogs is correct RSS output. It means the format is correct and can be parsed correctly by the code. The simplest way is to open it in a browser. If you see this sentence:

This XML file does not appear to have any style information associated with it. The document tree is shown below.

There is a high probability that the format is correct. If what you see is a big chunk of code tiled as plain text, then it's not quite right.

Having complete RSS content is also a standard. Titles, links, etc., are the basics, and basically, no blog will be missing these two fields. The disaster area is Description.

The role of Description is to summarize the article, which means it should not be too long. In reality, most of the blogs I have encountered are not very attentive to this field, either it is truncated, or even the entire article. My habit is to output the article subheading as the description.

Cover images are also missing in the RSS of many blogs, but it seems that the articles themselves have no cover images. But I have a habit of pairing a cover for each article, at least the browsing experience will be better.

Open Graph information is complete. When you share a link on a social platform, the platform is likely to display the link as a card with an image + title + description. The technology used here is Open Graph, which writes the cover image, title, description, and other information into the of the page, making it easier to grab information when sharing.

俯视图展示了一座位于阿坝县的寺庙,寺庙和周围建筑在干燥的山地中密集排列。用户分享了这张照片并提到有人认出了他之前拍摄的这座寺庙。俯视图展示了一座位于阿坝县的寺庙,寺庙和周围建筑在干燥的山地中密集排列。用户分享了这张照片并提到有人认出了他之前拍摄的这座寺庙。

In reality, I have encountered those who have set up Open Graph or even set different images for each article, and I always admire that in my mind.

Provide a sitemap. This is not related to me but has some connection with SEO. Providing a sitemap will make search engines index your pages faster. Google gives quite a high weight to independent blogs, and SEO is something to be noted.

Complete <head> information. Many blogs provide RSS, but do not put the link in the <head>, not like this:

这是一个HTML文件的代码截图,展示了网页的头部(head)部分,包含了元数据、链接到样式表和一些脚本文件的引用。这是一个HTML文件的代码截图,展示了网页的头部(head)部分,包含了元数据、链接到样式表和一些脚本文件的引用。

Why can some blog URLs be added directly into an RSS reader and automatically find the RSS link? This is the way.

Writing RSS, sitemap, open graph, Google search structured information, standard URLs, and other information in the <head> will make it easier for other programs to automate processing.

Do not output irrelevant RSS entries. Some blogs are self-developed and when outputting RSS, they did not exclude unwanted content, then About, link pieces, etc., are also output. I suggest RSS only outputs formal content.

Correct HTTPS configuration. This mainly occurs in bloggers who deploy servers by themselves. Sometimes certificates expire, or the configuration is incorrect.

The above is from the perspective of server crawling, here is from the visitor's perspective.

Visitor Friendly

Redirect well when changing domain names. Although I don't like people changing domain names for their blogs, considering that I will also change my domain name this year, I won't say anything. Changing domain names is acceptable, but proper redirection must be done, and there must be a transition period.

Do not add flashy animations that only you think are cool. This seems to mainly happen with student bloggers. Of course, animations are also a form of expression for the author, which I understand. But from a design perspective, do not play audio by default, and do not have too many animations that affect reading.

Mobile-friendly. If you are using a mature framework and professionally developed themes, there should be no problem with this. For self-developed blogs, you should still test more on mobile.

Don't post articles only to delete them later. I hope that when you publish an article, even if it is not well thought out, it has been considered. Do not delete it shortly after publication, and do not change the slug.

The website should respond quickly. Obviously, no one likes a website that takes forever to load.

Some suggestions

Optimizing the above standards may be a bit difficult for those who do not understand web development. Generally speaking, using common blog programs and themes handles most of the work. Only those who develop the frontend themselves - like this site - need to handle it manually.

For those technical novices, I still suggest not to tinker with servers. Serverless hosting is now very mature, and Cloudflare, Vercel, Railway, Zeabur, and many other products allow you to have a website without worrying about server maintenance.

As a pseudo full-stack, what I fear most in normal times is operation and maintenance. Except for this site that will be refactored this year, all other projects have been migrated to a serverless deployment mode.

If you do not have a technical background, it is better not to tinker with servers. A mediocre operation and maintenance level is the root cause of many websites crashing.

Regular Blog ≠ Good Blog

Although I have mentioned so many standards, I must emphasize once again: a regular blog does not equal a good blog. The core standard for a good blog is one and only one: good content.

Not everyone wants or can create serious and valuable content, many just want to share their feelings. So, I just hope that more blogs can be more regular in terms of code to facilitate program handling.