Running the script from the root directory of the project will create a tag page in 'pages/tags'
for every parameter input into the script and tag_${tag}.md will contain the following.
---
title: "${tag} Posts"
tagName: ${tag}
search: exclude
permalink: tag_${tag}.html
sidebar: mydoc_sidebar
hide_sidebar: true
folder: tags
---
{% include taglogic.html %}
{% include links.html %}
It should be easy to replace this with altered content if it is unsatisfactory.