gitoria

layouts

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmain4099e64aMerge branch 'font-segoe-ui' into mainAtlasmain/project.hl

7.3 KB

  1. // project.hl — layouts.worldapi.org: THE MAP. The WorldAPI theme (theme/) and the showcase site that shows it: every
  2. // themed element and component, the three app shells as mock apps, the docs. No login, no data.
  3. //
  4. // Index (which file handles what):
  5. // theme/theme.hl the theme: tokens, plain elements, the components' themed rules (apps copy theme/)
  6. // theme/shell/*.hl header, main menu, user menu, sidebar, content-first, list-first, three-pane
  7. // theme/check-theme.mjs the gate helper apps run: hard-coded colours, decorative borders
  8. // components/styles.hl the site's styles file (inherits the theme)
  9. // components/main.hl the site's body shell (+ the accent the switcher kept)
  10. // components/site-*.hl the showcase's header and sidebar; accent-switcher.hl the switcher
  11. // components/home.hl, elements.hl, search.hl, pages/*.hl, list-pages.hl the showcase pages
  12. // components/showcase/*.hl one page per themed component; components/<name>/ = verbatim copies of components.hybriel
  13. // lib/media.hl the media player showcase's files: components/showcase/media served with ranges (a media element seeks)
  14. // components/demo/*.hl the shell demos (mock tracker, notes, mail); lib/mock.hl their data, lib/site.hl the menus
  15. // components/settings.hl /settings: the header's Settings (the accent switcher), in the app shell
  16. // components/read.hl, lib/read.hl /read/:doc: docs and component READMEs read INSIDE the app shell (the raw .md stay routable for tools, nothing links to them)
  17. // lib/search.hl the header's search (GET /search?q= → /search/<words>)
  18. // docs/ the docs, served as Markdown under /docs/
  19. import WebFramework from 'hl:web'
  20. import { env, exit } from 'hl:proc'
  21. import Styles from './components/styles.hl'
  22. import Home from './components/home.hl'
  23. import Elements from './components/elements.hl'
  24. import Search from './components/search.hl'
  25. import ReadPage from './components/read.hl'
  26. import SettingsPage from './components/settings.hl'
  27. import ComponentsPage from './components/pages/components.hl'
  28. import ShellsPage from './components/pages/shells.hl'
  29. import DocsPage from './components/pages/docs.hl'
  30. import ShowMonthView from './components/showcase/month-view.hl'
  31. import ShowDatePicker from './components/showcase/date-picker.hl'
  32. import ShowRangePicker from './components/showcase/range-picker.hl'
  33. import ShowPagination from './components/showcase/pagination.hl'
  34. import ShowMdEditor from './components/showcase/md-editor.hl'
  35. import ShowCodeEditor from './components/showcase/code-editor.hl'
  36. import ShowFileUpload from './components/showcase/file-upload.hl'
  37. import ShowModal from './components/showcase/modal.hl'
  38. import ShowComments from './components/showcase/comments.hl'
  39. import ShowFilesUpload from './components/showcase/files-upload.hl'
  40. import ShowFilesUploadPick from './components/showcase/files-upload-pick.hl'
  41. import ShowMediaPlayer from './components/showcase/media-player.hl'
  42. import ContentFirstDemo from './components/demo/tracker-demo.hl'
  43. import ListFirstDemo from './components/demo/notes-demo.hl'
  44. import ThreePaneDemo from './components/demo/mail-demo.hl'
  45. import { siteName } from './lib/site.hl'
  46. import { serve as serveMedia } from './lib/media.hl'
  47. import { searchRedirect } from './lib/search.hl'
  48. appTitle = siteName
  49. appDescription = 'The WorldAPI theme for Hybriel apps: tokens, themed components, app shells.'
  50. styles = Styles
  51. static markdown = { 'Content-Type' = 'text/markdown; charset=utf-8' 'Cache-Control' = 'no-cache' }
  52. routes = [
  53. { pattern = "/" component = Home }
  54. { pattern = "/elements" component = Elements }
  55. { pattern = "/settings" component = SettingsPage }
  56. { pattern = "/read/:doc" component = ReadPage }
  57. { pattern = "/search" function = (route, req) => { return searchRedirect(req) } }
  58. { pattern = "/search/:q" component = Search }
  59. { pattern = "/components" component = ComponentsPage }
  60. { pattern = "/components/month-view" component = ShowMonthView }
  61. { pattern = "/components/date-picker" component = ShowDatePicker }
  62. { pattern = "/components/range-picker" component = ShowRangePicker }
  63. { pattern = "/components/pagination" component = ShowPagination }
  64. { pattern = "/components/md-editor" component = ShowMdEditor }
  65. { pattern = "/components/code-editor" component = ShowCodeEditor }
  66. { pattern = "/components/file-upload" component = ShowFileUpload }
  67. { pattern = "/components/modal" component = ShowModal }
  68. { pattern = "/components/comments" component = ShowComments }
  69. { pattern = "/components/files-upload" component = ShowFilesUpload }
  70. { pattern = "/components/files-upload-pick" component = ShowFilesUploadPick }
  71. { pattern = "/components/media-player" component = ShowMediaPlayer }
  72. { pattern = "/components/month-view/README.md" file = "./components/month-view/README.md" headers = markdown }
  73. { pattern = "/components/date-picker/README.md" file = "./components/date-picker/README.md" headers = markdown }
  74. { pattern = "/components/range-picker/README.md" file = "./components/range-picker/README.md" headers = markdown }
  75. { pattern = "/components/pagination/README.md" file = "./components/pagination/README.md" headers = markdown }
  76. { pattern = "/components/md-editor/README.md" file = "./components/md-editor/README.md" headers = markdown }
  77. { pattern = "/components/code-editor/README.md" file = "./components/code-editor/README.md" headers = markdown }
  78. { pattern = "/components/file-upload/README.md" file = "./components/file-upload/README.md" headers = markdown }
  79. { pattern = "/components/modal/README.md" file = "./components/modal/README.md" headers = markdown }
  80. { pattern = "/components/comments/README.md" file = "./components/comments/README.md" headers = markdown }
  81. { pattern = "/components/files-upload/README.md" file = "./components/files-upload/README.md" headers = markdown }
  82. { pattern = "/components/media-player/README.md" file = "./components/media-player/README.md" headers = markdown }
  83. { pattern = "/media/*" function = (route, req) => { return serveMedia(req) } }
  84. { pattern = "/shells" component = ShellsPage }
  85. { pattern = "/shells/content-first" component = ContentFirstDemo }
  86. { pattern = "/shells/content-first/:kind" component = ContentFirstDemo }
  87. { pattern = "/shells/list-first" component = ListFirstDemo }
  88. { pattern = "/shells/list-first/:id" component = ListFirstDemo }
  89. { pattern = "/shells/three-pane" component = ThreePaneDemo }
  90. { pattern = "/shells/three-pane/:id" component = ThreePaneDemo }
  91. { pattern = "/docs" component = DocsPage }
  92. { pattern = "/docs/*" directory = "./docs" headers = markdown }
  93. { pattern = "/theme/check-theme.mjs" file = "./theme/check-theme.mjs" headers = { 'Content-Type' = 'text/javascript; charset=utf-8' 'Cache-Control' = 'no-cache' } }
  94. ]
  95. port = env('LAYOUTS_PORT') != null ? toNumber(env('LAYOUTS_PORT')) : 8760
  96. // HL_HOST = the interface hl:web binds: 127.0.0.1 on Byrodin behind nginx; unset = 0.0.0.0 (dev on Loreana).
  97. // LAYOUTS_WATCH=0 = no dev watcher. No sessions are kept (no login, no data).
  98. watching = env('LAYOUTS_WATCH') != '0'
  99. server = new WebFramework(routes = routes, styles = styles, minify = true, port = port, watchMode = watching, sessionDir = false, sessionCookie = 'layoutssid', uploadMax = 5242880, sessionMaxAge = 3122064000)
  100. on Error(e) {
  101. if (e.phase == 'startup') { console.log('layouts: startup error: ' + e.message) exit(1) }
  102. console.log('error absorbed: ' + e.message)
  103. }

Branches

Latest commits

  • 4099e64aMerge branch 'font-segoe-ui' into mainAtlas
  • e14fb795|||PR Theme font: Segoe UI first (his choice 2026-11-19)Atlas
  • 44071d2cMerge branch 'hl-standard-5' into mainAtlas
  • 5ea64202|||PR Gate: count the new-tab check's console errors tooAtlas
  • 2752ceddMerge branch 'hl-standard-4' into mainAtlas
  • ac552b81|||PR Gate: keyboard (Tab/Enter/Space) and Back/Forward/reload/new-tab checks (HL-STANDARD F5, F21)Atlas
  • 8cddcaa9Merge branch 'hl-standard-2' into mainAtlas
  • 2b480a64|||PR Type the route parameter of main-menu build (HL-STANDARD L10)Atlas
  • ab54a39dMerge branch 'hl-standard' into mainAtlas
  • 04d36fcf|||PR Type function parameters and drop unneeded let (HL-STANDARD L2, L10)Atlas
  • 220c8fa4Merge branch 'readme-audit' into mainAtlas
  • b78fb85a|||PR README matches the codemre
  • 9f351699Preserve comments and nest supported selectors without changing rendered outputmre
  • 97110ad9WIP: nest accepted layout selectors; stopped at startup parse failuremre
  • ce4a0baeKeep caller slot styles whole so minimal shell apps startmre
  • 12cd3992Re-vendor complete Hybriel plugins and runtime to day44mre
  • b05c20feBackup tar: --hard-dereference, so mpackdb sidecars are never stored as hard links (Tracker's finding)mre
  • 8d9ed0b8Re-vendor complete Hybriel plugins and runtime to day39mre
  • ebd00b6cNest caller slot styles in three-panemre
  • 009991efNest caller slot styles in list-firstmre