1
0
Fork 0

🚧 Tweaks to READMEs

This commit is contained in:
Joost De Cock 2019-04-21 12:57:12 +02:00
parent 99f1327015
commit 067338271d
55 changed files with 9144 additions and 11803 deletions

View file

@ -205,7 +205,11 @@ function badges(pkg, config) {
for (let group of ["_all", "_social"]) {
markup += "<p align='center'>";
for (let key of Object.keys(config.badges[group])) {
markup += formatBadge(config.badges[group][key], fullName(pkg, config));
markup += formatBadge(
config.badges[group][key],
pkg,
fullName(pkg, config)
);
}
markup += "</p>";
}
@ -216,12 +220,12 @@ function badges(pkg, config) {
/**
* Formats a badge for a readme file
*/
function formatBadge(badge, fullname) {
function formatBadge(badge, name, fullname) {
return `<a
href="${Mustache.render(badge.link, { fullname })}"
title="${Mustache.render(badge.alt, { fullname })}"
><img src="${Mustache.render(badge.img, { fullname })}"
alt="${Mustache.render(badge.alt, { fullname })}"/>
href="${Mustache.render(badge.link, { name, fullname })}"
title="${Mustache.render(badge.alt, { name, fullname })}"
><img src="${Mustache.render(badge.img, { name, fullname })}"
alt="${Mustache.render(badge.alt, { name, fullname })}"/>
</a>`;
}
/**

View file

@ -9,7 +9,10 @@ tmp_registry_log=`mktemp`
rm -rf $DIR/../.registry
mkdir -p $DIR/../.registry
cp $DIR/../config/verdaccio.yaml $DIR/../.registry/config.yaml
cp $DIR/../config/verdaccio.css $DIR/../node_modules/verdaccio/static/freesewing.css
cp $DIR/../media/logo-emblem-dark.svg $DIR/../node_modules/verdaccio/static/logo.svg
# Adding a space to the closing head tag ensures we'll only insert this CSS once
sed -i 's@</head>@<link href="/-/static/freesewing.css" rel="stylesheet"></head >@' $DIR/../node_modules/verdaccio/static/index.html
sh -c "npx verdaccio -c $DIR/../.registry/config.yaml &>$tmp_registry_log"
# wait for `verdaccio` to boot
grep -q 'http address' <(tail -f $tmp_registry_log)