Schema.org Markup with JSON on Different Types of Pages

One way would be to add the schema partial based on the kind of page, and having different partials for each kind.

For example: site-schema.html, page-schema.html, section-schema.html etc.

Take a look here and see if it helps: Variable in path string variable, printf?