Further progress on registry UI.
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
Add package README view support and style adjustments
This commit is contained in:
@ -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")
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user