New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added changelist to site as history #1065
Changes from all commits
cfc6d77
eb5a8a6
2c5807f
0712916
81bbafe
59b3f09
9ac69e3
16954da
e4543e2
d2fabfc
94b5f22
4a3826a
20eda0e
19572d9
d8be0b1
75ced04
db1eb14
4440f27
cffd3a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,10 @@ def date | |
Date.today.to_s | ||
end | ||
|
||
def file_date | ||
Date.today.strftime("%F") | ||
end | ||
|
||
def rubyforge_project | ||
name | ||
end | ||
|
@@ -110,7 +114,7 @@ namespace :site do | |
end | ||
|
||
desc "Commit the local site to the gh-pages branch and publish to GitHub Pages" | ||
task :publish do | ||
task :publish => [:history] do | ||
# Ensure the gh-pages dir exists so we can generate into it. | ||
puts "Checking for gh-pages dir..." | ||
unless File.exist?("./gh-pages") | ||
|
@@ -143,6 +147,36 @@ namespace :site do | |
end | ||
puts 'Done.' | ||
end | ||
|
||
desc "Create a nicely formatted history page for the jekyll site based on the repo history." | ||
task :history do | ||
# First lets go ahead and format the file correctly (mainly bullet points) | ||
puts "Generating the History doc" | ||
# Checking to make sure the History file exists in the root of the repo | ||
if File.exist?("History.markdown") | ||
# Read the file and save to a variable so we can do the replacements | ||
file_time = File.read("History.markdown") | ||
# Replacing the contents of the file for the markdown bullets & issue links | ||
rep_bullets = file_time.gsub(/\s{2}\*{1}/, "-") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this could use a method There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you want the method to encapsulate just the file open or the file_open + the gsubs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A comment probably seems best. I don't think it particularly matters where On Sun, May 12, 2013 at 4:15 PM, Zach notifications@github.com wrote:
|
||
rep_links = rep_bullets.gsub(/#(\d+)/) do |word| | ||
"[#{word}](https://github.com/mojombo/jekyll/issues/#{word.delete("#")})" | ||
end | ||
# Create a hash for the front matter that is to be included | ||
front_matter = {"layout" => "docs", "title" => "History", | ||
"permalink" => "/docs/history/", | ||
"prev_section" => "upgrading"} | ||
# Finally we need to copy the file to the /history directory | ||
Dir.chdir('site/docs/') do | ||
File.open("history.md", "w") do |file| | ||
file.write("#{front_matter.to_yaml}---\n\n") | ||
file.write(rep_links) | ||
end | ||
end | ||
else | ||
puts "Something went wrong" | ||
end | ||
puts "Done" | ||
end | ||
end | ||
|
||
############################################################################# | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -154,6 +154,7 @@ Gem::Specification.new do |s| | |
site/docs/upgrading.md | ||
site/docs/usage.md | ||
site/docs/variables.md | ||
site/docs/history/index.md | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're using a different format so everything is in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did this so we could jam the rss feed for history under the /docs/history folder to keep everything self contained. Wanted to make sure the RSS for the news section you are creating could live at the root of the site. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so you'd have like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's where your release rss will probably live. The history RSS (which we said you could follow separately) will live under /docs/history/rss.xml when parsed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. but when rendered it'll be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes. There will be two. Yours for the news section will be releases.atom Mine for the history section will be something like history.atom Makes sense? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. based on our discussion, let's move this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 for |
||
site/favicon.png | ||
site/img/article-footer.png | ||
site/img/footer-arrow.png | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we run this every time we publish the site, won't we have HEAD? Should this page be for more than just the versions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you will have Head. I don't see any issue with Head being in the changelist but we can exclude it as needed.
What would you propose having on the page with the versions? I think your blog post section is going to handle everything beyond versions.