Skip to content

How to format this metadata json file with double quotes? #2871

Answered by mikf
Enrique-Venegas-A asked this question in Q&A
Discussion options

You must be logged in to vote

To use double quotes inside a double-quoted string, you have to escape the quote with a backslash, for example "… \"Tags\": \"{tags}\" …"

Your post processor settings would be

"postprocessors": [
    {
        "name": "metadata",
        "mode": "custom",
        "filename": "info.json",
        "content-format": "{{ \n\n \"Id\": \"{gallery_id}\", \n \"Tags\": \"{tags}\" \n\n }}"
    }
]

There is also a j conversion, that produces a JSON parseable form of a value (see docs/formatting.md#conversions)
For example {tags!j} would become ["tag1", "tag2", "tag3"]

And there is also the option to use a template file, where you write the entire format string to a different file and don't have to w…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@Enrique-Venegas-A
Comment options

@mikf
Comment options

mikf Aug 28, 2022
Maintainer

@Enrique-Venegas-A
Comment options

@mikf
Comment options

mikf Aug 30, 2022
Maintainer

Answer selected by Enrique-Venegas-A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants