chore(docs): replace all spaces with dashes

This commit is contained in:
Ibby
2017-03-16 17:00:10 -04:00
parent 0c2e84c9c0
commit d498f9823a
3 changed files with 5 additions and 4 deletions
+2 -1
View File
@@ -164,7 +164,8 @@ module.exports = function(currentVersion) {
templateEngine.filters.push(
require('./filters/capital'),
require('./filters/code'),
require('./filters/dump')
require('./filters/dump'),
require('./filters/dashify')
);
templateFinder.templateFolders.unshift(path.resolve(__dirname, 'templates'));
+1 -1
View File
@@ -17,7 +17,7 @@ module.exports = function jekyll(renderDocsProcessor) {
return (textA < textB) ? -1 : (textA > textB) ? 1 : 0;
});
docs.forEach(function(doc, i) {
doc.outputPath = doc.outputPath.toLowerCase().replace(' ', '-');
doc.outputPath = doc.outputPath.toLowerCase().replace(/\s/g, '-');
docs[i].URL = doc.outputPath.replace('docs/v2//', 'docs/v2/')
.replace('/index.md', '')
.replace('content/', '');
+2 -2
View File
@@ -1,9 +1,9 @@
<@ for doc in docs @><@ if doc.URL and doc.private != true and doc.beta != true @>
<li class="capitalize {% if page.id == '<$ doc.name|lower|replace(' ','-') $>' %}active{% endif %}">
<li class="capitalize {% if page.id == '<$ doc.name|lower|dashify $>' %}active{% endif %}">
<a href="/<$ doc.URL $>"><$ doc.name $></a>
</li><@ endif @><@ endfor @>
<@ for doc in docs @><@ if doc.URL and doc.private != true and doc.beta == true @>
<li class="capitalize {% if page.id == '<$ doc.name|lower|replace(' ','-') $>' %}active{% endif %}">
<li class="capitalize {% if page.id == '<$ doc.name|lower|dashify $>' %}active{% endif %}">
<a href="/<$ doc.URL $>"><$ doc.name $> <span class="beta">&beta;</span></a>
</li><@ endif @><@ endfor @>