gitoria
All repositories: gitoria
1.5 KB
// components/readme.hl — THE README VIEW of a repo (ticket #8, gitoria#16): `/` on <slug>.<domain>, composed// into components/index.hl. Rendered on the SERVER with its content: the repo from the request's host, the// README.md / $docs Markdown from git (git.hl homepageNow — hl:proc run() waits, hybriel#80).import RepoHead from './repohead.hl'import Markdown from './markdown.hl'import { repoAt } from '../repos.hl'import { homepageNow } from '../git.hl'import { slugOfHost } from '../users.hl'host = nullslug = slugOfHost(host)repo = repoAt(slug)hasRepo = repo != nullhome = repo != null ? homepageNow(slug, repo.branch) : nulldocsFound = home != null && home.founddocsNone = home != null && !home.founddocsTruncated = home != null && home.truncateddocs = home != null ? home.files : []View {repoPage {RepoHead { }if (hasRepo) {dl {dt { "Address" }dd { a { id = "repoaddress" href = repo.address repo.address } }dt { "Owner" }dd { id = "repoowner" repo.owner }dt { "Created" }dd { time { id = "repocreated" repo.created } }}if (docsNone) { p { id = "nohomepage" class = "empty" "This repository has no README.md yet. Open the box “Add code to this repository” above to see how to push code." } }if (docsFound) {repoHomepage { id = "homepage"for (d of docs) {homepageFile {if (d.isDocs) { code { class = "path" d.path } }Markdown { blocks = d.blocks }}}if (docsTruncated) { p { id = "docstruncated" class = "muted" "Very long files are cut off here." } }}}}}}
Branches
- mainmain branch
Latest commits
- 4a2d7125initial commitmre