将Jekyll(仅博客部分)添加到我的网站 [英] Adding Jekyll (only the blog portion) to my website

查看:68
本文介绍了将Jekyll(仅博客部分)添加到我的网站的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望将Jekyll(仅博客部分)添加到我现有的网站中.我目前在我的Github上有这个仓库( https://github.com/TonyHoanTrinh/TonyHoanTrinh.github.io ).我目前在哪里有图像文件夹.一个index.html,main.js和style.css文件.

I wish to add Jekyll (only the blog portion) to my already existing website. I currently have this repo on my Github (https://github.com/TonyHoanTrinh/TonyHoanTrinh.github.io). Where I currently have a folder for Images. An index.html, main.js and style.css files.

我的问题是我如何才能将Jekyll博客部分添加到已经具有布局和主题的网站中?

My question is how would I be able to add the Jekyll blog portion to my website which already has a layout and theme?

我一直在看几本Jekyll教程,但是他们从一开始就使用主题等来启动项目.我已经有一个网站,上面有我自己的布局和样式.但我希望将Jekyll博客部分添加到我的网站.我注意到有一个执行此操作的帖子,但这是从config.yml和我不确定与我的项目有关的其他文件的上下文中获得的.

I've been looking at several Jekyll tutorials but they have it start the project from the beginning using a theme and etc. I already have a website with a layout and styling from myself. But I wish to add the Jekyll blog portion to my website. I noticed an existing post on doing this but its from the context of config.yml and other files which I'm not sure pertains to my project.

推荐答案

我的问题是我如何才能将Jekyll博客部分添加到已经具有布局和主题的网站中?

My question is how would I be able to add the Jekyll blog portion to my website which already has a layout and theme?

使用Jekyll,您可以非常轻松地做到这一点.只需执行以下步骤:

With Jekyll you can do that very easily. Just follow these steps:

  1. 您可以将静态html文件保留在根目录(和子目录)中.他们不会与Jekyll相撞.
  2. 在根目录中创建一个空的_config.yml文件.
  3. 在根目录的_layouts文件夹中为您的帖子概述和单个帖子布局创建布局.
  4. 在根目录中创建_posts文件夹,并以以下格式添加您的第一个文件/博客帖子:2018-12-31-happy-new-year.md
  5. 确保博客文章(.md文件)看起来像这样:

---
title: Happy New Year
---

Your content

  1. 现在从网站根目录中的命令行运行"jekyll serve".Jekyll(如果安装正确)将使用生成的网站(以纯HTML格式)创建一个_site文件夹.

仅此而已!有关设置Jekyll的详细信息,请访问 Jekyll网站.

That is all! More info about setting up Jekyll can be found at the Jekyll website.

这篇关于将Jekyll(仅博客部分)添加到我的网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆