Rakefile: siteify_file should allow overrides from task [ci skip]
This commit is contained in:
parent
0f8a3b2971
commit
3acf4beb81
|
@ -4,9 +4,10 @@ Hi there! Interested in contributing to Jekyll? We'd love your help. Jekyll is a
|
||||||
|
|
||||||
## Where to get help or report a problem
|
## Where to get help or report a problem
|
||||||
|
|
||||||
* If you have a question about using Jekyll, start a discussion on https://talk.jekyllrb.com.
|
* If you have a question about using Jekyll, start a discussion on [Jekyll Talk](https://talk.jekyllrb.com).
|
||||||
* If you think you've found a bug within a Jekyll plugin, open an issue in that plugin's repository.
|
* If you think you've found a bug within a Jekyll plugin, open an issue in that plugin's repository.
|
||||||
* If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new)
|
* If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new)
|
||||||
|
* More resources are listed on our [Help page](https://jekyllrb.com/help/)
|
||||||
|
|
||||||
## Ways to contribute
|
## Ways to contribute
|
||||||
|
|
||||||
|
|
6
Rakefile
6
Rakefile
|
@ -87,7 +87,7 @@ def converted_history(markdown)
|
||||||
normalize_bullets(markdown)))))
|
normalize_bullets(markdown)))))
|
||||||
end
|
end
|
||||||
|
|
||||||
def siteify_file(file, front_matter = {})
|
def siteify_file(file, overrides_front_matter = {})
|
||||||
abort "You seem to have misplaced your #{file} file. I can haz?" unless File.exists?(file)
|
abort "You seem to have misplaced your #{file} file. I can haz?" unless File.exists?(file)
|
||||||
title = begin
|
title = begin
|
||||||
File.read(file).match(/\A# (.*)$/)[1]
|
File.read(file).match(/\A# (.*)$/)[1]
|
||||||
|
@ -95,12 +95,12 @@ def siteify_file(file, front_matter = {})
|
||||||
File.basename(file, ".*").downcase.capitalize
|
File.basename(file, ".*").downcase.capitalize
|
||||||
end
|
end
|
||||||
slug = File.basename(file, ".markdown").downcase
|
slug = File.basename(file, ".markdown").downcase
|
||||||
front_matter = front_matter.merge({
|
front_matter = {
|
||||||
"title" => title,
|
"title" => title,
|
||||||
"layout" => "docs",
|
"layout" => "docs",
|
||||||
"permalink" => "/docs/#{slug}/",
|
"permalink" => "/docs/#{slug}/",
|
||||||
"note" => "This file is autogenerated. Edit /#{file} instead."
|
"note" => "This file is autogenerated. Edit /#{file} instead."
|
||||||
})
|
}.merge(overrides_front_matter)
|
||||||
contents = "#{front_matter.to_yaml}---\n\n#{content_for(file)}"
|
contents = "#{front_matter.to_yaml}---\n\n#{content_for(file)}"
|
||||||
File.write("site/_docs/#{slug}.md", contents)
|
File.write("site/_docs/#{slug}.md", contents)
|
||||||
end
|
end
|
||||||
|
|
|
@ -117,7 +117,7 @@ namespace :site do
|
||||||
|
|
||||||
desc "Copy the contributing file"
|
desc "Copy the contributing file"
|
||||||
task :contributing do
|
task :contributing do
|
||||||
siteify_file('.github/CONTRIBUTING.markdown')
|
siteify_file('.github/CONTRIBUTING.markdown', "title" => "Contributing")
|
||||||
end
|
end
|
||||||
|
|
||||||
desc "Write the site latest_version.txt file"
|
desc "Write the site latest_version.txt file"
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
---
|
---
|
||||||
redirect_from: "/conduct/index.html"
|
|
||||||
editable: false
|
|
||||||
title: Code of Conduct
|
title: Code of Conduct
|
||||||
layout: docs
|
layout: docs
|
||||||
permalink: "/docs/conduct/"
|
permalink: "/docs/conduct/"
|
||||||
note: This file is autogenerated. Edit /CONDUCT.markdown instead.
|
note: This file is autogenerated. Edit /CONDUCT.markdown instead.
|
||||||
|
redirect_from: "/conduct/index.html"
|
||||||
|
editable: false
|
||||||
---
|
---
|
||||||
|
|
||||||
As contributors and maintainers of this project, and in the interest of
|
As contributors and maintainers of this project, and in the interest of
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Contributing to Jekyll
|
title: Contributing
|
||||||
layout: docs
|
layout: docs
|
||||||
permalink: "/docs/contributing/"
|
permalink: "/docs/contributing/"
|
||||||
note: This file is autogenerated. Edit /.github/CONTRIBUTING.markdown instead.
|
note: This file is autogenerated. Edit /.github/CONTRIBUTING.markdown instead.
|
||||||
|
@ -9,9 +9,10 @@ Hi there! Interested in contributing to Jekyll? We'd love your help. Jekyll is a
|
||||||
|
|
||||||
## Where to get help or report a problem
|
## Where to get help or report a problem
|
||||||
|
|
||||||
* If you have a question about using Jekyll, start a discussion on https://talk.jekyllrb.com.
|
* If you have a question about using Jekyll, start a discussion on [Jekyll Talk](https://talk.jekyllrb.com).
|
||||||
* If you think you've found a bug within a Jekyll plugin, open an issue in that plugin's repository.
|
* If you think you've found a bug within a Jekyll plugin, open an issue in that plugin's repository.
|
||||||
* If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new)
|
* If you think you've found a bug within Jekyll itself, [open an issue](https://github.com/jekyll/jekyll/issues/new)
|
||||||
|
* More resources are listed on our [Help page](https://jekyllrb.com/help/)
|
||||||
|
|
||||||
## Ways to contribute
|
## Ways to contribute
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue