poole漏洞怎么修复_用Poole在5分钟内建立一个Jekyll博客

poole漏洞怎么修复

In recent times, there has been something of a swing away from complex, database-driven websites, back towards simpler, more static sites—where feasible, of course, such as with a simple portfolio site or blog.

近年来,从复杂的,数据库驱动的网站逐渐转向更简单,更静态的网站-当然,在可行的情况下,例如使用简单的投资组合网站或博客。

This isn't to say that people are returning to the .html sites of yesteryear, though. You still want to be able to manage templates and site-wide code efficiently, and that's where static site generators come in.

但这并不是说人们正在回到过去的.html网站。 您仍然希望能够高效地管理模板和站点范围内的代码,这就是静态站点生成器的用武之地。

Static site generators are designed to take your various static files and turn them into a website. There are lots and lots of them to choose from, and there are recent articles about them here on SitePoint, covering the different languages they come in, Node-based options, their potential advantages over WordPress, and even how to roll your own with Grunt.

静态网站生成器旨在获取您的各种静态文件,并将其转换为网站。 有很多很多他们的选择,并且这里还有关于SitePoint最近关于他们的文章,覆盖了不同的语言 ,他们进来, 基于节点的选择 ,他们的潜力在WordPress的优势 ,甚至如何推出自己与格朗特

In this article, we'll look at Jekyll, one of the most popular and widely used. I’ll describe how you can build a blog, with minimal coding, and then host it for free on GitHub Pages. We'll also make use of Poole, a kind of framework—or "foundational setup"—for building Jekyll sites.

在本文中,我们将介绍最流行和使用最广泛的工具之一Jekyll。 我将介绍如何以最少的代码构建博客,然后将其免费托管GitHub Pages上 。 我们还将利用Poole (一种框架或“基础设置”)来构建Jekyll网站。

简而言之Jekyll (Jekyll in a Nutshell)

Jekyll is written in Ruby. It's installed on your computer as a Ruby gem. It's not a CMS, it's not blogging software, it doesn't come with templates, content and so on. It's much simpler than that. Think of it as a simple program that provides handy ways to process your files.

Jekyll用Ruby编写。 它作为Ruby gem安装在您的计算机上。 它不是CMS,不是博客软件,没有模板,内容等。 比这简单得多。 可以将其视为一个简单的程序,它提供了处理文件的便捷方法。

Once Jekyll is installed, you can put it to work from the command line. It can do things like process Markdown, and because it generates a static site, you can easily view progress locally, and host your site on a static web server like GitHub Pages.

安装Jekyll后,您可以从命令行开始使用它。 它可以执行诸如Markdown处理之类的事情,并且由于它生成静态站点,因此您可以轻松地在本地查看进度,并将站点托管在静态Web服务器(如GitHub Pages)上。

安装Jekyll (Installing Jekyll)

First you need to install Jekyll on your system. For Mac, run the following command in terminal to install Jekyll:

首先,您需要在系统上安装Jekyll。 对于Mac,在终端中运行以下命令来安装Jekyll:

$ gem install jekyll

This will automatically install all of Jekyll’s gem dependencies. If you get stuck during installation, check out the troubleshooting page on Jekyll’s official website or file an issue on GitHub.

这将自动安装Jekyll的所有gem依赖项。 如果在安装过程中卡住,请查看Jekyll官方网站上的故障排除页面 ,或在GitHub上提交问题

While Jekyll is not officially supported on Windows, you can still run it with some tweaks. Please refer to Jekyll on Windows page on Jekyll website or to this guide by Julian Thilo.

虽然Windows上不正式支持Jekyll,但是您仍然可以通过一些调整来运行它。 请参阅Jekyll网站上Windows页面上的Jekyll或Julian Thilo的本指南

获取Poole和您的第一台服务器 (Getting Poole and Your First Server)

Instead of starting with a raw Jekyll theme, let's use Poole. It was created by Mark Otto, and this is how he describes it:

让我们使用Poole,而不是从原始的Jekyll主题开始。 它是由马克·奥托(Mark Otto)创建的,这就是他的描述方式:

Poole is the butler for Jekyll, the static site generator. It's designed and developed by @mdo to provide a clear and concise foundational setup for any Jekyll site. It does so by furnishing a full vanilla Jekyll install with example templates, pages, posts, and styles.

普尔是静态站点生成器Jekyll的管家。 它由@mdo设计和开发,可以为任何Jekyll网站提供清晰简洁的基础设置。 它通过为完整的Vantage Jekyll安装提供示例模板,页面,帖子和样式来实现。

You can see the basic version here. Although it's very good for a minimal blog, I like the two themes built on top of it more: Hyde and Lanyon. Let's use Hyde for building our demo blog.

您可以在此处看到基本版本。 尽管对于一个最小的博客来说这非常好,但是我更喜欢基于它的两个主题: HydeLanyon 。 让我们使用Hyde来构建我们的演示博客。

To get the setup for Hyde, go to its GitHub page and download the repository. Place it into the folder of your choice and head over to the terminal. Let's assume you keep it on your Desktop. Run following commands to move to that directory and start the server:

要获取Hyde的设置,请转到其GitHub页面并下载存储库。 将其放入您选择的文件夹中,然后转到终端。 假设您将其保留在桌面上。 运行以下命令以移至该目录并启动服务器:

$ cd Desktop/hyde-master/

$ jekyll serve

The jekyll serve command will start a development server that will allow you to preview the generated site in your browser locally.

jekyll serve命令将启动开发服务器,该服务器将允许您在浏览器中本地预览生成的站点。

To understand what I mean, open a new tab in your browser and type: http://localhost:4000. If you've followed everything properly you'll find your newly born blog there.

要理解我的意思,请在浏览器中打开一个新选项卡,然后输入: http://localhost:4000 。 如果您正确地遵循了所有步骤,则可以在此处找到您的新博客。

添加新帖子 (Adding New Posts)

The hyde-master repository you just downloaded contains many folders like _layouts, _posts and _includes. But there's just one folder you need to care about if you want to manage posts for your blog: _posts. It contains all your posts in Markdown format.

hyde-master你刚刚下载存储库包含多个文件夹一样_layouts_posts_includes 。 但是,如果要管理博客的帖子,则只需关心一个文件夹: _posts 。 它包含Markdown格式的所有帖子。

For adding a new blog post, simply place your Markdown file in the _posts folder. Make sure your Markdown files contain the following (known as YAML front matter) at the top:

要添加新的博客文章,只需将您的Markdown文件放在_posts文件夹中。 确保您的Markdown文件顶部包含以下内容(称为YAML前题 ):

---
layout: post
title: Your Post Title
---

This will tell Jekyll that you're adding a post. (Check the sample posts in the _posts folder if you have any doubts.)

这将告诉Jekyll您正在添加帖子。 (如果有任何疑问,请检查_posts文件夹中的示例帖子。)

Run jekyll serve again in your terminal and you'll find the new post in your blog if you open http://localhost:4000.

在终端中再次运行jekyll serve ,如果您打开http://localhost:4000则会在博客中找到新帖子。

To ensure proper building of your blog, Jekyll requires this naming convention:

为了确保博客的正确构建,Jekyll需要遵循以下命名约定:

YEAR-MONTH-DAY-title.MARKUP

YEAR is a four-digit number, MONTH and DAY are both two-digit numbers, and MARKUP is the file extension representing the format used in the file (in our case md). For example, your first post can be named 2015-03-29-my-first-post.md.

YEAR是一个四位数的数字, MONTHDAY都是两位数的数字,而MARKUP是表示文件中使用的格式的文件扩展名(在我们的示例中md )。 例如,您的第一条帖子可以命名为2015-03-29-my-first-post.md

发布您的博客 (Publishing Your Blog)

Once you've followed the steps above, and have added some of your own posts, you are ready to show your new blog to the world. You can post your files to many web hosts, but GitHub has made it very easy (and free!) to host a static Jekyll site via GitHub Pages. All you need to have is a GitHub account.

完成上述步骤并添加了一些自己的帖子后,您就可以向世界展示您的新博客了。 您可以将文件发布到许多Web主机上,但是GitHub使通过GitHub Pages托管静态Jekyll网站变得非常容易(免费)。 您只需要一个GitHub帐户即可。

Before pushing it to GitHub, let's make some changes:

在将其推送到GitHub之前,让我们进行一些更改:

In config.yml file:

config.yml文件中:

  • Change title, tagline, description github and author to your personal details.

    titletaglinedescription githubauthor更改为您的个人详细信息。

  • Change url to your_github_username.github.io.

    url更改为your_github_username.github.io

In CNAME, mention your_github_username.github.io instead of hyde.getpoole.com. And edit about.md to include your details.

在CNAME中,提及your_github_username.github.io而不是hyde.getpoole.com 。 并编辑about.md以包含您的详细信息。

One you've made above changes, create a repository your_github_username.github.io and move all the files from your desktop to that repository.

您已完成上述更改,请创建一个存储库your_github_username.github.io并将所有文件从您的桌面移至该存储库。

Try opening your_github_username.github.io in a browser, and you'll find your new blog there.

尝试在浏览器中打开your_github_username.github.io ,您将在其中找到新博客。

An important point to note: you'll need to know a little bit of Git to be able to add your new posts to the repository. If the command line isn't your thing, there are lots of tools—such as GitHub for Mac—that make it easy to work with Git. Either way, once you've added your posts to the repository, GitHub Pages will take care of the rest.

需要注意的重要一点 :您需要了解一点Git才能将新帖子添加到存储库中。 如果不是您的命令行,那么有很多工具(例如Mac的GitHub)可轻松使用Git。 无论哪种方式,一旦您将帖子添加到存储库,GitHub Pages都会处理其余的事情。

进一步阅读 (Further Reading)

This post was about getting you started with Jekyll, but there’s a lot that you can do if you are willing to spend some time to learn. You’ll find following resources useful for understanding Jekyll and Git a little better:

这篇文章是关于让您开始使用Jekyll的,但是,如果您愿意花一些时间来学习,可以做很多事情。 您会发现以下资源有助于更好地了解Jekyll和Git:

I hope you found this article useful. If you are trying to build a blog using the steps mentioned above and get stuck anywhere, please ask a question in the comments below. I'll be active there.

希望本文对您有所帮助。 如果您尝试使用上述步骤构建博客并陷入困境,请在下面的评论中提问。 我会在那里活跃。

翻译自: https://www.sitepoint.com/set-jekyll-blog-5-minutes-poole/

poole漏洞怎么修复

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值