帝国cms静态页生成_最好的静态网站生成器,以及何时应通过CMS选择它们

帝国cms静态页生成

by Stefanos Vardalos

由Stefanos Vardalos

最好的静态网站生成器,以及何时应通过CMS选择它们 (The best static website generators, and when you should choose them over a CMS)

Back in the day, web pages were static sites, with only HTML and CSS (and later some JavaScript). Try to remember what that actually means.

过去,网页是静态网站,只有HTML和CSS(以及后来的一些JavaScript)。 尝试记住这实际上意味着什么。

There was no server code or database. Your browser downloaded and displayed an HTML file hosted somewhere. Development was done directly in the text files, or through programs like Dreamweaver.

没有服务器代码或数据库。 您的浏览器下载并显示了某个位置托管HTML文件。 开发可以直接在文本文件中完成,也可以通过Dreamweaver之类的程序完成。

Web development finally gained pace and, up to now, it hasn’t stopped speeding up. At some point, the notion of the Content Management System (CMS) emerged. Then, new ways of developing portals, blogs and marketing sites grew and prospered. They still do, with WordPress being the leading CMS choice right now.

Web开发终于有了发展,直到现在,它还没有停止加速。 在某个时候,出现了内容管理系统(CMS)的概念。 然后,开发门户,博客和营销站点的新方法得到了发展和繁荣。 他们仍然这样做,WordPress现在是CMS的首选。

A CMS can solve many problems, both from the point of view of the developer or the administrator. But there are some reasons not to use one of them and return to an old, old friend.

从开发人员或管理员的角度来看,CMS都可以解决许多问题。 但是,出于某些原因,您使用其中之一, 而是回到了一位老朋友。

Selecting a CMS for a specific project will need tight specifications and dependencies. A typical WordPress installation will need a web server like Apache, PHP with various extensions and MySQL database. All these must be updated and maintained. But, in certain situations, these procedures can even cause more problems.

为特定项目选择CMS将需要严格的规范和依赖性。 典型的WordPress安装将需要Web服务器,例如Apache,具有各种扩展名PHP和MySQL数据库。 所有这些都必须更新和维护。 但是,在某些情况下,这些过程甚至可能导致更多问题。

One of the most important factors for web development today is security. That, unfortunately, is one of the most important downsides of CMS’s. Using a CMS is like making yourself vulnerable to cyber attacks. The number of vulnerabilities you open yourself to increases with the plugins you install and use. (Plugins being the real reason to use a CMS in the first place.)

今天,Web开发最重要的因素之一就是安全性。 不幸的是,这是CMS最重要的缺点之一。 使用CMS就像使自己容易受到网络攻击。 安装和使用的插件会增加您打开的漏洞数量。 (首先是使用CMS的真正原因。)

Apart from security, another important factor of a modern project is performance. A CMS generates the page the user requested from scratch or uses a built-in or installable plugin. The cache system ensures the reuse of a pre-generated page whenever possible. Using some type of cache system can help a lot, but it may add quite some overhead.

除了安全性,现代项目的另一个重要因素是性能。 CMS会从头开始生成用户请求的页面,或者使用内置或可安装的插件。 高速缓存系统确保尽可能重用预先生成的页面。 使用某种类型的缓存系统可以有很大帮助,但可能会增加一些开销。

So by creating a static site, these problems become obsolete. A static site consists only of, as the name suggests, static files. Like some HTML and CSS files, and little bit of JavaScript.

因此,通过创建静态站点,这些问题就变得过时了。 顾名思义,静态站点仅包含静态文件。 像一些HTML和CSS文件,以及少量JavaScript。

There are no specific requirements for the type of the machine that will host the page, no back-end language restriction and no need for a database. As static files served to the browser, there are no actual vulnerabilities.

对于托管页面的计算机的类型没有特定要求,没有后端语言限制,也不需要数据库。 由于将静态文件提供给浏览器,因此没有实际漏洞。

The actual pages are already generated and maybe minified. From performance point of view, they seem to be a lot better than any CMS-cached solution.

实际页面已经生成并且可能已缩小。 从性能的角度来看,它们似乎比任何CMS缓存解决方案都要好得多。

More so, modern static site generators typically read from flat-type files, like Markdown. The post content resides in files, instead of a database, so you can put them under your Git workflow.

更重要的是,现代静态站点生成器通常从诸如Markdown之类的平面文件中读取。 帖子内容驻留在文件中,而不是数据库中,因此您可以将它们放在Git工作流程下。

But static sites have some disadvantages, too. You are basically ditching the back-end of the web. Most importantly, you lose interactivity with the user — things like user profiles, favorites, and suggested reads. There are ways to add a couple of these features — like commenting through the Disqus platform — but these are not optimal.

但是静态站点也有一些缺点。 您基本上是在抛弃网络的后端。 最重要的是,您与用户失去了互动性,例如用户个人资料,收藏夹和建议阅读内容。 有多种方法可以添加其中的一些功能(例如通过Disqus平台进行评论),但这并不是最佳选择。

The biggest feature missing from these generators is the lack of an administrative UI. (Although it’s a fair guess that there will be a solution for this at some point.) Some more technical people might not find it as difficult to create new files in proper folders and link assets as images. But for the most part, nontechnical content creators may find the lack of an admin UI to be a living hell.

这些生成器缺少的最大功能是缺少管理UI。 (尽管可以合理地猜测在某个时候会找到解决方案。)更多的技术人员可能并不觉得很难在适当的文件夹中创建新文件并将资源链接为图像。 但是在大多数情况下,非技术性内容创建者可能会发现缺少管理用户界面是一个活生生的麻烦。

This is primarily a project planning decision based on its requirements. For many websites, a CMS is definitely overkill.

这主要是基于其要求的项目计划决策。 对于许多网站而言,CMS绝对是过大的。

Considering the above points, you should be able to answer whether a static website is enough for a specific project. But another problem would be the large amount of choices required and the accompanying initial setup time.

考虑到以上几点,您应该能够回答一个静态网站是否足以满足特定项目的需要。 但是另一个问题是需要大量的选择以及随之而来的初始设置时间。

In the CMS world, there are countless options, but also a winner. WordPress, as a choice, will do the job for any project. On the Static Site Generators world, there are too many options — 459 to be precise.

在CMS世界中,有无数的选择,但也是赢家。 可以选择使用WordPress完成任何项目的工作。 在“静态站点生成器”世界中,有太多选择-确切地说是459

But there is no clear winner or some way to differentiate them. It seems like it might change from now on, but it remains to be seen. Some of them have gained extensive popularity and are worth noting.

但是,没有明确的赢家或以其他方式区分他们。 从现在开始看来,它可能会发生变化,但仍有待观察。 其中一些已经广受欢迎,并且值得注意。

Jekyll is by far the most popular one of those generators. It’s built with Ruby and integrated into GitHub Pages. So, it’s quite popular for personal projects and/or documentation. It has a huge user base and a big directory of plugins.

迄今为止, 杰基尔是最受欢迎的发电机之一。 它使用Ruby构建并集成到GitHub Pages。 因此,它在个人项目和/或文档中非常受欢迎。 它拥有庞大的用户群和庞大的插件目录。

Hugo is quite like Jekyll. It’s built on Go and its main point against Jekyll is its blazing fast speed. Jekyll can be quite slow when the actual site is being generated , especially when the number of posts/pages goes up. But Hugo generates the site in a matter of seconds. There are other abstractions that make Hugo more user-friendly and easier to start with. It does not need as much configuration to create something from scratch.

雨果很像杰基尔。 它建立在Go之上,而对抗Jekyll的主要目的是其超快的速度。 当生成实际站点时,尤其是当帖子/页面数增加时,Jekyll可能会非常慢。 但是雨果仅需几秒钟即可生成该网站。 还有其他一些抽象使Hugo更加用户友好并且更容易入门。 它不需要太多配置即可从头开始创建某些内容。

Hexo is a newer addition and created with NodeJS. Advertised, and mostly used as a blog platform, it combines the extensibility of Jekyll with the speed of Hugo. (actually faster than Hugo)

Hexo是较新的功能,并使用NodeJS创建。 广告,通常用作博客平台,它结合了Jekyll的可扩展性和Hugo的速度。 (实际上比雨果快)

Wintersmith is another one built on top of NodeJS. This one is different as it is quite minimalistic. It basically is a platform that you can customize through some plugins to your needs. It definitely requires some tweaking to make it work, but leaves more space for customization.

Wintersmith是另一个基于NodeJS构建的模型。 这是不同的,因为它非常简约。 它基本上是一个平台,您可以根据需要通过一些插件进行自定义。 肯定需要进行一些调整才能使其正常运行,但会留出更多的自定义空间。

The last option is the newest and the most interesting one.

最后一个选项是最新,最有趣的一个。

Gatsby is the one framework that brings the static pages to stacks nowadays. It uses React.js and Webpack to create a SPA ( Single Page Application ) with your content. It promises to remove much of the configuration needed for such an application. Doing so, it provides the developer with an easy to use solution that will, in the end, produce a modern and high-end application. The truth is that Gatsby can be used for many other things than just a blog. Its true limit hasn’t been found yet.(As it only reached its first stable release earlier this month.)

Gatsby是如今将静态页面带入堆栈的一个框架。 它使用React.js和Webpack与您的内容一起创建SPA(单页应用程序)。 它承诺将删除此类应用程序所需的许多配置。 这样,它为开发人员提供了易于使用的解决方案,最终将产生一个现代的高端应用程序。 事实是,盖茨比不仅可以用于博客,还可以用于其他许多事情。 尚未找到其真正的极限(因为它仅在本月初才达到其第一个稳定版本)。

The fact that it uses React helps a lot as more developers are using React right now or plan to soon.

它使用React的事实对很多开发人员现在或计划很快使用React都有很大帮助。

摘要 (Summary)

Looking at the downloads from the last six months, we can see that Gatsby might be a winner in the making. Those numbers might not be 100% true. Gatsby can also be used for more complex things than markdown-to-HTML conversion. But, as its user base expands fast, we may have found the WordPress for static site generators.

查看过去六个月的下载量,我们可以发现盖茨比可能会成为赢家。 这些数字可能不是100%正确。 与Markdown到HTML转换相比,Gatsby还可以用于更复杂的事情。 但是,随着其用户群的快速扩展,我们可能已经找到了用于静态网站生成器的WordPress。

翻译自: https://www.freecodecamp.org/news/static-sites-are-back-24d01a01f11a/

帝国cms静态页生成

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值