'use strict';

import gulp   from 'gulp'
import config from '../config'
import fs     from 'fs'

gulp.task('copyIndex', function() {
  var description = "Blockstack is a new decentralized internet of apps that let you control your data. " +
                    "With the Blockstack Browser, you can get started with decentralized applications. " +
                    "Free yourself of passwords and be less vulnerable to tracking and hacking.";
  var image = "https://blockstack.org/images/metatags/blockstack-site-snapshot.png"

  var indexHtml = fs.readFileSync('app/index.html', 'utf8')
  var metatagsHtml = fs.readFileSync('app/metatags.html', 'utf8')
  metatagsHtml = metatagsHtml.replace('{description}', description)
  metatagsHtml = metatagsHtml.replace('{image}', image)

  indexHtml = indexHtml.replace('<meta charset="utf-8" />', metatagsHtml)

  fs.writeFile('build/index.html', indexHtml, function(err) {
    if (err) {
      throw err
    }
  })
})
@@ -688,17 +688,17 @@
 replace(
-'
+/
 %7Bdescrip
@@ -702,17 +702,18 @@
 ription%7D
-'
+/g
 , descri
@@ -761,17 +761,18 @@
 ace(
-'
+/
 %7Bimage%7D
-'
+/g
 , im

fix bug in metatag builder