11ty / eleventy-plugin-vite

A plugin to use Vite with Eleventy
134 stars 10 forks source link

permalinks do not work for both production and dev #39

Closed ThePeach closed 1 year ago

ThePeach commented 1 year ago

I've started using this plugin after looking at the eleventy-plus-vite repo and porting it across my pre-existing project.

I found the use of permalinks a bit counter-intuitive:

for example:

I have a privacy.md page:

---
layout: page
title: Privacy, Scripts and Cookies
permalink: privacy-scripts-and-cookies
date: 2018-07-30
lastmod: 2018-07-30
eleventyExcludeFromCollections: true
---

# Privacy

If I use the above permalink it will work correctly when serving the site when developing, but it won't be outputted if I build it for production.

In order to make it work for production I have to use permalink: /public/privacy-scripts-and-cookies/index.html instead, but all related files won't load correctly (specifically the css)

Am I doing something wrong?

The configuration is basically the same you can see in the linked repo.

ThePeach commented 1 year ago

I'm going to answer my own question and close this, since it's an 11ty thing and has nothing to do with vite: the permalink should have been written as permalink: ./privacy-script-and-cookies/index.html. This fixed the above.