Paths

Endpoints

The endpoint nodes for your pages (of whatever Type) will be defined by your data source. By default this corresponds to the structure of folders and files in your content/ folder, for example:

     
  • content/index.json = https://example.com/
  •  
  • content/blog/post1.json = https://example.com/blog/post1
  •  
  • content/events/My_Event.json = https://example.com/events/my-event
  •  

    If you want to have a content source without a path (no node endpoint that site visitors can access), simply delete the corresponding svelte template in layout/content/. You can do this automatically use the "endpoint" flag when creating a new type, for example: plenti new type YOUR_TYPE --endpoint=false 

    Overriding Paths

    You can overide the default path structure in the site's configuration file (plenti.json). For example if you had a Type called pages and you wanted it to appear at the top level of the site and not in the format https://example.com/pages/page1, you could add the following to plenti.json

    "types": {
      "pages": "/:filename"
    }
     This would allow a content file located at content/pages/page1.json to appear in the following format: https://example.com/page1

    You can use any custom key that you define in your content source, e.g. :title, :date, etc in your path, for example: 

    "types": {
      "blog": "/blog/:field(author)/:field(title)"