diff --git a/frontend/index.js b/frontend/index.js index 7fe3a575c..160ef99d1 100644 --- a/frontend/index.js +++ b/frontend/index.js @@ -87,6 +87,9 @@ const KeyboardShortcuts = () => ( const Api = () => ; const DocumentNew = () => ; const DocumentNewChild = () => ; +const RedirectDocument = ({ match }: { match: Object }) => ( + +); render(
@@ -106,9 +109,22 @@ render( - + + - + { diff --git a/server/models/Document.js b/server/models/Document.js index f0f5e9001..206cb161c 100644 --- a/server/models/Document.js +++ b/server/models/Document.js @@ -9,7 +9,7 @@ import { convertToMarkdown } from '../../frontend/utils/markdown'; import { truncateMarkdown } from '../utils/truncate'; import Revision from './Revision'; -const URL_REGEX = /^[a-zA-Z0-9-]*-([a-zA-Z0-9]{10,15})$/; +const URL_REGEX = /^[a-zA-Z0-9-]*-([a-zA-Z]{10,15})$/; slug.defaults.mode = 'rfc3986'; const slugify = text => @@ -100,7 +100,7 @@ const Document = sequelize.define( instanceMethods: { getUrl() { const slugifiedTitle = slugify(this.title); - return `/d/${slugifiedTitle}-${this.urlId}`; + return `/doc/${slugifiedTitle}-${this.urlId}`; }, toJSON() { // Warning: only use for new documents as order of children is