Create new page [closed]

I’m trying to make content management system for blog. How can I make a new page using my template for the page, with a press of button, to generate new post in new page? I’m using HTML, CSS, JavaScript, local storage.

I know how to create, read, update, delete content in the same page. I tried this code in other post, but it doesn’t save on my local storage:

var w = window.open("");
w.document.writeln("<the html you wanted to write>")