rewrite index.html and widget.js