docs: add "only=npm" query to index for debugging

pull/54/head
Amio 2018-07-30 23:33:31 +08:00
rodzic dbf4f4d839
commit 3c53d69d64
1 zmienionych plików z 5 dodań i 1 usunięć

Wyświetl plik

@ -213,8 +213,12 @@ Made with ❤️ by [Amio](https://github.com/amio)
`)}</div>
`
// use "?only=npm" to show only "npm" badge examples
const only = window.liveBadges[new URL(window.location).searchParams.get('only')]
const badges = only ? { [only]: window.liveBadges[only] } : window.liveBadges
render(
genExamples(window.liveBadges),
genExamples(badges),
document.querySelector('#live-badge-examples')
)
</script>