Further progress on registry UI.
Some checks failed
continuous-integration/drone/push Build is failing

Add package README view support and style adjustments
This commit is contained in:
Fabian Stamm
2020-07-31 20:16:12 +02:00
parent 0bee324519
commit 7fcdf2c383
13 changed files with 336 additions and 76 deletions

View File

@ -1,11 +1,13 @@
import { ABC } from "../deps.ts";
import { basicauth } from "../utils.ts";
import { basicauth, extractPackagePath } from "../utils.ts";
export default function views(g: ABC.Group) {
export default function views(g: ABC.Application) {
g.get(
"/",
async (ctx) => {
return ctx.render("index");
return ctx.render("index", {
search: ctx.queryParams["q"],
});
// const render = await IndexView();
// console.log(render);
// ctx.response.body = render;
@ -13,4 +15,15 @@ export default function views(g: ABC.Group) {
},
basicauth("views")
);
g.get(
"/package/:package",
async (ctx) => {
let [packageName, packageVersion] = extractPackagePath(
ctx.params.package
);
return ctx.render("package", { packageName });
},
basicauth("views")
);
}