diff --git a/Rakefile b/Rakefile index 5243b19f5f6..3c65d2827c6 100644 --- a/Rakefile +++ b/Rakefile @@ -78,13 +78,14 @@ task :whatsnew do print 'Generating data for the What\'s New digest: $ '.magenta # Generate tmp/whats-new.yml - if since.nil? || since.empty? - sh 'bin/whatsup_github', 'since', last_update - elsif since.is_a? String - sh 'bin/whatsup_github', 'since', since - else - abort 'The "since" argument must be a string. Example: "jul 4"' - end + report = + if since.nil? || since.empty? + `bin/whatsup_github since '#{last_update}'` + elsif since.is_a? String + `bin/whatsup_github since #{since}` + else + abort 'The "since" argument must be a string. Example: "jul 4"' + end # Merge generated tmp/whats-new.yml with existing src/_data/whats-new.yml generated_data = YAML.load_file generated_file @@ -94,6 +95,9 @@ task :whatsnew do puts "Writing updates to #{current_file}" File.write current_file, current_data.to_yaml + + abort report if report.include? 'MISSING whatsnew' + puts report end desc 'Generate index for Algolia' diff --git a/src/whats-new.md b/src/whats-new.md index a0b9d5b4cfe..f73daf7ea70 100644 --- a/src/whats-new.md +++ b/src/whats-new.md @@ -15,9 +15,18 @@ title: What's new on DevDocs {% assign grouped_by_year = entries | group_by_exp: "entry", "entry.date | date: '%Y'" %} -{% for group in grouped_by_year limit:2 %} +{% for year_group in grouped_by_year limit:2 %} -## {{ group.name }} +{% assign grouped_by_month = year_group.items | group_by_exp: "entry", "entry.date | date: '%B'" %} +## {{ year_group.name }} + +{% for month_group in grouped_by_month %} +### {{ month_group.name }} + +{% assign grouped_by_date = month_group.items | group_by: "date" %} + +{% for date_group in grouped_by_date %} +#### {{ date_group.name }} @@ -25,25 +34,21 @@ title: What's new on DevDocs - + - {% for item in group.items %} + {% for item in date_group.items %} - + {% endfor %}
Description Versions TypeDatePull request
{{ item.description | markdownify }} {{ item.versions }} {{ item.type }} - {%- if item.link -%} - {{ item.date | date: "%B %e" }} - {%- else -%} - {{ item.date | date: "%B %e" }} - {%- endif -%} - {{ item.link | split: "/" | last }}
+{% endfor %} +{% endfor %} -{% endfor %} +{% endfor %}