decaporg/decap-cms

Long post titles can lead to invalid hostnames in Netlify deploy previews

Opened this issue · 6 comments

fool commented

- Do you want to request a feature or report a bug?

bug

- What is the current behavior?

CMS entries for posts with long titles can create branch names too long for deploy previews via Netlify's standard branch deploy naming scheme. DNS hostnames can be a maximum of 64 characters per "segment" so "a-very-long-blog-post-title-because-i-am-a-really-really-wordy-dude--sitename.netlify.com" will not be a usable hostname and thus the URL will fail to load with various/unspecified bad behavior.

- If the current behavior is a bug, please provide the steps to reproduce.

create a post with a title longer than 64 characters and attempt to load the branch deploy from the deploys tab in Netlify's UI

- What is the expected behavior?

Branch deploys would be loadable by their normal hostname, branchname--sitename.netlify.com . Since there is no way for the CMS to know what "sitename" is there we should probably pick a short-ish cut-off like 40 characters - it won't solve EVERY situation but it will do better than the current which allows you to create an impossible branchname of >64 characters which will NEVER load properly (even for a sitename like 'a.netlify.com').

- Please mention your node.js, and operating system version.

Netlify default build (node v6.11.2 (npm v3.10.10)/ubuntu 14.04 x86_64) && CMS version 0.4.4

Good point. Since we don't want to enforce Netlify-specific rules, is to allow a configurable max-length, and maybe set the default to something around 40.

I really don't think we should do anything to the title here -- that's part of the content. I think the real thing that we should be looking at is keeping slugs and branch names shorter, not the title. Thoughts?

Although, many CMS's do limit title length, so it's not strictly a bad idea.

fool commented

@erquhart How it is related to design? I didn't get it.

Design also encompasses architectural design.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.