Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Projects with duplicate Titles causes a "DuplicatePermalinkOutputError" #487

Closed
jhung opened this issue Feb 28, 2023 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@jhung
Copy link
Member

jhung commented Feb 28, 2023

Describe the bug

If two project sub-pages have the same title like "About this project", upon saving the sub-page, a "DuplicatePermalinkOutputError" appears.

image

To Reproduce

Steps to reproduce the behavior:

  1. Create a project sub-page.
  2. Give it a Title "Test" and publish it.
  3. Create another project sub-page (can be a sub-page of the same project or a different one).
  4. Give it a Title "Test" and publish it.
  5. See the error occur

Expected behavior

There can be a couple different ways to solve this:

  • Preferred method: Generate permalinks for sub-pages prefixed with the project name (maybe the short name)
  • Less-preferred method: Append a unique ID or number to the end of duplicate permalinks.
  • Least-preferred method: Throw an error on submission asking the user to use a different Title as it's already used.
@jhung jhung added the bug Something isn't working label Feb 28, 2023
@jhung
Copy link
Member Author

jhung commented Mar 1, 2023

When trying to run npm run build you will receive this error if two projects share the same Title.

[build:eleventy] [11ty] Problem writing Eleventy templates: (more in DEBUG output)
[build:eleventy] [11ty] Output conflict: multiple input files are writing to `dist/projects/test-sub-sub-page-2/index.html`. Use distinct `permalink` values to resolve this conflict.
[build:eleventy] [11ty]   1. ./src/projects/test-sub-sub-page-2-1.md
[build:eleventy] [11ty]   2. ./src/projects/test-sub-sub-page-2.md (via DuplicatePermalinkOutputError)
[build:eleventy] [11ty]
[build:eleventy] [11ty] Original error stack trace: (Repeated output has been truncated…)
[build:eleventy] [11ty]     at TemplateMap.checkForDuplicatePermalinks (C:\Users\jhung\development\idrc\node_modules\@11ty\eleventy\src\TemplateMap.js:656:13)
[build:eleventy] [11ty]     at TemplateMap.cache (C:\Users\jhung\development\idrc\node_modules\@11ty\eleventy\src\TemplateMap.js:365:10)
[build:eleventy] [11ty]     at processTicksAndRejections (internal/process/task_queues.js:95:5)
[build:eleventy] [11ty]     at async TemplateWriter._createTemplateMap (C:\Users\jhung\development\idrc\node_modules\@11ty\eleventy\src\TemplateWriter.js:244:5)
[build:eleventy] [11ty]     at async TemplateWriter.generateTemplates (C:\Users\jhung\development\idrc\node_modules\@11ty\eleventy\src\TemplateWriter.js:277:5)
[build:eleventy] [11ty]     at async TemplateWriter.write (C:\Users\jhung\development\idrc\node_modules\@11ty\eleventy\src\TemplateWriter.js:323:23)
[build:eleventy] [11ty]     at async Eleventy.executeBuild (C:\Users\jhung\development\idrc\node_modules\@11ty\eleventy\src\Eleventy.js:1003:13)
[build:eleventy] [11ty] Copied 2 files / Wrote 0 files in 0.87 seconds (v1.0.2)

@chosww chosww self-assigned this Mar 13, 2023
@chosww
Copy link
Contributor

chosww commented Jun 9, 2023

Hey @jhung, I think this issue is resolved with #511, could you check this issue again please?

@greatislander
Copy link
Member

I think this could also be resolved by #631 (or perhaps that's what you mean in your preferred method, @jhung).

@greatislander
Copy link
Member

I tested and confirmed that #511 resolved this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants