简体   繁体   English

如何将Github页面上的现有内容转换为新的Jekyll主题?

[英]How do I convert existing content on a Github page to a new Jekyll theme?

Hoping someone out there can help me, I have scoured the boards already. 希望有人可以对我有帮助,我已经在董事会中进行了搜索。 I'm not a total noob, but I'm just slightly higher than that. 我不是一个完全的菜鸟,但我只是略高于那个。

I set up a Github static page 2 years back. 两年前,我建立了一个Github静态页面。 Just a simple page, tweaked the CSS a bit from the existing templates, added an image, text and links. 只是一个简单的页面,从现有模板中稍微调整了CSS,添加了图像,文本和链接。 Got the site to work, even figured out how to point it to a custom URL. 使该网站正常工作,甚至弄清楚如何将其指向自定义URL。

Now, I'd like to redesign the site and use a Jekyll theme. 现在,我想重新设计网站并使用Jekyll主题。

All the tutorials I've found talk about how to start this from scratch. 我发现的所有教程都谈到如何从头开始。 How do I take the site I've already created and apply a Jekyll theme to it? 我该如何使用已经创建的网站并将Jekyll主题应用于该网站?

I've also read that I should be keeping the Jekyll theme in master and pulling content from gh-pages. 我还读过我应该将Jekyll主题保持在主要水平,并从gh页中提取内容。 Master is the live source of my content, and if I apply Jekyll to master, will it affect the look of my live site? Master是我内容的实时来源,如果我将Jekyll应用于Master,这会影响我的实时网站的外观吗? I don't want that, I want to be able to work locally and make changes. 我不希望那样,我希望能够在本地工作并进行更改。

Any insight on how to accomplish this redesign is appreciated. 任何有关如何完成此重新设计的见解均受到赞赏。 Thank you! 谢谢!

The content for Jekyll sites is organised into 'posts' and 'pages' . Jekyll网站的内容分为“帖子”“页面” Which can be in html or markdown format. 可以是html或markdown格式。 Jekyll prescribes this directory structure . Jekyll规定了此目录结构

If your github-pages sites is a User Page it can only be published from master (and overwriting it with a jekyll theme would therefore change your live page assuming the new site builds properly). 如果您的github-pages网站是用户页面,则只能从master发布 (如果使用jekyll主题覆盖它,那么假设新网站正确构建,则将更改您的实时页面)。

Otherwise you set the publishing branch in the repo settings. 否则,您可以在回购设置中设置发布分支。

To work with jekyll locally just follow these instructions . 要在本地使用jekyll,请遵循以下说明 It includes the ability to run a local-only server, so that you can "preview your local Jekyll site in your web browser at http://localhost:4000 ." 它包括运行仅本地服务器的功能,因此您可以“在Web浏览器中通过http:// localhost:4000预览本地Jekyll站点”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM