From bcebe9c4816ce3e2a8b5a4cc405242d4c3236708 Mon Sep 17 00:00:00 2001 From: Saivann Date: Wed, 4 Sep 2013 13:29:36 -0400 Subject: [PATCH] Set latest download version automatically based on release notes --- README.md | 5 ++--- _config.yml | 2 -- _plugins/releases.rb | 4 ++++ 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 32cd2f5f..b8ecdb62 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,6 @@ Installing dependencies on older Ubuntu and Debian distributions # Usage -* update DOWNLOAD\_VERSION in _config.yml * run jekyll * output will be in \_site/ @@ -102,7 +101,7 @@ More information will follow. ### Release Notes -Release notes should be placed in `_releases/YYYY-MM-DD-SHORTTITLE.md` and adhere to this format: +Release notes should be placed in `_releases/YYYY-MM-DD-VERSION.md` and adhere to this format: ``` --- @@ -115,7 +114,7 @@ Bitcoin v0.3.24 is now available for download at ... ``` -* `SHORTTITLE` is used to construct the URL. Something like `v0.3.24` will be fine +* `VERSION` is used to define the version and construct the URL. It should adhere to this format: `v0.3.24`. * `title: ...` will be used as the title * `src: ...` (optional) link to full annoucement diff --git a/_config.yml b/_config.yml index 6a6b440c..7089452e 100644 --- a/_config.yml +++ b/_config.yml @@ -1,5 +1,3 @@ -DOWNLOAD_VERSION: 0.8.4 - langsorder: - id: de - id: id diff --git a/_plugins/releases.rb b/_plugins/releases.rb index 2332abd9..c8887dc9 100644 --- a/_plugins/releases.rb +++ b/_plugins/releases.rb @@ -17,6 +17,10 @@ module Jekyll self.data['redirect'] = dst.gsub('.md','') else self.data['category'] = 'release' + if !site.config.has_key?('DOWNLOAD_DATE') or site.config['DOWNLOAD_DATE'] < year + '-' + month + '-' + day + site.config['DOWNLOAD_DATE'] = year + '-' + month + '-' + day + site.config['DOWNLOAD_VERSION'] = dst.gsub('.md','').gsub(/[a-z]/,'') + end site.pages << ReleasePage.new(site, base, lang, srcdir, src, '/releases/' + year + '/' + month + '/' + day, dst, year, month, day) end end