chore: remove hard-coded link (#1692)

This commit is contained in:
Henry Wang
2019-03-06 12:12:44 +08:00
committed by DIYgod
parent 7063558eb3
commit 3c92131c8a
+4 -2
View File
@@ -5,6 +5,8 @@ module.exports = async (ctx) => {
const namespace = `${owner}/${image}`;
const link = `https://hub.docker.com/r/${namespace}`;
const data = await axios.get(`https://hub.docker.com/v2/repositories/${namespace}/tags/?page_size=5`);
const metadata = await axios.get(`https://hub.docker.com/v2/repositories/${namespace}`);
@@ -12,7 +14,7 @@ module.exports = async (ctx) => {
const out = list.map((item) => ({
title: `${namespace}:${tag} was built. ${(item.images[0].size / 1000000).toFixed(2)} MB`,
link: `https://hub.docker.com/r/wangqiru/ttrss/`,
link,
author: owner,
pubDate: item.last_updated,
}));
@@ -20,7 +22,7 @@ module.exports = async (ctx) => {
ctx.state.data = {
title: `${namespace}:${tag} build history`,
description: metadata.description,
link: `https://hub.docker.com/r/${namespace}`,
link,
item: out,
};
};