@@ -29,6 +29,18 @@ module.exports = function () {
29
29
30
30
var template = fs . readFileSync ( 'src/templates/components.html' , 'utf8' )
31
31
32
+ var componentsForNav = { }
33
+ components . map ( function ( component ) {
34
+ var componentTokens = component . replace ( 'src/components/' , '' ) . split ( '/' )
35
+ var category = componentTokens [ 0 ]
36
+
37
+ componentsForNav [ category ] = componentsForNav [ category ] || [ ]
38
+ componentsForNav [ category ] . push ( {
39
+ href : component . replace ( 'src' , '' ) . replace ( '.html' , '' ) + '/index.html' ,
40
+ name : getTitle ( component )
41
+ } )
42
+ } )
43
+
32
44
components . forEach ( function ( component ) {
33
45
var newDir = rmHtmlExt ( component . replace ( 'src/' , '' ) )
34
46
var newFile = newDir + '/index.html'
@@ -47,6 +59,7 @@ module.exports = function () {
47
59
frontMatter . footer = fs . readFileSync ( 'src/templates/footer.html' , 'utf8' )
48
60
frontMatter . analytics = fs . readFileSync ( 'src/templates/ga.html' , 'utf8' )
49
61
frontMatter . head = fs . readFileSync ( 'src/templates/head.html' , 'utf8' )
62
+ frontMatter . componentsForNav = componentsForNav
50
63
51
64
var moduleSrcs = { }
52
65
var getModules = postcss . plugin ( 'get-modules' , function ( ) {
0 commit comments