Adding Jekyll (only the blog portion) to my website

前提是你 提交于 2021-01-05 04:20:03

问题


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.

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

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.


回答1:


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

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

  1. You can leave the static html files in the root (and subdirectories). They will not collide with Jekyll.
  2. Create an empty _config.yml file in the root.
  3. Create a layout your posts overview and for your single post layout in a _layouts folder in the root.
  4. Create a _posts folder in the root and add your first file/blog post in this format: 2018-12-31-happy-new-year.md
  5. Make sure the blog post (.md file) looks like this:
---
title: Happy New Year
---

Your content
  1. Now run 'jekyll serve' from the command line in the root of your website. Jekyll (if installed correctly) will create a _site folder with the generated website (in plain HTML).

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



来源:https://stackoverflow.com/questions/56613883/adding-jekyll-only-the-blog-portion-to-my-website

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!