简体   繁体   English

在 GitHub Pages Jekyll 站点上呈现 GitHub wiki

[英]Rendering a GitHub wiki on a GitHub Pages Jekyll site

I have a repository with a wiki full of over 80 pages.我有一个包含 80 多页 wiki 的存储库。 I want to render an index of all the wiki pages on the Jekyll (GitHub Pages) site for the project, as well as render each page on the site using a custom layout, and using the styles of the rest of the site.我想为项目在 Jekyll (GitHub Pages) 站点上呈现所有 wiki 页面的索引,并使用自定义布局呈现站点上的每个页面,并使用站点其余部分的样式。

To do this, my first instinct was to use git submodules to include the pages from the wiki (which GitHub exposes as a git repo) in the Jekyll site's repo.为此,我的第一直觉是使用 git 子模块将来自 wiki(GitHub 公开为 git 存储库)的页面包含在 Jekyll 站点的存储库中。 But that's as far as I got: As far as I can tell, there is nowhere that Jekyll will accept markdown files that don't conform as a post.但就我所知:据我所知,Jekyll 不会接受不符合帖子的降价文件。 They aren't named with a date, and they don't have any frontmatter, so Jekyll just ignores them.它们没有以日期命名,也没有任何前言,所以 Jekyll 只是忽略它们。

To get around this, I would normally just write a plugin to do what I wanted.为了解决这个问题,我通常只会编写一个插件来做我想做的事。 But because the site is hosted on GitHub pages, it won't allow any plugins that I create.但是因为该站点托管在 GitHub 页面上,所以它不允许我创建任何插件。

So, I really don't know how to proceed.所以,我真的不知道如何继续。 Is it even possible without custom plugins?没有自定义插件甚至可能吗?

The idea is :这个想法是:

  1. download my plugin下载我的插件
  2. read the docs阅读文档
  3. install and rake安装和耙
  4. drink a beer喝啤酒

What the raketask/plugin are doing once installed and configured (5 minutes) :安装和配置后 raketask/插件正在做什么(5 分钟):

  1. rake wikisub add a git submodule pointing to your wiki. rake wikisub添加一个指向你的 wiki 的 git 子模块。 Must be a public wiki but can be on another repository必须是公共维基,但可以在另一个存储库上
  2. copy and transform downloaded wiki pages as markdown with yaml front matter将下载的 wiki 页面复制和转换为带有 yaml 前台的 Markdown
  3. build Jekyll, then the plugin intercept wiki pages links conversion to transform them as Jekyll links构建 Jekyll,然后插件拦截 wiki 页面链接转换,将它们转换为 Jekyll 链接
  4. order pizzas订购比萨饼

For now the only problem (or not) is that Kramdown doesn't do well with Github markdown.目前唯一的问题(或不是)是 Kramdown 与 Github markdown 的关系不佳。 You have to switch to redcarpet.你必须切换到红地毯。

Two other tasks are available :其他两个任务可用:

  • rake wikibuild : rebuild wiki pages rake wikibuild : 重建维基页面

  • rake wiki : synch wiki page, build and optionally push change to Jekyll repository rake wiki : 同步 wiki 页面,构建并可选择将更改推送到 Jekyll 存储库

Et hop!跳!

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

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