Rapid Dev

Pug based static site generator

Articles

Example of using generated data, showing how Pug and json-server work together.

In Pug markup, the following article list is just a div with an id. We use JavaScript after the page loads to query articles and map the response to markup.

For detail pages, we generate an HTML anchor and link to the article-detail page, where a script calls for an article based on the incoming query string.