leoncvlt / loconotion

📄 Python tool to turn Notion.so pages into lightweight, customizable static websites
838 stars 132 forks source link

"ERROR Found duplicate pages with slug 'XXX.html' - previous one will be overwritten. Make sure that your notion pages names or custom slugs in the configuration files are unique" #55

Open jamesdeluk opened 3 years ago

jamesdeluk commented 3 years ago

Any chance this can be replaced with a if slug exists, rename to slug-2 or similar?

leoncvlt commented 3 years ago

I think the only time it gets triggered is when an user accidentally matches multiple pages when parsing a notion slug into a readable one (can't imagine a case where notion pages have clashing slug urls) - in which case I think we want to display a warning, as that shouldn't be happening

jamesdeluk commented 3 years ago

I've had it several times.

For example, originally, both of these were called "Networking": https://www.notion.so/jamesdeluk/Networking-Commands-7619b77db07346e89fea8d177fbb0bff https://www.notion.so/jamesdeluk/Networking-Notes-cbd27999f00a460fb5127e0fdb940632

Both linked from here, the primarily page being parsed: https://www.notion.so/jamesdeluk/James-IT-Notes-9969909992c04b5ba3a734cdf0a74530

When it was finished parsing/processing, all links to the first page actually linked to the second - the first was overwritten, and there was only a single networking.html page in the dist folder.

leoncvlt commented 3 years ago

Are you using custom slugs? Those urls should be parsed into pages called "networking-commands.html" and "networking-notes.html" as the code should only strip the guiid in on the end

jamesdeluk commented 3 years ago

They are parsed that way now, but originally the pages were:

https://www.notion.so/jamesdeluk/Networking-7619b77db07346e89fea8d177fbb0bff https://www.notion.so/jamesdeluk/Networking-cbd27999f00a460fb5127e0fdb940632

and hence both became networking.html

leoncvlt commented 3 years ago

Ah I see, makes sense, got a better understanding of the issue now - you're right, it's worth adding automatic page renaming if the name clashes with another one rather than simply overwriting it

adhadse commented 3 years ago

What if we want to keep up UUID intact in URLs?