jekyll_博客:WordPress或Jekyll

jekyll

Disclaimer! I don’t really like writing comparisons. While I always try to stay neutral and factual, I feel like some people always feel offended and forced to nitpick or worse. So please let me remind you that this article is only intended to give a rough overview of both platforms and what you should expect from each.

免责声明! 我真的不喜欢写比较。 尽管我总是保持中立和务实,但我感觉有些人总是感到冒犯,被迫挑剔甚至更糟。 因此,请让我提醒您, 本文仅是为了概述这两个平台以及您对每个平台的期望。

So you want to create your own blog, or port your blog over, but you may not know which platform is the right fit for your needs. Of course there is a world outside of WordPress or Jekyll, but for sake of simplicity we’ll only dig down into these two.

因此,您想创建自己的博客或将博客移植过来,但是您可能不知道哪个平台最适合您的需求。 当然,在WordPressJekyll之外还有一个世界,但是为简单起见,我们仅深入探讨这两个领域。

WordPress or Jekyll

First, allow me to introduce the two:

首先,让我介绍两个:

WordPress is a free and open source blogging tool and a content management system (CMS) based on PHP and MySQL. Features include a plugin architecture and a template system. — Wikipedia – WordPress

WordPress是一个免费的开源博客工具,并且是一个基于PHP和MySQL的内容管理系统(CMS)。 功能包括插件体系结构和模板系统。 – 维基百科– WordPress

Transform your plain text into static websites and blogs. — Jekyllrb.com

将纯文本转换为静态网站和博客。 — Jekyllrb.com

Note: both platforms are fully able to power complex websites, but for the length of our article we will only focus on the blogging component.

注意:这两个平台都完全能够为复杂的网站提供支持,但是在本文中,我们将只关注博客组件。

数据存储 (Data Storage)

The first thing that really divides these platforms is the way they handle data, which in our case would be a collection of articles.

真正划分这些平台的第一件事是它们处理数据的方式,在我们的案例中,这将是文章的集合。

WordPress being a MySQL-powered CMS, everything is stored in a database. WordPress then reads from and writes to this database whenever needed, fetching existing and adding new content.

WordPress是MySQL驱动的CMS,所有内容都存储在数据库中。 然后,WordPress会在需要时读取和写入该数据库,以获取现有数据库并添加新内容。

It’s worth nothing WP stores much more than just articles. For instance, and that’s probably much more important than articles at this point, WordPress stores account credentials. To log into your dashboard and write articles, you have to type in your username and password so you can access the admin area which grants access to database.

WP存储的价值不仅仅在于文章。 例如,在这一点上,这可能比文章重要得多,WordPress存储帐户凭据。 要登录仪表板并撰写文章,您必须输入用户名和密码,以便可以访问授予数据库访问权限的管理区域。

On the other hand, Jekyll is basically a lot of files that get compiled only to build a static website. In itself, no server nor browser is able to read or serve a Jekyll site if it’s not being compiled to HTML/CSS first. So while being coded in Ruby, Jekyll actually requires absolutely no server side language or database system.

另一方面,Jekyll基本上是很多文件,这些文件仅为了构建静态网站而被编译。 如果没有首先将其编译为HTML / CSS,则服务器或浏览器本身都无法读取或提供Jekyll网站的服务。 因此,尽管使用Ruby进行编码,Jekyll实际上绝对不需要服务器端语言或数据库系统。

代管 (Hosting)

No matter what you end up choosing, hosting should concern you and have an impact on your decision. Both systems really do not work the same.

不管您最终选择什么,托管都应该使您关心并影响您的决定。 两种系统确实工作不同。

WordPress being a PHP/MySQL CMS needs to be hosted on a server that supports both PHP 5.2.4 or greater and MySQL 5.0 or greater. WordPress officially recommands Apache or Nginx. However, once everything set up on the server, you should not have to push new things now and then since everything is stored in a database.

作为PHP / MySQL CMS的WordPress必须托管在同时支持PHP 5.2.4或更高版本以及MySQL 5.0或更高版本的服务器上。 WordPress正式建议使用ApacheNginx 。 但是,一旦所有内容都在服务器上设置好了,则由于所有内容都存储在数据库中,因此您不必再不时推送新内容。

When it comes to Jekyll, I can not recommend GitHub Pages hosting enough. The thing is, GitHub Pages support Jekyll, which means it is fully compatible. When you push an uncompiled Jekyll project (which has some very specific traits) to a gh-pages branch of a GitHub Repository (public or private, it doesn’t matter), GitHub will compile it on its side and serve it.

关于Jekyll,我不建议托管足够的GitHub Pages 。 事实是,GitHub Pages支持Jekyll,这意味着它是完全兼容的。 当您将未编译的Jekyll项目(具有一些非常特殊的特征)推送到GitHub Repository的gh-pages分支 (公共或私有,无关紧要)时,GitHub会在其一侧进行编译并提供服务。

That means you don’t have to compile your project on your machine, then push to a server. You can push the uncompiled source to your repository, and leave the compilation to GitHub Pages, which will serve it.

这意味着您不必在计算机上编译项目,而后再推送到服务器。 您可以将未编译的源代码推送到您的存储库,然后将编译内容保留给GitHub Pages,后者将为您提供服务。

That also means you can update your site through GitHub directly, and use GitHub as a CMS which can be very handy when fixing typos and little things here and there. That being said, it will be much more convenient to clone, work, commit and push when your article involves images and stuff.

这也意味着您可以直接通过GitHub更新您的网站,并将GitHub用作CMS,这在修改错字和一些小地方时非常方便。 话虽如此,当您的文章涉及图像和内容时,克隆,工作,提交和推送将更加方便。

Anyway, you can also decide to compile your Jekyll project on your machine and push it to a server that is totally unrelated to GitHub but since Jekyll doesn’t rely on any database at all, and everything is just files, you’ll need to push to your server for every new article, which can be tedious.

无论如何,您还可以决定在计算机上编译Jekyll项目,并将其推送到与GitHub完全无关的服务器上,但是由于Jekyll根本不依赖任何数据库,并且所有内容都只是文件,因此您需要将每篇新文章推送到您的服务器,这可能很乏味。

写作 (Writing)

Writing an article in WordPress goes through this steps:

用WordPress撰写文章的步骤如下:

  1. Log into your WordPress dashboard with your secure credentials;

    使用安全的凭据登录到WordPress仪表板;
  2. Head into the ‘Post’ section to create a new article;

    进入“发布”部分以创建新文章;
  3. Write your post in the WordPress editor (Markdown needs a plugin);

    在WordPress编辑器中撰写您的文章(Markdown需要一个插件);
  4. Preview it through the WordPress preview system;

    通过WordPress预览系统进行预览;
  5. Publish it to make it live.

    发布它以使其生效。

Writing an article in Jekyll:

用Jekyll撰写文章:

  1. Open the uncompiled source code of your Jekyll project on your machine;

    在计算机上打开Jekyll项目的未编译源代码;
  2. Create a new file in the _posts folder;

    _posts文件夹中创建一个新文件;

  3. Write your article in Markdown;

    用Markdown写文章;
  4. Run jekyll serve to preview your article;

    运行jekyll serve预览您的文章;

  5. Then:

    然后:

    1. Push on your repository if you host through GitHub Pages;

      如果您通过GitHub Pages托管,请推送您的存储库;
    2. Run jekyll build and push on your server if you host the compiled site.

      如果托管已编译的站点,请运行jekyll build并在您的服务器上进行推送。

最后的想法 (Final Thoughts)

Now, my opinion: if you are not scared with command lines (that are usually not any longer than jekyll build) and GitHub is an option for you, Jekyll is the perfect workflow. For a tech related blog, I could not recommend this enough.

现在,我的观点是:如果您不害怕命令行(通常不比jekyll build更长),并且GitHub是您的选择,那么Jekyll是理想的工作流程。 对于与技术相关的博客,我对此建议不够。

Now if you are setting up a blog for someone who is really not that tech savvy, or want something simple ready in minutes, WordPress with a free/cheap theme is probably good enough for you.

现在,如果您要为真正不精通技术的人或希望在几分钟之内准备好简单内容的人建立博客,那么具有免费/廉价主题的WordPress对您来说可能已经足够。

What I do not like with WordPress is it uses a database, which immediately involves some security concerns (credentials, hacks, server…) and possibly slowness depending on your host and the quality of your theme. If you ask me, WordPress is quite an overkill solution for a simple personal blog.

我不喜欢WordPress的地方是它使用数据库,该数据库立即涉及一些安全问题(凭据,黑客,服务器等),并且可能会因您的主机和主题质量而导致运行缓慢。 如果您问我,WordPress对于一个简单的个人博客来说是一个过大的解决方案。

On the other hand, Jekyll can look a little scary at first but ends up being very easy and comfortable to use if you have at least some little tech-background. I like to control everything when it comes to my own sites/blogs, and that’s exactly what Jekyll allows me to do.

另一方面,Jekyll乍看起来可能有点吓人,但是如果您至少有一些技术背景,最终会非常容易使用。 我喜欢控制涉及我自己的网站/博客的所有内容,而这正是Jekyll允许我做的事情。

翻译自: https://www.sitepoint.com/blogging-wordpress-or-jekyll/

jekyll

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值