Compare commits

...

9 Commits

Author SHA1 Message Date
Parker Moore
6e208e89e6 Release 💎 3.1.3 2016-04-18 14:28:21 -07:00
Parker Moore
b962ed63a4 Allow release from here 2016-04-18 14:28:14 -07:00
Parker Moore
c4e452323e Release v3.1.3 2016-04-18 14:25:09 -07:00
Parker Moore
787f11de71 Merge pull request #4807 from jekyll/3.1-stable-fix-defaults
3.1.x: Fix defaults for Documents (posts/collection docs)
2016-04-18 14:24:37 -07:00
Parker Moore
b64345f0a0 test_document: scopes are based on relative_path 2016-04-18 13:54:16 -07:00
Parker Moore
50637ba0d4 Document#read: frontmatter.all should get relative_path not URL 2016-04-18 13:54:10 -07:00
Florian Thomas
e763d4c4b2 add failing test for scope values in subdirs
ref #4458
2016-04-18 13:54:05 -07:00
Parker Moore
bd2d9a4642 Merge pull request #4693 from jekyll/bug/fix-ssl-opts
Fix #4689: Use SSLEnable instead of EnableSSL and make URL HTTPS.
2016-03-22 16:09:12 -07:00
Jordon Bedwell
2b9e849bbb Fix #4689: Use SSLEnable instead of EnableSSL and make URL HTTPS. 2016-03-21 11:23:26 -05:00
7 changed files with 32 additions and 11 deletions

View File

@@ -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:

View File

@@ -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

View File

@@ -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))

View File

@@ -1,3 +1,3 @@
module Jekyll
VERSION = '3.1.2'
VERSION = '3.1.3'
end

View File

@@ -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

View File

@@ -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

View File

@@ -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",