Permalink
Browse files

Rakefile: siteify_file should allow overrides from task [ci skip]

  • Loading branch information...
1 parent 0f8a3b2 commit 3acf4beb81a37da11ed71dce735514db20008774 @parkr parkr committed Mar 10, 2016
Showing with 11 additions and 9 deletions.
  1. +2 −1 .github/CONTRIBUTING.markdown
  2. +3 −3 Rakefile
  3. +1 −1 rake/site.rake
  4. +2 −2 site/_docs/conduct.md
  5. +3 −2 site/_docs/contributing.md
@@ -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
-* 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 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
View
@@ -87,20 +87,20 @@ def converted_history(markdown)
normalize_bullets(markdown)))))
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)
title = begin
File.read(file).match(/\A# (.*)$/)[1]
rescue
File.basename(file, ".*").downcase.capitalize
end
slug = File.basename(file, ".markdown").downcase
- front_matter = front_matter.merge({
+ front_matter = {
"title" => title,
"layout" => "docs",
"permalink" => "/docs/#{slug}/",
"note" => "This file is autogenerated. Edit /#{file} instead."
- })
+ }.merge(overrides_front_matter)
contents = "#{front_matter.to_yaml}---\n\n#{content_for(file)}"
File.write("site/_docs/#{slug}.md", contents)
end
View
@@ -117,7 +117,7 @@ namespace :site do
desc "Copy the contributing file"
task :contributing do
- siteify_file('.github/CONTRIBUTING.markdown')
+ siteify_file('.github/CONTRIBUTING.markdown', "title" => "Contributing")
end
desc "Write the site latest_version.txt file"
@@ -1,10 +1,10 @@
---
-redirect_from: "/conduct/index.html"
-editable: false
title: Code of Conduct
layout: docs
permalink: "/docs/conduct/"
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
@@ -1,5 +1,5 @@
---
-title: Contributing to Jekyll
+title: Contributing
layout: docs
permalink: "/docs/contributing/"
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
-* 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 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

0 comments on commit 3acf4be

Please sign in to comment.