Add support for isHireable (#19)

This commit is contained in:
Simon Lecoq
2020-12-14 13:14:48 +01:00
committed by GitHub
parent 9741b6512d
commit 42096fac42
7 changed files with 16 additions and 7 deletions

View File

@@ -956,7 +956,7 @@ Read [CONTRIBUTING.md](CONTRIBUTING.md) for more information about this.
## 📖 Useful references ## 📖 Useful references
* [GitHub GraphQL API](https://docs.github.com/en/graphql) * [GitHub GraphQL API](https://docs.github.com/en/graphql)
* [GitHub GraphQL Explorer](https://developer.github.com/v4/explorer/) * [GitHub GraphQL Explorer](https://docs.github.com/en/free-pro-team@latest/graphql/overview/explorer)
* [GitHub Rest API](https://docs.github.com/en/rest) * [GitHub Rest API](https://docs.github.com/en/rest)
* [GitHub Octicons](https://github.com/primer/octicons) * [GitHub Octicons](https://github.com/primer/octicons)
* See [GitHub Logos and Usage](https://github.com/logos) for more information. * See [GitHub Logos and Usage](https://github.com/logos) for more information.

File diff suppressed because one or more lines are too long

View File

@@ -1,6 +1,6 @@
{ {
"name": "metrics", "name": "metrics",
"version": "2.7.0", "version": "2.8.0-beta",
"description": "Generate an user's GitHub metrics as SVG image format to embed somewhere else", "description": "Generate an user's GitHub metrics as SVG image format to embed somewhere else",
"main": "index.mjs", "main": "index.mjs",
"scripts": { "scripts": {

View File

@@ -13,7 +13,9 @@
<!-- Vue app --> <!-- Vue app -->
<main :class="[palette]"> <main :class="[palette]">
<!-- Title --> <!-- Title -->
<template>
<h1><a href="https://github.com/lowlighter/metrics">Metrics v{{ version }}</a></h1> <h1><a href="https://github.com/lowlighter/metrics">Metrics v{{ version }}</a></h1>
</template>
<!-- Content --> <!-- Content -->
<template> <template>
<section class="generator"> <section class="generator">

View File

@@ -151,7 +151,7 @@
Object.assign(data, { Object.assign(data, {
s(_, letter) { return letter === "y" ? "ies" : "s" }, s(_, letter) { return letter === "y" ? "ies" : "s" },
meta:{version:conf.package.version, author:conf.package.author, placeholder:true}, meta:{version:conf.package.version, author:conf.package.author, placeholder:true},
user:proxify({name:`############`, websiteUrl:`########################`}), user:proxify({name:`############`, websiteUrl:`########################`, isHireable:false}),
computed:proxify({ computed:proxify({
avatar:"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOcOnfpfwAGfgLYttYINwAAAABJRU5ErkJggg==", avatar:"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mOcOnfpfwAGfgLYttYINwAAAABJRU5ErkJggg==",
registration:"## years ago", registration:"## years ago",

View File

@@ -42,6 +42,12 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M5.5 3.5a2 2 0 100 4 2 2 0 000-4zM2 5.5a3.5 3.5 0 115.898 2.549 5.507 5.507 0 013.034 4.084.75.75 0 11-1.482.235 4.001 4.001 0 00-7.9 0 .75.75 0 01-1.482-.236A5.507 5.507 0 013.102 8.05 3.49 3.49 0 012 5.5zM11 4a.75.75 0 100 1.5 1.5 1.5 0 01.666 2.844.75.75 0 00-.416.672v.352a.75.75 0 00.574.73c1.2.289 2.162 1.2 2.522 2.372a.75.75 0 101.434-.44 5.01 5.01 0 00-2.56-3.012A3 3 0 0011 4z"></path></svg> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M5.5 3.5a2 2 0 100 4 2 2 0 000-4zM2 5.5a3.5 3.5 0 115.898 2.549 5.507 5.507 0 013.034 4.084.75.75 0 11-1.482.235 4.001 4.001 0 00-7.9 0 .75.75 0 01-1.482-.236A5.507 5.507 0 013.102 8.05 3.49 3.49 0 012 5.5zM11 4a.75.75 0 100 1.5 1.5 1.5 0 01.666 2.844.75.75 0 00-.416.672v.352a.75.75 0 00.574.73c1.2.289 2.162 1.2 2.522 2.372a.75.75 0 101.434-.44 5.01 5.01 0 00-2.56-3.012A3 3 0 0011 4z"></path></svg>
Followed by <%= user.followers.totalCount %> user<%= s(user.followers.totalCount) %> Followed by <%= user.followers.totalCount %> user<%= s(user.followers.totalCount) %>
</div> </div>
<% if (user.isHireable) { %>
<div class="field hire">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M6.75 0A1.75 1.75 0 005 1.75V3H1.75A1.75 1.75 0 000 4.75v8.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0016 13.25v-8.5A1.75 1.75 0 0014.25 3H11V1.75A1.75 1.75 0 009.25 0h-2.5zM9.5 3V1.75a.25.25 0 00-.25-.25h-2.5a.25.25 0 00-.25.25V3h3zM5 4.5H1.75a.25.25 0 00-.25.25V6a2 2 0 002 2h9a2 2 0 002-2V4.75a.25.25 0 00-.25-.25H5zm-1.5 5a3.484 3.484 0 01-2-.627v4.377c0 .138.112.25.25.25h12.5a.25.25 0 00.25-.25V8.873a3.484 3.484 0 01-2 .627h-9z"></path></svg>
Available for hire !
</div>
<% } %>
</section> </section>
<section> <section>
<div class="field calendar"> <div class="field calendar">
@@ -664,7 +670,7 @@
<% if (base.metadata) { %> <% if (base.metadata) { %>
<footer> <footer>
<span>These metrics <%= !computed.token.scopes.includes("repo") ? "does not include" : "includes" %> private contributions</span> <span>These metrics <%= !computed.token.scopes.includes("repo") ? "does not include" : "includes" %> private contributions</span>
<span>Last updated <%= new Date() %></span> <span>Last updated <%= new Date().toGMTString() %> with lowlighter/metrics@<%= meta.version %></span>
</footer> </footer>
<% } %> <% } %>

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 64 KiB

View File

@@ -6,6 +6,7 @@ query Metrics {
createdAt createdAt
avatarUrl avatarUrl
websiteUrl websiteUrl
isHireable
gists { gists {
totalCount totalCount
} }