Я создал собственную тему, используя Jekyll с именем 'north', которую я создал сам.
После создания темы я получил файл gem как 'north-0.1.0.gem' ифайл gemspec как 'north.gemspec'.
Я взял оба этих файла и вставил их в папку с именем "north" внутри нового проекта "docs".
north.gemspec
frozen_string_literal: true
Gem::Specification.new do |spec|
spec.name = "north"
spec.version = "0.1.0"
spec.authors = ["kumar.saurabh"]
spec.email = ["kumar.saurabh108@abc.com"]
spec.summary = "test."
spec.homepage = "https://wkrepo.abc.com/saurabh.kumar/uvtheme/tree/2.0"
spec.license = "MIT"
spec.files = `git ls-files -z`.split("\x0").select do |f|
f.match(%r{^(_(includes|layouts|sass)/|(LICENSE|README)((\.(txt|md|markdown)|$)))}i)
end
spec.add_runtime_dependency "jekyll", "~> 3.8"
spec.add_development_dependency "bundler", "~> 1.16"
spec.add_development_dependency "rake", "~> 12.0"
end
_config.yaml
# Build settings
markdown: kramdown
theme: north
plugins:
- jekyll-feed
index.md
---
# Feel free to add content and custom Front Matter to this file.
# To modify the layout, see https://jekyllrb.com/docs/themes/#overriding-theme-defaults
layout: page-sidebar-layout
---
Gemfile
gem "jekyll", "~> 3.8.5"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "north", "0.1.0", :path => "north/north-0.1.0.gem_FILES"
Ошибка:
В терминале:
Invalid theme folder: _sass
Invalid theme folder: _includes
Source: /home/users/kumar.saurabh/www/html/symfony_projects/UVdeskDocs/uvdocs
Destination: /home/users/kumar.saurabh/www/html/symfony_projects/UVdeskDocs/uvdocs/_site
Incremental build: disabled. Enable with --incremental
Generating...
Invalid theme folder: _layouts
Invalid theme folder: assets
Jekyll Feed: Generating feed for posts
Build Warning: Layout 'page-sidebar-layout' requested in _posts/2019-05-09-welcome-to-jekyll.markdown does not exist.
Build Warning: Layout 'page-sidebar-layout' requested in 404.html does not exist.
Build Warning: Layout 'page-sidebar-layout' requested in about.md does not exist.
Build Warning: Layout 'page-sidebar-layout' requested in index.md does not exist.
done in 0.179 seconds.
У меня есть еще один вопрос:
Когда я извлек файл .gem, у меня появилась папка 'data', в которой есть папки _layouts, _include и _sass, но нет папки assets, хотя я добавил папку 'assets' при создании файла .gem, почему?
Я следовал следующему обучению: https://www.chrisanthropic.com/blog/2016/creating-gem-based-themes-for-jekyll/