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

Update projects permalink to be file name of projects (resolves #497) #511

Merged
merged 4 commits into from Mar 27, 2023

Conversation

chosww
Copy link
Contributor

@chosww chosww commented Mar 10, 2023

  • This pull request has been tested by running npm run test without errors
  • This pull request has been built by running npm run build without errors
  • This isn't a duplicate of an existing pull request

Description

The issue described in #497 suggests using a new slug for projects to be used as url, but @cindyli said that adding the slug doesn't prevent 404 error. File name is unique to project, and even when I try to create a project with same title, duplicated file name is handled by 11ty by adding numbers after the file name, so the system guarantees file name to be unique.

Related issues

Resolves #497

@netlify
Copy link

netlify bot commented Mar 10, 2023

Deploy Preview for idrc ready!

Name Link
🔨 Latest commit a3419d9
🔍 Latest deploy log https://app.netlify.com/sites/idrc/deploys/6421d0744ad1110008268056
😎 Deploy Preview https://deploy-preview-511--idrc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@chosww chosww requested a review from cindyli March 10, 2023 19:16
@cindyli
Copy link
Contributor

cindyli commented Mar 10, 2023

Thanks for the fix, @chosww. Using file slugs does resolve 404 error when changing a project title.

There's another feature request in the ticket - it's possible that a project has a longer project title and would like a shorter slug. For example: Floe might want the title "Flexible Learning for Open Education" but have a shorter slug like "floe/".

This feature requires to add an extra field on the authoring interface so that users can define the permalink. If users don't define it, the file slugs will be used.

An example of this implementation can be found on the "Pages" authoring interface. See https://github.com/inclusive-design/idrc/blob/dev/src/admin/config.yml#L190. Moreover, it will be more user friendly to add a hint for this new field suggesting the user defined permalink follows a pattern of /projects/my-project to match other project URLs that all have a prefix of /projects/.

@chosww
Copy link
Contributor Author

chosww commented Mar 10, 2023

Thanks for the fix, @chosww. Using file slugs does resolve 404 error when changing a project title.

There's another feature request in the ticket - it's possible that a project has a longer project title and would like a shorter slug. For example: Floe might want the title "Flexible Learning for Open Education" but have a shorter slug like "floe/".

This feature requires to add an extra field on the authoring interface so that users can define the permalink. If users don't define it, the file slugs will be used.

An example of this implementation can be found on the "Pages" authoring interface. See https://github.com/inclusive-design/idrc/blob/dev/src/admin/config.yml#L190. Moreover, it will be more user friendly to add a hint for this new field suggesting the user defined permalink follows a pattern of /projects/my-project to match other project URLs that all have a prefix of /projects/.

Oh, so we keep the field I talked about. But how would we ensure that the field value is unique? Projects with the same URL field value would be a problem.

@chosww
Copy link
Contributor Author

chosww commented Mar 13, 2023

@jhung Could you check label and hint texts for projects permalink field please? Also, message to communicate required body field when permalink field is entered. Thanks!

@jhung jhung self-requested a review March 22, 2023 18:04
src/admin/config.yml Outdated Show resolved Hide resolved
src/admin/config.yml Outdated Show resolved Hide resolved
Co-authored-by: jhung <jhung@ocadu.ca>
@cindyli cindyli merged commit 7df217e into inclusive-design:dev Mar 27, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changing project title text changes the project slug causing 404 errors
3 participants