   fs.outputFileAsync './build/changelogs/rpm.txt',
     changelogJson
       .map (release) ->
-        log = release.changes
-          .map (line) -> '- ' + line
-          .join '\n'
+        if Array.isArray release.changes
+          log = release.changes
+            .map (line) -> '- ' + line
+            .join '\n'
+        else
+          log = []
+          for key in Object.keys(release.changes)
+            logs = release.changes[key]
+              .map (line) -> '- ' + key + ': ' + line
+              .join '\n'
+            log.push logs
+          log = log.join '\n'
 
         parsedDate = new Date(release.releasedAt)
         date = moment(parsedDate).format('ddd MMM DD YYYY')
 
-        return '* ' + date + ' ' + manifest.author + ' ' + release.version + '\n' + log
+        channelSuffix = ''
+        if release.channel != 'stable'
+          channelSuffix = '-' + release.channel
+
+        return '* ' + date + ' ' + manifest.author + ' ' + release.version + channelSuffix + '\n' + log
       .join '\n\n'
 
 gulp.task 'changelog:md', () ->
   changelog = changelogJson
     .map (release, index) ->
-      log = release.changes
-        .map (line) -> '- ' + line
-        .join '\n'
+      if Array.isArray release.changes
+        log = release.changes
+          .map (line) -> '- ' + line
+          .join '\n'
+      else
+        log = []
+        for key in Object.keys(release.changes)
+          logs = release.changes[key]
+            .map (line) -> '- ' + line
+            .join '\n'
+          log.push '\n**' + key + '**\n'
+          log.push logs
+        log = log.join '\n'
 
       parsedDate = new Date(release.releasedAt)
       date = moment(parsedDate).format('YYYY-DD-MM')

  fs.outputFileAsync './build/changelogs/deb.txt',
    changelogJson
      .map (release) ->
        log = release.changes
          .map (line) -> ' * ' + line
          .join '\n'

        parsedDate = new Date(release.releasedAt)
        date = moment(parsedDate).format('ddd, DD MMM YYYY HH:mm:ss ZZ')

        return manifest.name + ' (' + release.version.split('-')[0] + ') ' +
          (release.version + '-stable').split('-')[1] + '; urgency=' + release.urgency +
          '\n\n' + log + '\n\n' +
          '-- ' + manifest.author + '  ' + date
      .join '\n\n'


      fullChangelog = ''
      if index < changelogJson.length - 1
        fullChangelog = '[Full Changelog](https://github.com/Aluxian/Whatsie/compare/v' +
          changelogJson[index+1].version + '...v' + release.version + ') &bull; '

      download = '[Download](https://github.com/Aluxian/Whatsie/releases/tag/v' + release.version + ')'

      channelSuffix = ''
      if release.channel != 'stable'
        channelSuffix = '-' + release.channel

      return '## [' + release.version + channelSuffix + '](https://github.com/Aluxian/Whatsie/tree/v' +
          release.version + ') (' + date + ')\n\n' + fullChangelog + download + '\n' + log
    .join '\n\n'
  changelog += '\n'
  fs.outputFileAsync './CHANGELOG.md', changelog
