mirror of
https://github.com/jekyll/jekyll.git
synced 2026-04-28 03:01:03 -04:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6e208e89e6 | ||
|
|
b962ed63a4 | ||
|
|
c4e452323e | ||
|
|
787f11de71 | ||
|
|
b64345f0a0 | ||
|
|
50637ba0d4 | ||
|
|
e763d4c4b2 | ||
|
|
bd2d9a4642 | ||
|
|
2b9e849bbb |
@@ -80,6 +80,26 @@ Feature: frontmatter defaults
|
||||
And I should see "main: <p>content of site/special/2013/10/14/about1.html</p>" in "_site/special/2013/10/14/about1.html"
|
||||
And I should see "main: <p>content of site/special/2013/10/14/about2.html</p>" in "_site/special/2013/10/14/about2.html"
|
||||
|
||||
Scenario: Use frontmatter scopes for subdirectories
|
||||
Given I have a _layouts directory
|
||||
And I have a main layout that contains "main: {{ content }}"
|
||||
|
||||
And I have a _posts/en directory
|
||||
And I have the following post under "en":
|
||||
| title | date | content |
|
||||
| helloworld | 2014-09-01 | {{page.lang}} is the current language |
|
||||
And I have a _posts/de directory
|
||||
And I have the following post under "de":
|
||||
| title | date | content |
|
||||
| hallowelt | 2014-09-01 | {{page.lang}} is the current language |
|
||||
|
||||
And I have a configuration file with "defaults" set to "[{scope: {path: "_posts/en"}, values: {layout: "main", lang: "en"}}, {scope: {path: "_posts/de"}, values: {layout: "main", lang: "de"}}]"
|
||||
|
||||
When I run jekyll build
|
||||
Then the _site directory should exist
|
||||
And I should see "main: <p>en is the current language</p>" in "_site/2014/09/01/helloworld.html"
|
||||
And I should see "main: <p>de is the current language</p>" in "_site/2014/09/01/hallowelt.html"
|
||||
|
||||
Scenario: Override frontmatter defaults by type
|
||||
Given I have a _posts directory
|
||||
And I have the following post:
|
||||
|
||||
@@ -112,11 +112,12 @@ module Jekyll
|
||||
|
||||
private
|
||||
def server_address(server, opts)
|
||||
address = server.config[:BindAddress]
|
||||
baseurl = "#{opts["baseurl"]}/" if opts["baseurl"]
|
||||
port = server.config[:Port]
|
||||
|
||||
"http://#{address}:#{port}#{baseurl}"
|
||||
"%{prefix}://%{address}:%{port}%{baseurl}" % {
|
||||
:prefix => server.config[:SSLEnable] ? "https" : "http",
|
||||
:baseurl => opts["baseurl"] ? "#{opts["baseurl"]}/" : "",
|
||||
:address => server.config[:BindAddress],
|
||||
:port => server.config[:Port]
|
||||
}
|
||||
end
|
||||
|
||||
#
|
||||
@@ -181,7 +182,7 @@ module Jekyll
|
||||
source_certificate = Jekyll.sanitized_path(opts[:JekyllOptions]["source"], opts[:JekyllOptions]["ssl_cert"])
|
||||
opts[:SSLCertificate] = OpenSSL::X509::Certificate.new(File.read(source_certificate))
|
||||
opts[:SSLPrivateKey ] = OpenSSL::PKey::RSA.new(File.read(source_key))
|
||||
opts[:EnableSSL] = true
|
||||
opts[:SSLEnable] = true
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -259,7 +259,7 @@ module Jekyll
|
||||
@data = SafeYAML.load_file(path)
|
||||
else
|
||||
begin
|
||||
defaults = @site.frontmatter_defaults.all(url, collection.label.to_sym)
|
||||
defaults = @site.frontmatter_defaults.all(relative_path, collection.label.to_sym)
|
||||
merge_data!(defaults, source: "front matter defaults") unless defaults.empty?
|
||||
|
||||
self.content = File.read(path, Utils.merged_file_read_opts(site, opts))
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module Jekyll
|
||||
VERSION = '3.1.2'
|
||||
VERSION = '3.1.3'
|
||||
end
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
desc "Release #{name} v#{version}"
|
||||
task :release => :build do
|
||||
unless `git branch` =~ /^\* master$/
|
||||
unless `git branch` =~ /^\* 3\.1-stable$/
|
||||
puts "You must be on the master branch to release!"
|
||||
exit!
|
||||
end
|
||||
|
||||
@@ -105,7 +105,7 @@ class TestCommandsServe < JekyllUnitTest
|
||||
"ssl_key" => "bar"
|
||||
})
|
||||
|
||||
assert result[:EnableSSL]
|
||||
assert result[:SSLEnable]
|
||||
assert_equal result[:SSLPrivateKey ], "c2"
|
||||
assert_equal result[:SSLCertificate], "c1"
|
||||
end
|
||||
|
||||
@@ -122,7 +122,7 @@ class TestDocument < JekyllUnitTest
|
||||
@site = fixture_site({
|
||||
"collections" => ["slides"],
|
||||
"defaults" => [{
|
||||
"scope"=> {"path"=>"slides", "type"=>"slides"},
|
||||
"scope"=> {"path"=>"_slides", "type"=>"slides"},
|
||||
"values"=> {
|
||||
"nested"=> {
|
||||
"key"=>"value123",
|
||||
|
||||
Reference in New Issue
Block a user