Skip to content

Commit a23d8ea

Browse files
committed
Don't display category in the component name
1 parent e0d7ee9 commit a23d8ea

File tree

10 files changed

+15
-10
lines changed

10 files changed

+15
-10
lines changed

components/articles/title-text-image/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ <h1 class="f2">Title Text with Image</h1>
3434
</article>
3535

3636
<section data-name="component-info" class="pa3 pa5-ns bt b--black-10 black-70" style="background: #fafafa;">
37-
<h1 class="f4 f3-ns mt4">Articles Title Text Image</h1>
37+
<h1 class="f4 f3-ns mt4">Title Text Image</h1>
3838

3939
<div class="cf">
4040
<div class="fl w-100 w-75-ns pr0 pr2-ns">

components/articles/title-text/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ <h1 class="">Title</h1>
3333
</article>
3434

3535
<section data-name="component-info" class="pa3 pa5-ns bt b--black-10 black-70" style="background: #fafafa;">
36-
<h1 class="f4 f3-ns mt4">Articles Title Text</h1>
36+
<h1 class="f4 f3-ns mt4">Title Text</h1>
3737

3838
<div class="cf">
3939
<div class="fl w-100 w-75-ns pr0 pr2-ns">

components/layout/flag-object-collapse/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
</div>
3030

3131
<section data-name="component-info" class="pa3 pa5-ns bt b--black-10 black-70" style="background: #fafafa;">
32-
<h1 class="f4 f3-ns mt4">Layout Flag Object Collapse</h1>
32+
<h1 class="f4 f3-ns mt4">Flag Object Collapse</h1>
3333

3434
<div class="cf">
3535
<div class="fl w-100 w-75-ns pr0 pr2-ns">

components/layout/flag-object/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</div>
2929

3030
<section data-name="component-info" class="pa3 pa5-ns bt b--black-10 black-70" style="background: #fafafa;">
31-
<h1 class="f4 f3-ns mt4">Layout Flag Object</h1>
31+
<h1 class="f4 f3-ns mt4">Flag Object</h1>
3232

3333
<div class="cf">
3434
<div class="fl w-100 w-75-ns pr0 pr2-ns">

components/layout/two-column-collapse-one/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h1>Column Two</h1>
2828
</article>
2929

3030
<section data-name="component-info" class="pa3 pa5-ns bt b--black-10 black-70" style="background: #fafafa;">
31-
<h1 class="f4 f3-ns mt4">Layout Two Column Collapse One</h1>
31+
<h1 class="f4 f3-ns mt4">Two Column Collapse One</h1>
3232

3333
<div class="cf">
3434
<div class="fl w-100 w-75-ns pr0 pr2-ns">

components/layout/two-column/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ <h1>Column Two</h1>
2828
</article>
2929

3030
<section data-name="component-info" class="pa3 pa5-ns bt b--black-10 black-70" style="background: #fafafa;">
31-
<h1 class="f4 f3-ns mt4">Layout Two Column</h1>
31+
<h1 class="f4 f3-ns mt4">Two Column</h1>
3232

3333
<div class="cf">
3434
<div class="fl w-100 w-75-ns pr0 pr2-ns">

components/nav/large-title-link-list/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
</nav>
2828

2929
<section data-name="component-info" class="pa3 pa5-ns bt b--black-10 black-70" style="background: #fafafa;">
30-
<h1 class="f4 f3-ns mt4">Nav Large Title Link List</h1>
30+
<h1 class="f4 f3-ns mt4">Large Title Link List</h1>
3131

3232
<div class="cf">
3333
<div class="fl w-100 w-75-ns pr0 pr2-ns">

components/nav/title-link-list/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
</nav>
2626

2727
<section data-name="component-info" class="pa3 pa5-ns bt b--black-10 black-70" style="background: #fafafa;">
28-
<h1 class="f4 f3-ns mt4">Nav Title Link List</h1>
28+
<h1 class="f4 f3-ns mt4">Title Link List</h1>
2929

3030
<div class="cf">
3131
<div class="fl w-100 w-75-ns pr0 pr2-ns">

src/components-build.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module.exports = function () {
4444
componentsForNav[category] = componentsForNav[category] || []
4545
componentsForNav[category].push({
4646
href: component.replace('src', '').replace('.html', '') + '/index.html',
47-
name: getTitle(component.split('/')[3])
47+
name: getName(component)
4848
})
4949
})
5050

@@ -68,6 +68,7 @@ module.exports = function () {
6868
var frontMatter = fmParsed.attributes || {}
6969
frontMatter.bodyClass = frontMatter.bodyClass || ''
7070
frontMatter.title = frontMatter.title || getTitle(component)
71+
frontMatter.name = frontMatter.name || getName(component)
7172
frontMatter.classes = getClasses(fmParsed.body).map(function(klass) {
7273
return '.' + klass
7374
})
@@ -114,3 +115,7 @@ function getTitle(component) {
114115
var title = rmHtmlExt(component).replace('src/components/', '').replace(/(\/|_|-)/g, ' ')
115116
return titleize(title)
116117
}
118+
119+
function getName(component) {
120+
return titleize(getTitle(component.split('/')[3]))
121+
}

src/templates/components.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<main>
1010
<%= content %>
1111
<section data-name="component-info" class="pa3 pa5-ns bt b--black-10 black-70" style="background: #fafafa;">
12-
<h1 class="f4 f3-ns mt4"><%= title %></h1>
12+
<h1 class="f4 f3-ns mt4"><%= name %></h1>
1313

1414
<div class="cf">
1515
<div class="fl w-100 w-75-ns pr0 pr2-ns">

0 commit comments

Comments
 (0)