编辑器生成静态网页



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的网站。 生成的构建将传输到您的实时服务器。

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/

编辑器生成静态网页

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

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

    编辑器生成静态网页 Static site generators have become increasingly popular and, if my prediction is correct, ...

  2. 静态网页设计课程设计-周杰伦网站包含源码以及文档,可直接使用

    本网站是静态网页设计,网站设计是周杰伦网站,本人是周杰伦粉丝,所以完成的是一个周杰伦专辑和电影介绍的作品. 源码地址如下: 详细资源含网页内容源码地址静态网页设计-周杰伦网站-可用于大学课程设计和实验 ...

  3. div+css静态网页设计 电商购物网站设计(55页) 电商网页设计制作 简单静态HTML网页作品 购物网页作业成品 学生商城网站模板

    HTML5期末大作业:电商购物网站设计--电商购物网站设计(55页) 电商网页设计制作 简单静态HTML网页作品 购物网页作业成品 学生商城网站模板 文章目录 HTML5期末大作业:电商购物网站设计- ...

  4. div+css静态网页设计:三亚旅游网站设计——三亚旅游网页设计(6页) html网页设计期末大作业_网页设计平时作业

    HTML5期末大作业:三亚旅游网站设计--三亚旅游网页设计(6页) 文章目录 HTML5期末大作业:三亚旅游网站设计--三亚旅游网页设计(6页) 一.作品展示 二.文件目录 三.代码实现 四.获取更多 ...

  5. java静态网页_【屌炸天源码分享】《企业网站html静态网页模板》

    该楼层疑似违规已被系统折叠 隐藏此楼查看此楼 看完这个帖子以后,我的心久久不能平静,震撼啊!为什么会有如此好的帖子!我纵横网络bbs多年,自以为再也不会有任何帖子能打动我,没想到今天看到了如此精妙绝伦 ...

  6. node.js 静态属性_如何使用静态站点和Node.js开发和部署第一个全栈式Web应用程序

    node.js 静态属性 This tutorial will show you how to convert a static website that uses HTML, CSS and Jav ...

  7. java jsp取静态常量_获取java静态

    Android NDK开发系列教程4:对类变量进行操作 终于建了一个自己个人小站:https://huangtianyu.gitee.io,以后优先更新小站博客,欢迎进站,O(∩_∩)O~~ 通常我们 ...

  8. 极路由添加静态路由表_如何将静态TCP / IP路由添加到Windows路由表

    极路由添加静态路由表 In some specific types of environments, you might find it useful to add a static route to ...

  9. 静态原型_如何在静态,低保真和高保真原型之间做出选择

    静态原型 现代技术设计要求高度的交互性:导航栏随用户的滚动位置而变化,单击框展开以显示和隐藏支持信息,将列表拖放到重新排序等.设计人员必须考虑到所有可能的用户交互来在他们的产品中创建最简化,最直观的用 ...

最新文章

  1. git 修改仓库的描述_git简介、基本命令和仓库操作
  2. 北京大学崔斌教授组招收图机器学习、AutoML等方向科研实习生
  3. Java是否支持默认参数值?
  4. Jexus部署.Net Core项目
  5. Flink从入门到放弃之源码解析系列-第1章 Flink组件和逻辑计划
  6. 什么推动当今品牌的忠诚度
  7. javascript学习笔记 - 引用类型 Object
  8. poj 2362 Square 经典深搜
  9. 实例变量,局部变量,全局变量,静态全局变量。
  10. web-3g-163(网易)-邮箱和博客-数据架构设计
  11. Dev ChartControl 显示设置百分比
  12. python中文分词+词频统计
  13. 波动率模型以及波动率的程式化特征实证
  14. 声反馈抑制使用matlab/simulink仿真
  15. NginxProxyManager实现unraid反向代理
  16. Nature综述:未培养微生物的新兴培养技术
  17. python|图片生成视频MP4
  18. 【2016-05-09】程序员的日常:咖啡
  19. 机器人涂装工程师岗位英文缩写_公司职位及英文缩写大全
  20. 嘿嘿,我的读者拿到阿里offer,复盘他的时间轴

热门文章

  1. 联想K29昭阳K29笔记本联想K49A在dos下刷入bios教程
  2. vue中的created方法
  3. windows 2008 下C#调用office组件访问拒绝的解决方法(failed du
  4. 突破微软远程桌面帧率限制
  5. 未来已来,看北京理工大学的智慧校园如何落地
  6. 一加手机救砖资源-sahara通信失败 或者 checkHwid failed都是由于使用错了救砖包
  7. android metal api,Metal入门002-Metal相关API
  8. 读书是一种修养 ——《大河奔流的精神》(俞敏洪著)读后感
  9. (已更新)最新打卡抽奖助手小程序源码,带微信通知功能,去授权
  10. bootmgr快速修复win7_win7 iso镜像下载(Win7安装版_非GHOST ISO镜像)