编辑器生成静态网页_不使用静态网站生成器的7个理由

news/2024/5/20 1:33:03/文章来源:https://blog.csdn.net/culi3118/article/details/108382407

编辑器生成静态网页



Trending posts on SitePoint today:

今天在SitePoint上的热门帖子:

  • 7 Ways to Make WordPress Simpler for Users

    为用户简化WordPress的7种方法

  • I Need a Website. What Do I Need to Know About Hosting?

    我需要一个网站。 关于托管我需要了解什么?

  • WordPress Version Control with Git

    使用Git的WordPress版本控制

  • 10 Easy WordPress Security Tips

    10个简单的WordPress安全提示

  • What Is the Right Image Format for Your Website?

    什么是您网站的正确图像格式?



In my previous article we discussed reasons why you could benefit from using a static site generator. To recap:

在上一篇文章中,我们讨论了为什么可以从使用静态网站生成器中受益的原因。 回顾一下:

  • A static site is a collection of pages contained in basic HTML files. You could hand-write these in a text editor, but managing assets and repeated elements such as navigation can become problematic.

    静态站点是基本HTML文件中包含的页面的集合。 您可以在文本编辑器中手写这些内容,但是管理资产和诸如导航之类的重复元素可能会出现问题。

  • A content management system (CMS) stores page content in a database and provides facilities to edit and apply themes. Management becomes easier at the expense of flexibility, performance, server requirements, security and backups.

    内容管理系统 (CMS)将页面内容存储在数据库中,并提供了编辑和应用主题的工具。 以灵活性,性能,服务器要求,安全性和备份为代价,管理变得更加容易。

  • A static site generator (SSG) is a compromise between using a hand-coded static site and a full CMS. You generate an HTML-only website using raw data (such as Markdown files) and templates. The resulting build is transferred to your live server.

    静态站点生成器 (SSG)是使用手动编码的静态站点和完整CMS之间的折衷方案。 您使用原始数据(例如Markdown文件)和模板生成仅HTML的网站。 生成的构建将传输到您的实时服务器。

static site generators

Popular static site generators include Jekyll, Pelican, Hugo and Metalsmith — see StaticGen for many more options.

流行的静态站点生成器包括Jekyll , Pelican , Hugo和Metalsmith-有关更多选项,请参见StaticGen 。

SSGs appear to offer the benefits of both CMS and static worlds, but they will not be suitable for every project …

SSG似乎可以同时提供CMS和静态世界的好处,但是它们并不适合每个项目……

1.你自己动手 (1. You’re On Your Own)

You won’t get far using a static site generator without some development expertise. The process is more difficult than using a CMS, there are fewer reference resources, and you could struggle to find pre-built plugins and templates.

如果没有一些开发专业知识,使用静态站点生成器将无济于事。 该过程比使用CMS更加困难,参考资源更少,并且您可能很难找到预构建的插件和模板。

Contrast that with WordPress. A non-technical user may require installation assistance but, once done, they can edit a site and install one of the many thousands of themes and plugins available. They may not have the best bespoke website, but they’re running with minimal intervention.

与WordPress对比。 非技术用户可能需要安装帮助,但是一旦完成,他们就可以编辑站点并安装可用的数千个主题和插件之一。 他们可能没有最好的定制网站,但运行时干预最少。

2.选择麻痹 (2. Choice Paralysis)

There are many static site generators, but even the most popular tools are used by a tiny proportion of the web community. You’ll need time to research, investigate and evaluate the options. The undisputed champion is Jekyll but, while you don’t necessarily require Ruby expertise, it will help if you’ve used the language before.

静态站点生成器很多,但即使是最流行的工具,也很少被Web社区使用。 您将需要时间来研究,调查和评估这些选项。 毫无疑问,冠军是Jekyll,但是虽然您不一定需要Ruby专业知识,但是如果您以前使用过该语言,它将有所帮助。

There are many CMSs, but there’s one obvious choice: WordPress. It powers more than one in every four websites, so help is abundant. Again, it will help if you have some PHP experience, but even a non-developer can create a reasonable website using off-the-shelf themes and plugins.

CMS众多,但有一个显而易见的选择: WordPress 。 它每四个网站中就有一个以上,因此帮助非常丰富。 同样,如果您有一定PHP经验,它也会有所帮助,但是即使是非开发人员也可以使用现成的主题和插件来创建一个合理的网站。

3.初始设置时间 (3. The Initial Setup Time)

Creating your first static site will take time. You’ll need to learn the build process, and much of the template code will need to be developed. Deployment scripts may also be necessary.

创建您的第一个静态站点将需要一些时间。 您将需要学习构建过程,并且将需要开发许多模板代码。 部署脚本也可能是必需的。

Developing a custom CMS theme can also be complicated, but pre-built templates are available and assistance is easier to find. File deployment is rarely required following the initial installation.

开发自定义CMS主题也可能很复杂,但是可以使用预构建的模板,并且更容易找到帮助。 初始安装后很少需要文件部署。

4.没有管理界面 (4. No Administration Interface)

Clients may be cautious when faced with a CMS interface. Asking them to create and edit a set of Markdown files may terrify many. You can make the process easier. For example:

面对CMS界面时,客户端可能会很谨慎。 要求他们创建和编辑一组Markdown文件可能会使许多人感到恐惧。 您可以使过程更容易。 例如:

  1. allow them to use their existing CMS, or

    允许他们使用现有的CMS,或者
  2. provide simpler workflows such as editing Dropbox files in StackEdit.

    提供更简单的工作流程,例如在StackEdit中编辑Dropbox文件。

But this will further impact your initial development time.

但这将进一步影响您的初始开发时间。

5.网站一致性 (5. Website Consistency)

Static sites are flexible: anything contained within source Markdown files can be rendered as page content. Users may be able to include scripts, widgets or numerous undesired items.

静态站点非常灵活:源Markdown文件中包含的所有内容都可以呈现为页面内容。 用户可能可以包括脚本,小部件或许多不希望的项目。

A CMS constrains the user, because content is normally bound to a database with specific fields. Control panels prompt the user so it’s obvious they must enter a title, body content, excerpt etc. Even if the user enters something in an unexpected field, it won’t appear on the website unless it’s implemented within the theme template.

CMS限制了用户,因为内容通常绑定到具有特定字段的数据库。 控制面板会提示用户,因此很明显他们必须输入标题,正文内容,摘录等。即使用户在意外字段中输入内容,除非在主题模板中实现,否则该内容也不会出现在网站上。

6.管理大型站点 (6. Managing Large Sites)

Consider a website with thousands of pages, regular publications, real-time breaking news and dozens of authors in multiple locations. SitePoint is a great example. It would be possible to manage content using a static site generator, but:

考虑一个拥有成千上万个页面,常规出版物,实时突发新闻以及多个位置的数十位作者的网站。 SitePoint是一个很好的例子。 可以使用静态站点生成器来管理内容,但是:

  • content editing and publishing is more awkward. Editors may require access to the Git repo or shared folders rather than a simple web or app interface.

    内容编辑和发布比较麻烦。 编辑者可能需要访问Git存储库或共享文件夹,而不是简单的Web或应用程序界面。
  • real-time updates would be delayed because the site must be rebuilt, tested and deployed

    由于必须重新构建,测试和部署站点,因此实时更新将被延迟
  • build times could increase rapidly and deployment would become cumbersome.

    构建时间可能会Swift增加,并且部署会变得很麻烦。

Static site generators are perhaps best suited to sites containing no more than a few hundred pages with a couple of new posts every week. Automated build and deploy processes will be required, and you may reach a point where a CMS becomes a more practical option.

静态网站生成器也许最适合每周访问几篇新文章的页面不超过几百页的网站。 将需要自动化的构建和部署过程,并且您可能会达到使CMS成为更实用的选择的地步。

7.具有服务器端功能的站点 (7. Sites with Server-side Functionality)

A true static site cannot offer interactive facilities such as user logins, form filling, search or discussion forums. There are some client-side options such as lunr.js search and Disqus commenting, but your choices will be more limited.

真正的静态站点不能提供交互式功能,例如用户登录,表单填写,搜索或论坛。 有一些客户端选项,例如lunr.js搜索和Disqus评论 ,但您的选择将受到更多限制。

There are solutions such as using a build step which generates a static site containing necessary <?php ... ?> code blocks. This should pre-render HTML where possible, e.g. navigation, includes, partials, etc. to ensure pages are more efficient and require less effort from the PHP processor. Unfortunately, you’re increasing the build complexity, and it may be of little benefit to some frameworks.

有一些解决方案,例如使用构建步骤来生成包含必要的<?php ... ?>代码块的静态站点。 这应该在可能的情况下预渲染HTML,例如导航,包含,部分等,以确保页面更高效,并且需要PHP处理器花费更少的精力。 不幸的是,您正在增加构建的复杂性,这对某些框架可能没有什么好处。

静态网站适合您吗? (Is a Static Site Right For You?)

Before making any decision, examine:

在做出任何决定之前,请检查:

  • your project requirements, size, complexity, etc.

    您的项目要求,规模,复杂程度等。
  • your userbase

    您的用户群
  • your team’s development skills, and

    您团队的开发技能,以及
  • the hosting and/or deployment factors.

    托管和/或部署因素。

The vast majority of websites rarely exceed a few dozen pages, receive infrequent updates and depend on a developer to make those changes. A CMS is often overkill, and static site generation could ease development and reduce costs. However, persuading your client to abandon their CMS administration panels could be a tougher task …

绝大多数网站很少超过几十个页面,很少收到更新,并且依赖开发人员进行这些更改。 CMS通常是多余的,静态站点生成可以简化开发并降低成本。 但是,说服您的客户放弃其CMS管理面板可能是一项艰巨的任务……

For a practical demonstration of how to build a site with a static site generator, see my How to Create a Static Site with Metalsmith article.

有关如何使用静态网站生成器构建网站的实际演示,请参阅我的如何使用Metalsmith创建静态网站 。

翻译自: https://www.sitepoint.com/7-reasons-not-use-static-site-generator/

编辑器生成静态网页

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.luyixian.cn/news_show_785175.aspx

如若内容造成侵权/违法违规/事实不符,请联系dt猫网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

wordpress插件_审查的顶级WordPress SEO插件

wordpress插件WordPress provides great native SEO features, so might your theme. However, by using a dedicated SEO plugin (and knowing how to use it) we can further optimize our site. In this article we compare the top SEO plugins for WordPress side-by-side…

如何安装和使用WP-CLI来管理WordPress网站

Speeding up your work process should be one of your top priorities. Simply put, if you do more work in less time, then you will have more time to work on more projects, study and rest. 加快工作流程应该是您的首要任务之一。 简而言之&#xff0c;如果您用更少的…

wordpress快速建站_快速提示:使用WordPress联络表7增强选择加入

wordpress快速建站You might have heard the saying, “the money is in the list”. Your email list, to be exact. Email marketing is widely considered to be the most powerful form of marketing today, and there are plenty of stats to back it up. 您可能已经听说过…

php网站功能块学习_学习PHP 7,了解新功能等

php网站功能块学习PHP 7, the next version of the world’s most popular programming language, has been released. We’d love to shoot fireworks and get drunk with our newfound power (seriously, the language is in the true big leagues now, functionality and pe…

wordpress网站迁移_如何将您的WordPress网站迁移到新的托管服务提供商

wordpress网站迁移This article is part of a series created in partnership with SiteGround. Thank you for supporting the partners who make SitePoint possible. 本文是与SiteGround合作创建的系列文章的一部分。 感谢您支持使SitePoint成为可能的合作伙伴。 We’ve be…

wordpress 静态化_地理定位WordPress内容以个性化您的网站

wordpress 静态化So what does that phrase mean, “Geo-Targeting WordPress Content”? First, let’s back up and look at an example of personalization. 那么&#xff0c;这句话是什么意思&#xff0c;“以地理定位的WordPress内容”&#xff1f; 首先&#xff0c;让我…

next主题seo优化_SEO可见性的5个最佳WordPress主题

next主题seo优化This article is part of a series created in partnership with SiteGround. Thank you for supporting the partners who make SitePoint possible. 本文是与SiteGround合作创建的系列文章的一部分。 感谢您支持使SitePoint成为可能的合作伙伴。 Theme selec…

cloudflare_使用Cloudflare使您的网站更快,更安全

cloudflareCloudflare is an industry leader in the content-delivery space, reducing load and speeding up millions of websites. Cloudflare是内容交付领域的行业领导者&#xff0c;可减轻负载并加快数百万个网站的速度。 What is peculiar about this provider is that…

六个最受欢迎的 CMS 建站系统,不容错过|Gitee项目推荐

CMS 是 Content Management System 的缩写&#xff0c;意为"内容管理系统"。 内容管理系统是企业信息化建设和电子政务的新宠&#xff0c;也是一个相对较新的市场。对于内容管理&#xff0c;业界还没有一个统一的定义&#xff0c;不同的机构有不同的理解。CMS 在各行…

html 相对路径 网站根目录,html中的绝对路径URL和相对路径URL及子目录、父目录、根目录...

绝对URL用于表示Internet中特定文件所需要的全部内容&#xff0c;Internet中的每一个文件都有一个唯一的URL&#xff0c;这就是在网页中搜索时需要输入到地址栏的连接。例如&#xff0c;要进入百度一下的网页&#xff0c;则在网页地址栏中输入&#xff1a;即可。一旦进入到某个…

php网站整合ck播放器,网页视频播放器-ckplayer 整合到wordpress

在这里我将教大家怎样将这款播放器整合到wordpress中来&#xff0c;并教大家怎么将优酷视频用到这款播放器上面!第一步&#xff1a;我们要下载一个播放器文件第二步&#xff1a;将下载文件解压出来&#xff0c;打开里面player文件夹下ckplayer.txt文本文档&#xff0c;将里面的…

【最新】某素材网站上的虎年高质量海报素材合集,附带源文件和预览图

原格式PSD提供给大家同时提供jpg预览图&#xff0c;马上过年了&#xff0c;这套素材用的上&#xff0c;红色喜庆 醉了&#xff0c;本来想整理的上传的&#xff0c;但是发现有水印&#xff0c;现在水印已经全部去除&#xff0c;放心食用&#xff0c;每个图都比较大&#xff0c;一…

使用SSM重新开发计科院网站

一、游览 在游览器地址栏输入&#xff1a;http://localhost:8080/index&#xff0c;即访问计科院首页&#xff0c;由于前期对数据库以及JavaBean的设计考虑不够充分&#xff0c;导致后期的代码臃肿&#xff0c;所以项目启动时对首页进行数据的填充难以实现&#xff0c;必须输入…

airpods固件更新方法_AirPods Pro 固件更新,空间音频来了丨 网站证书更新

09/15 网站证书更新 证书已上传,网站福利应用正在更新中…… 福利区已修复完毕,不知道能活多久! 证书已经上传(回复 证书 获取证书下载链接),证书使用教程查看历史文章 【福利升级】iOS苹果端免越狱 手机端签名神器教程来了! 删掉之前的APP再重新下载即可! 证书很不稳…

java程序员语录_「java程序员面试题」2018java程序员面试题整理 - seo实验室

java程序员面试题1.PathVariable注解和requestParam注解的区别。RequestParam注解是获取静态URL传入的参数PathVariable是获取请求路径中的变量作为参数/需要和RequestMAPPing("item/{itemId}") 配合使用2.Param注解和RequestParam注解的区别。Parm 指定request中必…

java webshell_网站漏洞测试 关于webshell木马后门检测

前段时间我们SINE安全收到客户的渗透测试服务委托,在这之前,客户网站受到攻击,数据被篡改,要求我们对网站进行全面的渗透测试,包括漏洞的检测与测试,逻辑漏洞.垂直水平越权漏洞,文件上传漏洞.等等服务项目,在进行安全测试之前,我们对客户的网站大体的了解了一下,整个平台网站,包…

java摄影网站源码_基于jsp的摄影网站-JavaEE实现摄影网站 - java项目源码

基于jspservletpojomysql实现一个javaee/javaweb的摄影网站, 该项目可用各类java课程设计大作业中, 摄影网站的系统架构分为前后台两部分, 最终实现在线上进行摄影网站各项功能,实现了诸如用户管理, 登录注册, 权限管理等功能, 并实现对各类摄影网站相关的实体进行管理。该摄影…

scrapy入门实战-爬取代理网站

相关视频&#xff1a; Python之scrapy入门_哔哩哔哩_bilibili 转&#xff1a;scrapy入门实战-爬取代理网站 - JayMu - 博客园 入门scrapy。 学习了有这几点 1.如何使用scrapy框架对网站进行爬虫&#xff1b; 2.如何对网页源代码使用xpath进行解析&#xff1b; 3.如何书写…

逆向路上强大的在线网站

在线 arm汇编 转 hex进制 优秀网站推荐&#xff1a; https://armconverter.com/ 算法之美编码算法 &#xff1a; https://gchq.github.io/CyberChef/ 不想写代码可以用该网站生成&#xff1a;&#xff08;圈内人开发的&#xff09; https://www.spidertools.cn/#/formatHeader…

总裁导航v2.5.1修复版秒收录网站模板源码指定定时收录导航站

总裁导航系统&#xff0c;一款多功能的php导航系统&#xff0c;不仅仅支持自助申请收录&#xff0c;并且还支持自助购买广告 还有很多功能&#xff01; 1.新增加前台用户自助购买广告功能 2.新增加自动审核功能 3.自动定时提交百度收录&#xff01; 环境要求&#xff1a;PHP7.…