github托管静态页
by Taurus Omejia
由Taurus Omejia
Did you know that Github will allow anyone to host their static webpages for free? The best part is that you can even use your own custom domain. Let’s do this!
您是否知道Github将允许任何人免费托管其静态网页? 最好的部分是,您甚至可以使用自己的自定义域。 我们开工吧!
If you already have a website, than you can move on to step 2.
如果您已经有一个网站,则可以继续执行步骤2。
If not then today is good day to start.
如果不是这样,那么今天是开始的好日子。
I suggest starting a blog. A blog is a great way to establish a more meaningful presence online. You can leverage it to build your own personal online brand.
我建议创建一个博客。 博客是在网上建立更有意义的存在的好方法。 您可以利用它来建立自己的个人在线品牌 。
Don’t know where to start? I got you covered. John Sommez of Simpleprogrammer.com has an excellent email course called: How To Build A Blog That Will Boost Your Career. It’s a great course that walks you through the process.
不知道从哪里开始? 我让你覆盖。 Simpleprogrammer.com的John Sommez 开设了一个非常出色的电子邮件课程,名为: 如何建立博客,以促进您的职业发展 。 这是一门很棒的课程,可以引导您完成整个过程。
So you decided to start a blog. Now what? There are many ways you could go, such as Wordpress, Tumblr, or even Blogger.
因此,您决定创建一个博客。 怎么办? 您可以采用多种方式,例如Wordpress,Tumblr甚至Blogger。
But that would defeat the purpose of this article. We want to use Github Pages to host a static page for free. So I recommend using a static blog generator.
但这将违反本文的目的。 我们想使用Github Pages免费托管静态页面。 因此,我建议使用静态博客生成器。
I personally use Jekyll for my blog. Buts there are many others out there. Here’s a list of some of the more popular ones: Static Blog Generators. Choose one, read the instructions, and get your blog set up!
我个人将Jekyll用于我的博客。 但是,还有很多其他人。 以下是一些比较流行的列表: 静态博客生成器 。 选择一个,阅读说明,然后建立您的博客!
Great you made it to step 2. Now that your blog is ready, let’s put it under version control using Git. This Article assumes you have Git installed, you have a github account and can push to it.
太好了,您进入了步骤2。现在您的博客已经准备就绪,让我们使用Git将其置于版本控制之下。 本文假设您已经安装了Git ,并且拥有github帐户并且可以推送到它 。
OK! Crank up your terminal and navigate to the directory your site lives in. Its time to initialize version control by entering the command.
好! 启动您的终端并导航到站点所在的目录。输入命令初始化版本控制的时间到了。
$ git init
Now to add the entire project under git tracking. Enter:
现在,在git跟踪下添加整个项目。 输入:
$ git add .
Let’s commit it:
让我们提交:
$ git commit -m “first commit”
Your site is now under version control. Now the fun begins.
您的网站现在处于版本控制之下。 现在,乐趣开始了。
We are finally ready to push to GitHub and see our site automatically running live online for free!
我们终于准备好推送到GitHub,并看到我们的网站自动免费在线实时运行!
Launch github.com and sign in.
启动github.com并登录。
Now follow GitHub’s instruction to push your blog to your new repository.
现在按照GitHub的指示将您的博客推送到新的存储库。
That’s it! Your new page should be up at http://your-username.github.io.
而已! 您的新页面应该位于http://your-username.github.io。
If you don’t see it right away, give it a few minutes, ten at the most.
如果您看不到它,请花几分钟,最多十分钟。
That’s it! For most people this is all you need to do. However for those of you that would like to use your own custom domain continue to the final step.
而已! 对于大多数人来说,这就是您需要做的。 但是,对于那些想要使用自己的自定义域的人,请继续执行最后一步。
This will vary depending where you registered your domain. I have GoDaddy, so these instructions are specific to that. But the steps should be similar with other domain providers. Here is how I did it:
这取决于您注册域的位置。 我有GoDaddy,因此这些说明专门针对此。 但是步骤应与其他域提供程序相似。 这是我的做法:
Let me be the first to congratulate you. You have a website up and running, under version control, with your own domain name — all hosted free of charge!
让我成为第一个祝贺您的人。 您拥有一个拥有自己域名的,受版本控制的网站,并且可以免费运行所有网站!
Originally published at www.tauruso.com. To view this article in all its glory and more from Taurus Omejia, go HERE!
最初发布在www.tauruso.com。 要浏览Taurus Omejia的所有文章以及更多内容 ,请点击这里!
翻译自: https://www.freecodecamp.org/news/hosting-custom-domain-on-github-pages-8c598248d2bc/
github托管静态页