# Site.ts

`

1<comment>/**</comment>

2<comment> * Site documentation</comment>

3<comment> */</comment>

4

5<comment>/** */</comment>

6import * as hslayout from <quote>'hslayout'</quote>;

7import * as header from <quote>'./view/DocsMenu'</quote>;

8import * as left from <quote>'./view/LeftNav'</quote>;

9import * as main from <quote>'./view/MainDetail'</quote>;

10

11const design = {

12 root: { Layout: {

13 columns: [<quote>"200px"</quote>, <quote>"fill"</quote>],

14 css: <quote>".hsdocs"</quote>,

15 content: [<quote>"LeftPane"</quote>, <quote>"Main"</quote>]

16 }},

17 LeftPane: { Layout: {

18 css: <quote>".hsdocs_leftpane"</quote>,

19 rows: [<quote>"30px"</quote>, <quote>"fill"</quote>, <quote>"14px"</quote>],

20 content: [<quote>"title"</quote>, <quote>"leftnav"</quote>, <quote>"footer"</quote>]

21 }},

22 Main: { Layout: {

23 css: <quote>".hsdocs_left"</quote>,

24 rows: [<quote>"30px"</quote>, <quote>"fill"</quote>],

25 content: [<quote>"menu"</quote>, <quote>"mainDetail"</quote>]

26 }},

27 title: {<quote>"Layout"</quote>: {

28 css: <quote>".hsdocs_title"</quote>,

29 content: <quote>"hsDocs"</quote>,

30 href: <quote>"https:<comment>//github.com/HelpfulScripts/hsDocs"</quote> </comment>

31<comment></comment> }},

32 leftnav: {<quote>"LeftNav"</quote>: {

33 css: <quote>".hsdocs_leftnav"</quote>,

34 }},

35 footer: {<quote>"Layout"</quote>: {

36 css: <quote>".hsdocs_footer"</quote>,

37 content: <quote>"powered by <a href=<quote>'https:<comment>//github.com/HelpfulScripts/hsDocs'</quote> target=<quote>'_blank'</quote>>hsDocs"</quote></comment>

38<comment></comment> }},

39 menu: { <quote>"DocsMenu"</quote>: {

40 css: <quote>'.hsdocs_menu'</quote>,

41 docSet:<quote>"./data/index.json"</quote>

42 }},

43 mainDetail: {<quote>"MainDetail"</quote>: {

44 css: <quote>'.hsdocs_detail'</quote>,

45 }}

46};

47

48export function init() {

49 const Router = {

50 view: () => hslayout.m(hslayout.Config,

51 Object.assign({source:design, context: [hslayout, header, left, main]},

52 {

53 route: {field:hslayout.m.route.param(<quote>'field'</quote>),

54 lib:hslayout.m.route.param(<quote>'lib'</quote>)}

55 }

56 ))

57 };

58 hslayout.m.route(document.body, <quote>'/api'</quote>, {

59 <quote>'/api'</quote>: Router,

60 <quote>'/api/:lib'</quote>: Router,

61 <quote>'/api/:lib/:field'</quote>: Router

62 });

63}

64

`