Skip to content
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

Merged
merged 19 commits into from Jun 2, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
36 changes: 35 additions & 1 deletion Rakefile
Expand Up @@ -24,6 +24,10 @@ def date
Date.today.to_s
end

def file_date
Date.today.strftime("%F")
end

def rubyforge_project
name
end
Expand Down Expand Up @@ -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
Copy link
Member

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?

Copy link
Author

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.

# Ensure the gh-pages dir exists so we can generate into it.
puts "Checking for gh-pages dir..."
unless File.exist?("./gh-pages")
Expand Down Expand Up @@ -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}/, "-")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this could use a method

Copy link
Author

Choose a reason for hiding this comment

The 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?

Copy link
Member

Choose a reason for hiding this comment

The 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
it goes as long as people know about it. 😃

On Sun, May 12, 2013 at 4:15 PM, Zach notifications@github.com wrote:

In Rakefile:

@@ -143,6 +147,33 @@ namespace :site do
end
puts 'Done.'
end
+

  • desc "Move the History.markdown over to the /docs/history directory."
  • task :history do
  • First lets go ahead and format the file correctly (mainly bullet points)

  • puts "Generating the History doc!"
  • if File.exist?("History.markdown")
  •  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}/, "-")
    

Do you want the method to encapsulate just the file open or the file_open

  • the gsubs?


Reply to this email directly or view it on GitHubhttps://github.com//pull/1065/files#r4186499
.

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

#############################################################################
Expand Down
1 change: 1 addition & 0 deletions jekyll.gemspec
Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're using a different format so everything is in the docs folder as files, then setting the permalink. Can you change this file to be site/docs/history.md?

Copy link
Author

Choose a reason for hiding this comment

The 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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so you'd have like site/docs/v1.0.0.md?

Copy link
Author

Choose a reason for hiding this comment

The 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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but when rendered it'll be /releases.atom or something?

Copy link
Author

Choose a reason for hiding this comment

The 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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

based on our discussion, let's move this to site/docs/history.md

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for site/docs/history.md

site/favicon.png
site/img/article-footer.png
site/img/footer-arrow.png
Expand Down
3 changes: 3 additions & 0 deletions site/_includes/docs_contents.html
Expand Up @@ -80,6 +80,9 @@ <h4>Miscellaneous</h4>
<li class="{% if page.title == "Upgrading" %}current{% endif %}">
<a href="{{ site.url }}/docs/upgrading">Upgrading</a>
</li>
<li class="{% if page.title == "History" %}current{% endif %}">
<a href="{{ site.url }}/docs/history">History</a>
</li>
</ul>
</aside>
</div>