From 3c92131c8a96bd6355f9d77c8cfc74aa128c3cac Mon Sep 17 00:00:00 2001 From: Henry Wang Date: Wed, 6 Mar 2019 04:12:44 +0000 Subject: [PATCH] chore: remove hard-coded link (#1692) --- lib/routes/dockerhub/build.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/routes/dockerhub/build.js b/lib/routes/dockerhub/build.js index 39bc739d86..b3306a6641 100644 --- a/lib/routes/dockerhub/build.js +++ b/lib/routes/dockerhub/build.js @@ -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, }; };