How to create a new template view?

I’ve already forked the diary template and tried to create a new html file for this “Blog” page. But this new blog.html file does not show anywhere on the published site. I would like to display a link to this page inside the header.

My understanding is that it has to do with the views in the package.json file, but I’d like to learn more about the best way to implement this properly.

2 replies

By default, blog.html has the URL /blog.html.

You can change this in your template's configuration file, which is called package.json. For example, consider the package.json property for archives.html.

Let's say you want blog.html to have the URL /blog. You would add the following to the views key in package.json:

...
    "blog.html": {
      "url": "/blog"
    },
...

Does that make sense? Please let me know if you have any questions about this or anything else

Answered 2 years ago · Improve this answer

Thank you so much, it worked :)

Answered 2 years ago · Improve this answer

Markdown allowed
Question or feedback?
Contact us

Tags

developers 28 questions bug 14 questions posts 9 questions resolved 7 questions request 6 questions google-drive 5 questions configure 4 questions pages 3 questions added 3 questions meta 3 questions More tags →
Subscribe for changes
RSS Feed of latest questions