remove asset support
This commit is contained in:
parent
b29ce257c3
commit
92168954d2
|
@ -12,10 +12,6 @@ module Jekyll
|
|||
@root ||= gemspec.full_gem_path
|
||||
end
|
||||
|
||||
def assets_path
|
||||
path_for :assets
|
||||
end
|
||||
|
||||
def includes_path
|
||||
path_for :includes
|
||||
end
|
||||
|
|
|
@ -4,7 +4,7 @@ title: Themes
|
|||
permalink: /docs/themes/
|
||||
---
|
||||
|
||||
Jekyll has an extensive theme system, which allows you to leverage community-maintained templates and styles to customize your site's presentation. Jekyll themes package layouts, includes, stylesheets, and static assets in a way that can be overridden by your site's content.
|
||||
Jekyll has an extensive theme system, which allows you to leverage community-maintained templates and styles to customize your site's presentation. Jekyll themes package layouts, includes, and stylesheets in a way that can be overridden by your site's content.
|
||||
|
||||
## Installing a theme
|
||||
|
||||
|
@ -23,14 +23,13 @@ You can have multiple themes listed in your site's Gemfile, but only one theme c
|
|||
|
||||
## Overriding theme defaults
|
||||
|
||||
Jekyll themes set default layouts, includes, stylesheets and static assets, that can be overridden by your site's content. For example, if your selected theme has a `page` layout, you can override the theme's layout by creating your own `page` layout in the `_layouts` folder (e.g., `_layouts/page.html`).
|
||||
Jekyll themes set default layouts, includes, and stylesheets, that can be overridden by your site's content. For example, if your selected theme has a `page` layout, you can override the theme's layout by creating your own `page` layout in the `_layouts` folder (e.g., `_layouts/page.html`).
|
||||
|
||||
Jekyll will look first to your site's content, before looking to the theme's defaults, for any requested file in the following folders:
|
||||
|
||||
* `/_layouts`
|
||||
* `/_includes`
|
||||
* `/_sass`
|
||||
* `/assets/`
|
||||
|
||||
Refer to your selected theme's documentation and source repository for more information on what files you can override.
|
||||
{: .note .info}
|
||||
|
@ -48,7 +47,7 @@ Gem::Specification.new do |s|
|
|||
s.author = 'Dr. Jekyll'
|
||||
s.email = 'doc@jekyllrb.com'
|
||||
s.homepage = 'https://github.com/jekyll/my-awesome-jekyll-theme'
|
||||
s.files = `git ls-files -z`.split("\x0").grep(%r{^(assets|_sass|_includes|_layouts)/})
|
||||
s.files = `git ls-files -z`.split("\x0").grep(%r{^_(sass|includes|layouts)/})
|
||||
end
|
||||
{% endhighlight %}
|
||||
|
||||
|
@ -62,15 +61,6 @@ For example, if your theme has a `/_layouts/page.html` file, and a page has `lay
|
|||
|
||||
Your theme's stylesheets should be placed in your theme's `/_sass` folder, again, just as you would when authoring a Jekyll site. Your theme's styles can be included in the user's stylesheet using the `@import` directive.
|
||||
|
||||
You may also need to output the rendered styles, by adding an `/assets/style.scss` file, which imports the necessary stylesheets, by following the instructions in the [static assets](#static-assets) section below.
|
||||
|
||||
Do not place your theme's styles in the `/assets/style.scss` file. Storing styles in the `/_sass` folder allows users to use SaSS's `@import` directive, to combine their custom styles, with the theme's in a single file.
|
||||
{: .info .note }
|
||||
|
||||
### Static assets
|
||||
|
||||
You may also bundle static assets within your theme (e.g., javascripts, images, and fonts). Place any files you'd like in your theme's `/assets` folder, which will be included in the published site. It's common to group files into folders, such as `/assets/js`, `/assets/img`, and `/assets/fonts`.
|
||||
|
||||
### Documenting your theme
|
||||
|
||||
Your theme should include a `/README.md` file, which explains how site authors can install and use your theme. What layouts are included? What includes? Do they need to add anything special to their site's configuration file?
|
||||
|
|
|
@ -28,20 +28,16 @@ class TestTheme < JekyllUnitTest
|
|||
end
|
||||
|
||||
context "path generation" do
|
||||
[:assets, :layouts, :includes, :sass].each do |folder|
|
||||
[:layouts, :includes, :sass].each do |folder|
|
||||
should "know the #{folder} path" do
|
||||
if folder == :assets
|
||||
expected = File.expand_path(folder.to_s, @expected_root)
|
||||
else
|
||||
expected = File.expand_path("_#{folder}", @expected_root)
|
||||
end
|
||||
assert_equal expected, @theme.public_send("#{folder}_path")
|
||||
end
|
||||
end
|
||||
|
||||
should "generate folder paths" do
|
||||
expected = File.expand_path("./assets", @expected_root)
|
||||
assert_equal expected, @theme.send(:path_for, :assets)
|
||||
expected = File.expand_path("./_sass", @expected_root)
|
||||
assert_equal expected, @theme.send(:path_for, :sass)
|
||||
end
|
||||
|
||||
should "not allow paths outside of the theme root" do
|
||||
|
|
Loading…
Reference in New Issue