百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
J

jekyll-remote-theme

> 开发工具
开源

用于使用任何 GitHub 托管主题构建 Jekyll 站点的 Jekyll 插件

332 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

用于使用任何 GitHub 托管主题构建 Jekyll 站点的 Jekyll 插件

Jekyll Remote Theme

Jekyll plugin for building Jekyll sites with any public GitHub-hosted theme

Usage

  1. Add the following to your Gemfile
ruby
gem "jekyll-remote-theme"

and run bundle install to install the plugin

  1. Add the following to your site's _config.yml to activate the plugin
yaml
plugins:
  - jekyll-remote-theme

Note: If you are using a Jekyll version less than 3.5.0, use the gems key instead of plugins.

  1. Add the following to your site's _config.yml to choose your theme
yaml
remote_theme: benbalter/retlab

To use a specific release or branch:

yaml
remote_theme: benbalter/[email protected]

To automatically use the latest tagged release:

yaml
remote_theme: benbalter/retlab@latest

or 1

yaml
remote_theme: http[s]://github..com/benbalter/retlab

or 2

yaml
remote_theme: ../my-local-theme

1 The codeload subdomain needs to be available on your github enterprise instance for this to work. 2 For local development, you can use local file paths (relative or absolute).

Declaring your theme

Remote themes are specified by the remote_theme key in the site's config.

For public GitHub, remote themes must be in the form of OWNER/REPOSITORY, and must represent a public GitHub-hosted Jekyll theme. See the Jekyll documentation for more information on authoring a theme. Note that you do not need to upload the gem to RubyGems or include a .gemspec file.

You may also optionally specify a branch, tag, or commit to use by appending an @ and the Git ref (e.g., benbalter/[email protected] or benbalter/retlab@develop). If you don't specify a Git ref, the HEAD ref will be used.

To automatically use the latest tagged release, you can specify @latest (e.g., benbalter/retlab@latest). This will fetch the most recent release from the GitHub Releases API. If no releases exist, it will fall back to using HEAD.

For Enterprise GitHub, remote themes must be in the form of http[s]://GITHUBHOST.com/OWNER/REPOSITORY, and must represent a public (non-private repository) GitHub-hosted Jekyll theme. Other than requiring the fully qualified domain name of the enterprise GitHub instance, this works exactly the same as the public usage.

Local Development

For local development, you can use local file paths instead of remote repositories. This is useful when you want to separate your theme from your blog repository and test changes locally before pushing to GitHub.

Local paths can be either relative or absolute:

yaml
# Relative path
remote_theme: ../my-theme

# Absolute path
remote_theme: /home/user/projects/my-theme

The local directory should contain a valid Jekyll theme structure with layouts, includes, assets, etc. No download or extraction occurs when using local paths - the plugin uses the theme files directly from the specified location.

Customizing your theme

You can override any file from the remote theme by creating a file with the same path in your Jekyll site. This works for:

  • Layouts (_layouts/) - Create a file with the same name in your _layouts directory to override a theme layout
  • Includes (_includes/) - Create a file with the same name in your _includes directory to override a theme include
  • Sass files (_sass/) - Add custom Sass files in your _sass directory
  • Assets (assets/) - Override or add assets in your assets directory

Example

If your remote theme has a _layouts/default.html file, you can override it by creating your own _layouts/default.html file in your site. Your local version will be used instead of the theme's version.

Similarly, if the theme has an _includes/header.html file, you can override it by creating _includes/header.html in your site.

Note: Only the specific files you override will use your local versions. All other theme files will continue to work as provided by the theme.

Debugging

Adding --verbose to the build or serve command may provide additional information.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rubygithub-pagesjekyll-pluginjekyll-sitejekyll-themes

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具