Skip to content

Support for non-HTML output formats? #113

Answered by oscarotero
shah asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, you can output any format. There are two ways:

  • Add a subextension to the file. For example, styles.css.njk is a nunjucks file that output the file styles.css.
  • Or include the url variable in the frontmatter or named module. For example:
export const url = "feed.rss";

In base-blog you have examples of both methods:

  • Nunjucks template that exports a xml file with the RSS. Link
  • Javascript template that exports a Json Feed. Link

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@shah
Comment options

Answer selected by shah
Comment options

You must be logged in to vote
0 replies
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