Skip to content

Commit

Permalink
Display latest version in header (#6676)
Browse files Browse the repository at this point in the history
Merge pull request 6676
  • Loading branch information
jekyllbot committed Jan 6, 2018
1 parent 5ef2deb commit 413de6a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/_config.yml
@@ -1,6 +1,7 @@
sass:
style: compressed

version: 3.7.0 # latest version displayed in header
gauges_id: 503c5af6613f5d0f19000027
google_analytics_id: UA-50755011-1
google_site_verification: onQcXpAvtHBrUI5LlroHNE_FP0b2qvFyPq7VZw36iEY
Expand Down
2 changes: 1 addition & 1 deletion docs/_includes/header.html
Expand Up @@ -17,7 +17,7 @@ <h1>
<div class="meta hide-on-mobiles">
<ul>
<li>
<a href="{{ site.repository }}/releases/tag/v{{ jekyll.version }}">v{{ jekyll.version }}</a>
<a href="{{ site.repository }}/releases/tag/v{{ site.version }}">v{{ site.version }}</a>
</li>
<li>
<a href="{{ site.repository }}">GitHub</a>
Expand Down
12 changes: 8 additions & 4 deletions rake/site.rake
Expand Up @@ -7,7 +7,7 @@
#############################################################################

namespace :site do
task :generated_pages => [:history, :version_file, :conduct, :contributing, :support]
task :generated_pages => [:history, :latest_version, :conduct, :contributing, :support]

desc "Generate and view the site locally"
task :preview => :generated_pages do
Expand Down Expand Up @@ -84,9 +84,13 @@ namespace :site do
siteify_file(".github/SUPPORT.markdown", "title" => "Support")
end

desc "Write the site latest_version.txt file"
task :version_file do
File.open("#{docs_folder}/latest_version.txt", "wb") { |f| f.puts(version) } unless version =~ %r!(beta|rc|alpha)!i
desc "Write the latest Jekyll version"
task :latest_version do
return if version =~ %r!(beta|rc|alpha)!i
config_file = File.join(docs_folder, "_config.yml")
contents = File.read(config_file)
File.write(config_file, contents.sub(%r!(?:version\s*:\s+)(.+)!, "version: #{version}"))
File.open("#{docs_folder}/latest_version.txt", "wb") { |f| f.puts(version) }
end

namespace :releases do
Expand Down

0 comments on commit 413de6a

Please sign in to comment.