当前位置: 首页 > 软件库 > Web应用开发 > >

jekyll-serve

授权协议 MIT License
开发语言 JavaScript
所属分类 Web应用开发
软件类型 开源软件
地区 不详
投 递 者 江阳羽
操作系统 未知
开源组织
适用人群 未知
 软件概览

Jekyll in a Docker Container

GitHub Super-Linter

But this has been done. Why not docker run jekyll/jekyll?

  • I wanted two images, one for easy CLI (bretfisher/jekyll) and one foreasy local server for dev with sane defaults (bretfisher/jekyll-serve), which I use 90% of time
  • So you can start any Jekyll server with docker-compose up
  • I wanted to dev on a local jekyll site w/o having jekyll installed on my host OS
  • I wanted it to be as easy as possible to start
  • I wanted current alpine, ruby, and jekyll (these images update monthly to latest versions)

So, this does that.

Note I have courses on Docker (including a Lecture on Jekyll in Docker).

‼️ ‼️ ‼️

⚠️ WARNING: ⚠️ This isn't meant to be a production image that you run a web server with. I don't do that with the JekyllCLI that comes with this image. Jekyll CLI generatesa static site that you can run with GitHub Pages, Netlify, or your own NGINX setup. Furthermore, I don't versionanything so these images will not run guaranteed versions of Ruby, Jekyll, etc. (which, if you're running a server,should pin all versions usually.)

Docker Images

Image Purpose Example
bretfisher/jekyll Runs Jekyll by default with no options, good for general CLI commands docker run -v $(pwd):/site bretfisher/jekyll new .
bretfisher/jekyll-serve Runs Jekyll serve with sane defaults, good for local Jekyll site dev docker run -p 8080:4000 -v $(pwd):/site bretfisher/jekyll-serve

Getting Started

Creating a site:

cd to empty directory
docker run -v $(pwd):/site bretfisher/jekyll new .

Start a local server with sane defaults listening on port 8080:

cd dir/of/your/jekyll/site
docker run -p 8080:4000 -v $(pwd):/site bretfisher/jekyll-serve

That's it!

Details: it will mount your current path into the containers /site, bundle install before runningjekyll serve to , serve it at http://<docker-host>:8080.

To make this even easier, copy docker-compose.ymlfrom this repoto your jekyll site root. Then you'll only need to:

cd dir/of/your/jekyll/site
docker-compose up

Known issues

  1. webrick errors during startup.

    • As of April 2021, Ruby 3.0 is out, and Jekyll is still on 4.2 (released 12/2020).Jekyll 4.2 doesn't have webrick listed as a dependency, so we'll have to manually add it toGemfile for now if you want to use Ruby 3.0.Ruby 3.0 removed this bundled gems so you'll need to add them manually if youuse them: sdbm, webrick, net-telnet, xmlrpc. Hopefully Jekyll 4.3 will have webricklisted as a Jekyll dependency (it is fixed in Jekyll master branch) so manually updating Gemfileswon't be needed.
    • Note this image was reverted back to Ruby 2.x in June 2021 to prevent the issues found in 3.0

Q&A

Q. What if I want to run other jekyll commands?

just add the jekyll options to the end of the bretfisher/jekyll:

docker run -v $(pwd):/site bretfisher/jekyll doctor

License

MIT License

Copyright (c) [Bret Fisher bret@bretfisher.com]

Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.

  • 我的jekyll静态博客部署在GitHub上,平时自己本地测试的时候运行命令jekyll serve即可启动: C:\Users\peter\Documents\GitHub\zhang0peter.github.io>jekyll serve Configuration file: C:/Users/peter/Documents/GitHub/xxx.github.io/_config.yml

  • 从 Jekyll 3.0 开始,jekyll-paginate 被移除了,因为与其他核心功能不能很好的协作。如果出现这种提示: $ jekyll serve Configuration file: /var/www/lanyon-mobile/_config.yml Deprecation: You appear to have pagination turned on, but you have

  • tags: Frontend CSS 写在前面 改一下博客的字体显示, 默认的不好看, 这里改成JetBrainsMono Nerd Font Mono, 连字字体. 官方GitHub: JetBrainsMono Nerd Font Mono; 这里我的主题的TeXt, 官方主页:kitian616/jekyll-TeXt-theme:   A super customizable Jeky

  • issue 问题 在运行 jekyll serve 的时候,出现该问题: Deprecation: You appear to have pagination turned on, but you haven’t included the jekyll-paginate gem. Ensure you have gems: [jekyll-paginate] in your configurati

  •   经过很长的一段时间对jekyll的适应,深刻的感觉到了jekyll为什么说是适合程序员的博客系统,因为jekyll根本不适合那些只想专注于写作的人们。我所谓的“只想专注于”这个字眼意思是我就是上来写文章然后发布就完事的意思,而对于程序员来说“只想专注于”意思是经过折腾,搭建好一个看起来有那么点高大上的但是又不是唾手而得服务的那种。那么,jekyll就应运而生了。大家通过关键词搜索进来其实是想解

 相关资料
  • Jekyll 是一个简单的免费的Blog生成工具,类似WordPress。但是和WordPress又有很大的不同,原因是jekyll只是一个生成静态网页的工具,不需要数据库支持。但是可以配合第三方服务,例如discuz。最关键的是jekyll可以免费部署在Github上,而且可以绑定自己的域名。 快速安装指令: gem install jekylljekyll new my-awesome-sit

  • 中文网站 jekyllcn 快速开始 ~ $ gem install jekyll bundler ~ $ jekyll new my-awesome-site ~ $ cd my-awesome-site ~/my-awesome-site $ bundle install ~/my-awesome-site $ bundle exec jekyll serve # => 打开浏览器 http

  • jekyll-admin 是一个 jekyll 插件,为用户提供了传统 CMS(内容管理系统)风格的图形化界面来创作内容和管理 jekyll 网站。 该项目分为两部分。基于 Ruby 的 HTTP API 处理 jekyll 和文件系统的操作部分,以及在这个 API 基础上的基于 JavaScript 的前端部分。 安装: 就像安装其他插件一样,请参阅 jekyll 文档的插件安装部分安装 jek

  • Jekyll的增强版,使用Markdown来写日志。 Jekyll采用静态文件方式管理,不需要数据库即可支持一个独立博客站点,在github-pages平台上被普遍采用。Jekyll-Bootstrap在Jekyll基础上,集成了twitter-bootstrap界面风格和一些实用的插件,并且易于扩展。

  • Jekyll Docker Jekyll Docker is a software image that has Jekyll and many of its dependencies ready to use for you in an encapsulated format. It includes a default set of gems, different image types wi

  • jekyll-katex This is a Jekyll plugin for performing compile-time math rendering via the KaTeX library.KaTeX is a library for rending math on the web using LaTeX, similar to MathJax. KaTeX differs from