问题
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:
- You can leave the static html files in the root (and subdirectories). They will not collide with Jekyll.
- Create an empty _config.yml file in the root.
- Create a layout your posts overview and for your single post layout in a _layouts folder in the root.
- Create a _posts folder in the root and add your first file/blog post in this format: 2018-12-31-happy-new-year.md
- Make sure the blog post (.md file) looks like this:
---
title: Happy New Year
---
Your content
- 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