Unify slugify()
Provides a new util.js file with a unified `slugify()` function that also lowercases the slug. Change all uses of `slugify()` to use this instead.
This commit is contained in:
parent
b9fe8c7f38
commit
6109bb690d
5 changed files with 15 additions and 6 deletions
|
|
@ -1,9 +1,9 @@
|
|||
import hljs from 'highlight.js';
|
||||
import React, { Component } from 'react';
|
||||
import Markdown from 'react-markdown';
|
||||
import slugify from 'slugify';
|
||||
|
||||
import { NotFound } from './NotFound';
|
||||
import { slugify } from './util';
|
||||
|
||||
|
||||
class Page extends Component {
|
||||
|
|
@ -25,7 +25,7 @@ class Page extends Component {
|
|||
for (let page of blob.pages) {
|
||||
let slug = page.slug;
|
||||
if (!slug) {
|
||||
slug = slugify(page.title).toLowerCase();
|
||||
slug = slugify(page.title);
|
||||
}
|
||||
|
||||
if (slug === this.params.slug) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue