gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit55c8477955c84779Merge branch 'gp-gate-ports' into mainGitoria55c84779/components/readme.hl

2.7 KB

  1. // components/readme.hl — THE README VIEW of a repo (ticket #8, gitoria#16): `/` on <slug>.<domain>, composed
  2. // into components/index.hl. Rendered on the SERVER with its content: the repo from the request's host, the
  3. // README.md / $docs Markdown from git (lib/homepage.hl homepageNow — hl:proc run() waits, hybriel#80).
  4. import Markdown from './markdown.hl'
  5. import { slugOfRequest } from '../lib/orgs.hl'
  6. import { px, repoOrigin } from '../lib/util.hl'
  7. import { forwardOf } from '../lib/forwards.hl'
  8. import { repoAt } from '../lib/repos.hl'
  9. import { homepageNow } from '../lib/homepage.hl'
  10. host = null
  11. orepo = ''
  12. session = null
  13. slug = slugOfRequest(host, orepo)
  14. repo = repoAt(slug, session)
  15. hasRepo = repo != null
  16. pre = px(slug)
  17. codeHref = pre + '/code'
  18. movedTo = repo == null ? forwardOf(slug) : null
  19. wasMoved = movedTo != null
  20. movedHref = movedTo != null ? repoOrigin(movedTo) + '/' : ''
  21. home = repo != null ? homepageNow(slug, repo.branch) : null
  22. docsFound = home != null && home.found
  23. docsNone = home != null && !home.found
  24. docsTruncated = home != null && home.truncated
  25. docs = home != null ? home.files : []
  26. View {
  27. repoPage {
  28. if (wasMoved) { p { id = "moved" "This repository moved to " a { id = "movedlink" href = movedHref movedTo } "." } }
  29. if (hasRepo) {
  30. dl {
  31. dt { "Address" }
  32. dd { a { id = "repoaddress" href = repo.address repo.address } }
  33. dt { "Owner" }
  34. dd { id = "repoowner" repo.owner }
  35. dt { "Created" }
  36. dd { time { id = "repocreated" repo.created } }
  37. }
  38. if (docsNone) { p { id = "nohomepage" class = "empty" "This repository has no README.md yet. Open the " a { id = "tocode" href = codeHref "Code" } " page to see how to push code." } }
  39. if (docsFound) {
  40. repoHomepage { id = "homepage"
  41. for (d of docs) {
  42. homepageFile {
  43. if (d.isDocs) { code { d.path } }
  44. Markdown { blocks = d.blocks }
  45. }
  46. }
  47. if (docsTruncated) { p { id = "docstruncated" class = "muted" "Very long files are cut off here." } }
  48. }
  49. }
  50. }
  51. }
  52. }
  53. Style {
  54. #moved {
  55. margin = '0'
  56. color = 'var(--color-success)'
  57. }
  58. #dl {
  59. display = 'grid'
  60. gridTemplateColumns = 'auto minmax(0, 1fr)'
  61. gap = '.3rem 1rem'
  62. alignItems = 'center'
  63. margin = '0'
  64. dt {
  65. color = 'var(--color-text-muted)'
  66. }
  67. dd {
  68. margin = '0'
  69. overflowWrap = 'anywhere'
  70. // Direct-child selectors have no bare language form.
  71. '> a' {
  72. display = 'inline-flex'
  73. alignItems = 'center'
  74. minHeight = '2.75rem'
  75. }
  76. }
  77. }
  78. homepageFile {
  79. display = 'grid'
  80. gap = '.5rem'
  81. minWidth = '0'
  82. // Direct-child universal selectors have no bare language form.
  83. '> *' {
  84. margin = '0'
  85. }
  86. }
  87. #code {
  88. color = 'var(--color-text-muted)'
  89. fontSize = '.875rem'
  90. background = 'transparent'
  91. padding = '0'
  92. }
  93. repoHomepage {
  94. display = 'grid'
  95. gap = '1.5rem'
  96. minWidth = '0'
  97. }
  98. }

Branches

Latest commits

  • 55c84779Merge branch 'gp-gate-ports' into mainGitoria
  • 57af42bbREADME: point to deploy.sh for the port listmre
  • d63375d2README: gate commands with explicit portsmre
  • feeaa701|||PR gates: explicit ports only, deploy.sh passes themmre
  • 6cc1f943Merge branch 'records-1112' into mainGitoria
  • 9448c438|||PR records: LOG, missions and reports since 11-09mre
  • 6dc08a8eMerge branch 'p51-public-pr-reads' into mainGitoria
  • 7b88cfe0Type publicReaderOfRequest parameters (L10)Gitoria
  • 2a4b3dc1|||PR Anonymous reads of public repos' pulls and statusesmre
  • 21b2c141Merge branch 's25-no-session-on-login-error' into mainGitoria
  • 698458e2|||PR No session for cookieless login errors: READMEmre
  • cce7b785|||PR No session for cookieless login errorsmre
  • 678d6303Merge branch 'v59' into mainGitoria
  • 5803cf4f|||PR vendor: Hybriel set-day59 and GC budget 32 MiBmre
  • 9eff6627Merge branch 'f2-api-bugs' into mainGitoria
  • 26117255|||PR apps API: review comments on files with spaces in their namemre
  • b8796cecMerge branch 'f1-broken-json' into mainGitoria
  • 2f2959c5|||PR apps API: broken JSON body gives 400 invalid_json, not 500mre
  • f7c6ca07Merge branch 'ident-chooser-selector' into mainGitoria
  • 691abb8e|||PR tests: find ident identity choice without the removed .choose classmre