Videos
Check out our tutorial video series.
How to parse and validate markdown with YAML headers and assert for required meta data lengths and properties.
Many websites today are built using static site builders and markdown with embed data: the JAM Stack. Markdown alone is useful for writing content. Adding Frontmatter YAML headers to Markdown allows us to embed meta data for static site builders. To validate this content to SEO we will share a test.
Say you have a website built with Hugo. You might want to read all the content and check that the title and description properties of the markdown are of an appropriate length. We can do so using Jest and Node JS.
We need a few node dependencies for this examples:
Let's write a test that loads all the Markdown files in the folder and parses their markdown frontmatter. We then return a result for various tests such as description length. We use Jest to run the tests:
Execute to run the test.
Check out our tutorial video series.
Email and SMS guides for automation and testing.
View github project code for multiple languages.
Latest posts from the MailSlurp team.
Test, build, and automate messaging with a free MailSlurp account.