forked from yoshuawuyts/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
25 lines (18 loc) · 914 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var learnblocks = require('@docs/learnblocks');
var sidebar = require('@docs/sidebar');
var nav = require('@docs/nav');
var quicklinks = require('@docs/quicklinks');
var react = require('react');
require('webcomponents.js');
// register custom elements
document.registerElement('gh-button', require('@docs/gh-button'));
var learnblocksSelector = document.querySelector('.learn-blocks');
if (learnblocksSelector) react.renderComponent(learnblocks(), learnblocksSelector);
var navSelector = document.querySelector('.nav-sticky');
if (navSelector) react.renderComponent(nav(), navSelector);
var quickLinksSelector = document.querySelector('.quicklinks');
if (quickLinksSelector) react.renderComponent(quicklinks(), quickLinksSelector);
var sidebarSelector = document.querySelector('.sidebar');
if (sidebarSelector) react.renderComponent(sidebar()(), sidebarSelector);
// init metrics
require('@docs/metrics');