Add support for pagespeed and languages plugins for repository template

This commit is contained in:
lowlighter
2021-01-10 21:19:57 +01:00
parent 52e5d53025
commit b6a3a1d020
5 changed files with 205 additions and 59 deletions

View File

@@ -578,10 +578,10 @@ Used template defaults to the `classic` one.
<tr> <tr>
<th>Repository<sup>R</sup></th> <th>Repository<sup>R</sup></th>
<td data-for="base">✔️</td> <td data-for="base">✔️</td>
<td data-for="pagespeed"></td> <td data-for="pagespeed"><span title="Available on @master">✔️<sup>M</sup></span></td>
<td data-for="isocalendar">❌</td> <td data-for="isocalendar">❌</td>
<td data-for="music">❌</td> <td data-for="music">❌</td>
<td data-for="languages"></td> <td data-for="languages"><span title="Available on @master">✔️<sup>M</sup></span></td>
<td data-for="followup">✔️</td> <td data-for="followup">✔️</td>
<td data-for="topics">❌</td> <td data-for="topics">❌</td>
<td data-for="projects">✔️</td> <td data-for="projects">✔️</td>

View File

@@ -4,6 +4,7 @@ query Repository {
name name
createdAt createdAt
diskUsage diskUsage
homepageUrl
watchers { watchers {
totalCount totalCount
} }

View File

@@ -145,6 +145,38 @@
</div> </div>
<% } %> <% } %>
<% if (plugins.languages) { %>
<section class="column">
<h3>Most used languages</h3>
<% if (plugins.languages.error) { %>
<section>
<div class="field error">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M2.343 13.657A8 8 0 1113.657 2.343 8 8 0 012.343 13.657zM6.03 4.97a.75.75 0 00-1.06 1.06L6.94 8 4.97 9.97a.75.75 0 101.06 1.06L8 9.06l1.97 1.97a.75.75 0 101.06-1.06L9.06 8l1.97-1.97a.75.75 0 10-1.06-1.06L8 6.94 6.03 4.97z"></path></svg>
<%= plugins.languages.error.message %>
</div>
</section>
<% } else { %>
<svg class="bar" xmlns="http://www.w3.org/2000/svg" width="460" height="8">
<mask id="languages-bar">
<rect x="0" y="0" width="460" height="8" fill="white" rx="5"/>
</mask>
<rect mask="url(#languages-bar)" x="0" y="0" width="<%= plugins.languages.favorites.length ? 0 : 460 %>" height="8" fill="#d1d5da"/>
<% for (const {name, value, color, x} of plugins.languages.favorites) { %>
<rect mask="url(#languages-bar)" x="<%= x*460 %>" y="0" width="<%= value*460 %>" height="8" fill="<%= color %>"/>
<% } %>
</svg>
<div class="field center horizontal-wrap fill-width">
<% for (const {name, value, color} of plugins.languages.favorites) { %>
<div class="field center no-wrap language">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill="<%= color %>" fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8z"></path></svg>
<%= name %>
</div>
<% } %>
</div>
<% } %>
</section>
<% } %>
<% if (plugins.projects) { %> <% if (plugins.projects) { %>
<section> <section>
<h2 class="field"> <h2 class="field">
@@ -205,54 +237,166 @@
</section> </section>
<% } %> <% } %>
<% } %> <% if (plugins.pagespeed) { %>
<div class="row">
<% if (plugins.stargazers) { %> <section>
<section> <h2 class="field">
<h2 class="field"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M14.064 0a8.75 8.75 0 00-6.187 2.563l-.459.458c-.314.314-.616.641-.904.979H3.31a1.75 1.75 0 00-1.49.833L.11 7.607a.75.75 0 00.418 1.11l3.102.954c.037.051.079.1.124.145l2.429 2.428c.046.046.094.088.145.125l.954 3.102a.75.75 0 001.11.418l2.774-1.707a1.75 1.75 0 00.833-1.49V9.485c.338-.288.665-.59.979-.904l.458-.459A8.75 8.75 0 0016 1.936V1.75A1.75 1.75 0 0014.25 0h-.186zM10.5 10.625c-.088.06-.177.118-.266.175l-2.35 1.521.548 1.783 1.949-1.2a.25.25 0 00.119-.213v-2.066zM3.678 8.116L5.2 5.766c.058-.09.117-.178.176-.266H3.309a.25.25 0 00-.213.119l-1.2 1.95 1.782.547zm5.26-4.493A7.25 7.25 0 0114.063 1.5h.186a.25.25 0 01.25.25v.186a7.25 7.25 0 01-2.123 5.127l-.459.458a15.21 15.21 0 01-2.499 2.02l-2.317 1.5-2.143-2.143 1.5-2.317a15.25 15.25 0 012.02-2.5l.458-.458h.002zM12 5a1 1 0 11-2 0 1 1 0 012 0zm-8.44 9.56a1.5 1.5 0 10-2.12-2.12c-.734.73-1.047 2.332-1.15 3.003a.23.23 0 00.265.265c.671-.103 2.273-.416 3.005-1.148z"></path></svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25zm0 2.445L6.615 5.5a.75.75 0 01-.564.41l-3.097.45 2.24 2.184a.75.75 0 01.216.664l-.528 3.084 2.769-1.456a.75.75 0 01.698 0l2.77 1.456-.53-3.084a.75.75 0 01.216-.664l2.24-2.183-3.096-.45a.75.75 0 01-.564-.41L8 2.694v.001z"></path></svg> PageSpeed Insights
Stargazers over the last two weeks </h2>
</h2> <div class="field">
<% if (plugins.stargazers.error) { %> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg>
<div class="field error"> <%= plugins.pagespeed.url %>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M2.343 13.657A8 8 0 1113.657 2.343 8 8 0 012.343 13.657zM6.03 4.97a.75.75 0 00-1.06 1.06L6.94 8 4.97 9.97a.75.75 0 101.06 1.06L8 9.06l1.97 1.97a.75.75 0 101.06-1.06L9.06 8l1.97-1.97a.75.75 0 10-1.06-1.06L8 6.94 6.03 4.97z"></path></svg> </div>
<%= plugins.stargazers.error.message %> </section>
</div>
<% if (plugins.pagespeed.error) { %>
<div class="row">
<section>
<div class="field error">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M2.343 13.657A8 8 0 1113.657 2.343 8 8 0 012.343 13.657zM6.03 4.97a.75.75 0 00-1.06 1.06L6.94 8 4.97 9.97a.75.75 0 101.06 1.06L8 9.06l1.97 1.97a.75.75 0 101.06-1.06L9.06 8l1.97-1.97a.75.75 0 10-1.06-1.06L8 6.94 6.03 4.97z"></path></svg>
<%= plugins.pagespeed.error.message %>
</div>
</section>
</div> </div>
<% } else { %> <% } else { %>
<div class="row margin-bottom"> <section>
<section class="column chart"> <div class="row fill-width">
<h3>Total stargazers</h3> <section class="categories">
<div class="chart-bars"> <% for (const {score, title} of plugins.pagespeed.scores) { %>
<% { let previous = null; for (const [date, value] of Object.entries(plugins.stargazers.total.dates)) { const p = 0.05+0.95*(value-plugins.stargazers.total.min)/(plugins.stargazers.total.max-plugins.stargazers.total.min); const [y, m, d] = date.split("-").map(Number) %> <div class="categorie column">
<div class="entry"> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 120" width="50" height="50" class="gauge <%= !Number.isNaN(score) ? (score >= 0.9 ? 'high' : score >= 0.5 ? 'average' : 'low') : '' %>">
<span class="value"><%= (value-(previous ?? 0)) ? value : "" %></span> <circle class="gauge-base" r="53" cx="60" cy="60"></circle>
<div class="bar" style="height: <%= p*50 %>px; background-color: var(--color-calendar-graph-day-L<%= Math.ceil(p/0.25) %>-bg)"></div> <% if (!Number.isNaN(score)) { %>
<%= d %> <circle class="gauge-arc" transform="rotate(-90 60 60)" r="53" cx="60" cy="60" stroke-dasharray="<%= score * 329 %> 329"></circle>
<% if ((previous === null)||(d === 1)) { %> <text x="60" y="60" dominant-baseline="central" ><%= Math.round(score*100) %></text>
<div class="bottom"><%= plugins.stargazers.months[m] %></div> <% } else { %>
<text x="60" y="60" dominant-baseline="central" >-</text>
<% } %>
</svg>
<span class="title"><%= title %></span>
</div>
<% } %>
</section>
</div>
</section>
<% if (plugins.pagespeed.detailed) { %>
<div class="audits row">
<section>
<div class="field">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M5.75.75A.75.75 0 016.5 0h3a.75.75 0 010 1.5h-.75v1l-.001.041a6.718 6.718 0 013.464 1.435l.007-.006.75-.75a.75.75 0 111.06 1.06l-.75.75-.006.007a6.75 6.75 0 11-10.548 0L2.72 5.03l-.75-.75a.75.75 0 011.06-1.06l.75.75.007.006A6.718 6.718 0 017.25 2.541a.756.756 0 010-.041v-1H6.5a.75.75 0 01-.75-.75zM8 14.5A5.25 5.25 0 108 4a5.25 5.25 0 000 10.5zm.389-6.7l1.33-1.33a.75.75 0 111.061 1.06L9.45 8.861A1.502 1.502 0 018 10.75a1.5 1.5 0 11.389-2.95z"></path></svg>
Time to interactive
</div>
<div class="field">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8 1.5a6.5 6.5 0 106.016 4.035.75.75 0 011.388-.57 8 8 0 11-4.37-4.37.75.75 0 01-.569 1.389A6.479 6.479 0 008 1.5zm6.28.22a.75.75 0 010 1.06l-4.063 4.064a2.5 2.5 0 11-1.06-1.06L13.22 1.72a.75.75 0 011.06 0zM7 8a1 1 0 112 0 1 1 0 01-2 0z"></path></svg>
Speed Index
</div>
<div class="field">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M1.643 3.143L.427 1.927A.25.25 0 000 2.104V5.75c0 .138.112.25.25.25h3.646a.25.25 0 00.177-.427L2.715 4.215a6.5 6.5 0 11-1.18 4.458.75.75 0 10-1.493.154 8.001 8.001 0 101.6-5.684zM7.75 4a.75.75 0 01.75.75v2.992l2.028.812a.75.75 0 01-.557 1.392l-2.5-1A.75.75 0 017 8.25v-3.5A.75.75 0 017.75 4z"></path></svg>
Total Blocking Time
</div>
<div class="field">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M11.134 1.535C9.722 2.562 8.16 4.057 6.889 5.312 5.8 6.387 5.041 7.401 4.575 8.294a3.745 3.745 0 00-3.227 1.054c-.43.431-.69 1.066-.86 1.657a11.982 11.982 0 00-.358 1.914A21.263 21.263 0 000 15.203v.054l.75-.007-.007.75h.054a14.404 14.404 0 00.654-.012 21.243 21.243 0 001.63-.118c.62-.07 1.3-.18 1.914-.357.592-.17 1.226-.43 1.657-.861a3.745 3.745 0 001.055-3.217c.908-.461 1.942-1.216 3.04-2.3 1.279-1.262 2.764-2.825 3.775-4.249.501-.706.923-1.428 1.125-2.096.2-.659.235-1.469-.368-2.07-.606-.607-1.42-.55-2.069-.34-.66.213-1.376.646-2.076 1.155zm-3.95 8.48a3.76 3.76 0 00-1.19-1.192 9.758 9.758 0 011.161-1.607l1.658 1.658a9.853 9.853 0 01-1.63 1.142zM.742 16l.007-.75-.75.008A.75.75 0 00.743 16zM12.016 2.749c-1.224.89-2.605 2.189-3.822 3.384l1.718 1.718c1.21-1.205 2.51-2.597 3.387-3.833.47-.662.78-1.227.912-1.662.134-.444.032-.551.009-.575h-.001V1.78c-.014-.014-.112-.113-.548.027-.432.14-.995.462-1.655.942zM1.62 13.089a19.56 19.56 0 00-.104 1.395 19.55 19.55 0 001.396-.104 10.528 10.528 0 001.668-.309c.526-.151.856-.325 1.011-.48a2.25 2.25 0 00-3.182-3.182c-.155.155-.329.485-.48 1.01a10.515 10.515 0 00-.309 1.67z"></path></svg>
First Contentful Paint
</div>
<div class="field">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M1.75 2.5a.25.25 0 00-.25.25v10.5c0 .138.112.25.25.25h.94a.76.76 0 01.03-.03l6.077-6.078a1.75 1.75 0 012.412-.06L14.5 10.31V2.75a.25.25 0 00-.25-.25H1.75zm12.5 11H4.81l5.048-5.047a.25.25 0 01.344-.009l4.298 3.889v.917a.25.25 0 01-.25.25zm1.75-.25V2.75A1.75 1.75 0 0014.25 1H1.75A1.75 1.75 0 000 2.75v10.5C0 14.216.784 15 1.75 15h12.5A1.75 1.75 0 0016 13.25zM5.5 6a.5.5 0 11-1 0 .5.5 0 011 0zM7 6a2 2 0 11-4 0 2 2 0 014 0z"></path></svg>
Largest Contentful Paint
</div>
<div class="field">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.75 14A1.75 1.75 0 016 12.25v-8.5C6 2.784 6.784 2 7.75 2h6.5c.966 0 1.75.784 1.75 1.75v8.5A1.75 1.75 0 0114.25 14h-6.5zm-.25-1.75c0 .138.112.25.25.25h6.5a.25.25 0 00.25-.25v-8.5a.25.25 0 00-.25-.25h-6.5a.25.25 0 00-.25.25v8.5zM4.9 3.508a.75.75 0 01-.274 1.025.25.25 0 00-.126.217v6.5a.25.25 0 00.126.217.75.75 0 01-.752 1.298A1.75 1.75 0 013 11.25v-6.5c0-.649.353-1.214.874-1.516a.75.75 0 011.025.274zM1.625 5.533a.75.75 0 10-.752-1.299A1.75 1.75 0 000 5.75v4.5c0 .649.353 1.214.874 1.515a.75.75 0 10.752-1.298.25.25 0 01-.126-.217v-4.5a.25.25 0 01.126-.217z"></path></svg>
Cumulative Layout Shift
</div>
</section>
<section>
<% for (const {score, suffix = "", threshold} of [
{score:plugins.pagespeed.metrics.interactive/1000, suffix:"s", threshold:[3.785, 7.3]},
{score:plugins.pagespeed.metrics.speedIndex/1000, suffix:"s", threshold:[3.387, 5.8]},
{score:plugins.pagespeed.metrics.totalBlockingTime/1000, suffix:"s", threshold:[.287, .6]},
{score:plugins.pagespeed.metrics.firstContentfulPaint/1000, suffix:"s", threshold:[2.336, 4]},
{score:plugins.pagespeed.metrics.largestContentfulPaint/1000, suffix:"s", threshold:[2.5, 4]},
{score:+plugins.pagespeed.metrics.cumulativeLayoutShift, threshold:[.1, .25]}
]) { %>
<div class="field">
<div class="audit text">
<% if (!Number.isNaN(score)) { %>
<%= score.toFixed(2).replace(/[.]0+$/, "") %> <%= suffix %>
<% } else { %>
N/A
<% } %> <% } %>
</div> </div>
<% previous = value } } %> <% if (Number.isNaN(score)) { %>
</div> <svg xmlns="http://www.w3.org/2000/svg" class="audit" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zM8 0a8 8 0 100 16A8 8 0 008 0zm3.28 5.78a.75.75 0 00-1.06-1.06l-5.5 5.5a.75.75 0 101.06 1.06l5.5-5.5z"></path></svg>
</section> <% } else if (score <= threshold[0]) { %>
<section class="column chart"> <svg xmlns="http://www.w3.org/2000/svg" class="audit high" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0zM0 8a8 8 0 1116 0A8 8 0 010 8zm11.78-1.72a.75.75 0 00-1.06-1.06L6.75 9.19 5.28 7.72a.75.75 0 00-1.06 1.06l2 2a.75.75 0 001.06 0l4.5-4.5z"></path></svg>
<h3>New stargazers per day</h3> <% } else if (score <= threshold[1]) { %>
<div class="chart-bars"> <svg xmlns="http://www.w3.org/2000/svg" class="audit average" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8zm9 3a1 1 0 11-2 0 1 1 0 012 0zm-.25-6.25a.75.75 0 00-1.5 0v3.5a.75.75 0 001.5 0v-3.5z"></path></svg>
<% { let previous = true; for (const [date, value] of Object.entries(plugins.stargazers.increments.dates)) { const p = value/plugins.stargazers.increments.max; const [y, m, d] = date.split("-").map(Number) %> <% } else { %>
<div class="entry"> <svg xmlns="http://www.w3.org/2000/svg" class="audit low" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M4.47.22A.75.75 0 015 0h6a.75.75 0 01.53.22l4.25 4.25c.141.14.22.331.22.53v6a.75.75 0 01-.22.53l-4.25 4.25A.75.75 0 0111 16H5a.75.75 0 01-.53-.22L.22 11.53A.75.75 0 010 11V5a.75.75 0 01.22-.53L4.47.22zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5H5.31zM8 4a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 018 4zm0 8a1 1 0 100-2 1 1 0 000 2z"></path></svg>
<span class="value"><%= value != 0 ? value : "" %></span> <% } %>
<div class="bar" style="height: <%= p*50 %>px; background-color: var(--color-calendar-graph-day-L<%= Math.ceil(p/0.25) %>-bg)"></div> </div>
<%= d %> <% } %>
<% if ((previous === null)||(d === 1)) { %> </section>
<div class="bottom"><%= plugins.stargazers.months[m] %></div> </div>
<% } %> <% } %>
</div> <% if (plugins.pagespeed.screenshot) { %>
<% previous = value } } %> <div class="row">
</div> <section>
</section> <img class="screenshot" src="<%= plugins.pagespeed.screenshot %>" width="452" height="315"/>
</div> </section>
</div>
<% } %>
<% } %> <% } %>
</section> <% } %>
<% if (plugins.stargazers) { %>
<section>
<h2 class="field">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.75.75 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25zm0 2.445L6.615 5.5a.75.75 0 01-.564.41l-3.097.45 2.24 2.184a.75.75 0 01.216.664l-.528 3.084 2.769-1.456a.75.75 0 01.698 0l2.77 1.456-.53-3.084a.75.75 0 01.216-.664l2.24-2.183-3.096-.45a.75.75 0 01-.564-.41L8 2.694v.001z"></path></svg>
Stargazers over the last two weeks
</h2>
<% if (plugins.stargazers.error) { %>
<div class="field error">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M2.343 13.657A8 8 0 1113.657 2.343 8 8 0 012.343 13.657zM6.03 4.97a.75.75 0 00-1.06 1.06L6.94 8 4.97 9.97a.75.75 0 101.06 1.06L8 9.06l1.97 1.97a.75.75 0 101.06-1.06L9.06 8l1.97-1.97a.75.75 0 10-1.06-1.06L8 6.94 6.03 4.97z"></path></svg>
<%= plugins.stargazers.error.message %>
</div>
<% } else { %>
<div class="row margin-bottom">
<section class="column chart">
<h3>Total stargazers</h3>
<div class="chart-bars">
<% { let previous = null; for (const [date, value] of Object.entries(plugins.stargazers.total.dates)) { const p = 0.05+0.95*(value-plugins.stargazers.total.min)/(plugins.stargazers.total.max-plugins.stargazers.total.min); const [y, m, d] = date.split("-").map(Number) %>
<div class="entry">
<span class="value"><%= (value-(previous ?? 0)) ? value : "" %></span>
<div class="bar" style="height: <%= p*50 %>px; background-color: var(--color-calendar-graph-day-L<%= Math.ceil(p/0.25) %>-bg)"></div>
<%= d %>
<% if ((previous === null)||(d === 1)) { %>
<div class="bottom"><%= plugins.stargazers.months[m] %></div>
<% } %>
</div>
<% previous = value } } %>
</div>
</section>
<section class="column chart">
<h3>New stargazers per day</h3>
<div class="chart-bars">
<% { let previous = true; for (const [date, value] of Object.entries(plugins.stargazers.increments.dates)) { const p = value/plugins.stargazers.increments.max; const [y, m, d] = date.split("-").map(Number) %>
<div class="entry">
<span class="value"><%= value != 0 ? value : "" %></span>
<div class="bar" style="height: <%= p*50 %>px; background-color: var(--color-calendar-graph-day-L<%= Math.ceil(p/0.25) %>-bg)"></div>
<%= d %>
<% if ((previous === null)||(d === 1)) { %>
<div class="bottom"><%= plugins.stargazers.months[m] %></div>
<% } %>
</div>
<% previous = value } } %>
</div>
</section>
</div>
<% } %>
</section>
<% } %>
<% } %> <% } %>
<% if (base.metadata) { %> <% if (base.metadata) { %>

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -30,9 +30,10 @@
} }
console.debug(`metrics/compute/${login}/${repo} > ${commits.length} commits loaded`) console.debug(`metrics/compute/${login}/${repo} > ${commits.length} commits loaded`)
//Override creation date and disk usage //Override creation date, disk usage and website url
data.user.createdAt = repository.createdAt data.user.createdAt = repository.createdAt
data.user.repositories.totalDiskUsage = repository.diskUsage data.user.repositories.totalDiskUsage = repository.diskUsage
data.user.websiteUrl = repository.homepageUrl
//Override contributions calendar //Override contributions calendar
const days = 14 const days = 14

View File

@@ -86,24 +86,24 @@
}], }],
["PageSpeed plugin (default)", { ["PageSpeed plugin (default)", {
plugin_pagespeed:true, plugin_pagespeed:true,
}, {skip:["repository"]}], }],
["PageSpeed plugin (different url)", { ["PageSpeed plugin (different url)", {
plugin_pagespeed:true, plugin_pagespeed:true,
plugin_pagespeed_url:"github.com", plugin_pagespeed_url:"github.com",
}, {skip:["repository"]}], }],
["PageSpeed plugin (detailed)", { ["PageSpeed plugin (detailed)", {
plugin_pagespeed:true, plugin_pagespeed:true,
plugin_pagespeed_detailed:true, plugin_pagespeed_detailed:true,
}, {skip:["repository"]}], }],
["PageSpeed plugin (screenshot)", { ["PageSpeed plugin (screenshot)", {
plugin_pagespeed:true, plugin_pagespeed:true,
plugin_pagespeed_screenshot:true, plugin_pagespeed_screenshot:true,
}, {skip:["repository"]}], }],
["PageSpeed plugin (complete)", { ["PageSpeed plugin (complete)", {
plugin_pagespeed:true, plugin_pagespeed:true,
plugin_pagespeed_detailed:true, plugin_pagespeed_detailed:true,
plugin_pagespeed_screenshot:true, plugin_pagespeed_screenshot:true,
}, {skip:["repository"]}], }],
["Isocalendar plugin (default)", { ["Isocalendar plugin (default)", {
plugin_isocalendar: true, plugin_isocalendar: true,
}, {skip:["terminal", "repository"]}], }, {skip:["terminal", "repository"]}],
@@ -129,20 +129,20 @@
}, {skip:["terminal", "repository"]}], }, {skip:["terminal", "repository"]}],
["Language plugin (default)", { ["Language plugin (default)", {
plugin_languages:true, plugin_languages:true,
}, {skip:["repository"]}], }],
["Language plugin (ignored languages)", { ["Language plugin (ignored languages)", {
plugin_languages:true, plugin_languages:true,
plugin_languages_ignored:"html, css, dockerfile", plugin_languages_ignored:"html, css, dockerfile",
}, {skip:["repository"]}], }],
["Language plugin (skipped repositories)", { ["Language plugin (skipped repositories)", {
plugin_languages:true, plugin_languages:true,
plugin_languages_skipped:"metrics", plugin_languages_skipped:"metrics",
}, {skip:["repository"]}], }],
["Language plugin (complete)", { ["Language plugin (complete)", {
plugin_languages:true, plugin_languages:true,
plugin_languages_ignored:"html, css, dockerfile", plugin_languages_ignored:"html, css, dockerfile",
plugin_languages_skipped:"metrics", plugin_languages_skipped:"metrics",
}, {skip:["repository"]}], }],
["Follow-up plugin (default)", { ["Follow-up plugin (default)", {
plugin_followup:true, plugin_followup:true,
}], }],
@@ -241,20 +241,20 @@
plugin_activity_limit:100, plugin_activity_limit:100,
plugin_activity_days:14, plugin_activity_days:14,
plugin_activity_filter:"all", plugin_activity_filter:"all",
}, {skip:["terminal"]}], }, {skip:["terminal", "repository"]}],
["Activity plugin (filtered)", { ["Activity plugin (filtered)", {
plugin_activity:true, plugin_activity:true,
plugin_activity_filter:"pr, issue", plugin_activity_filter:"pr, issue",
}, {skip:["terminal"]}], }, {skip:["terminal", "repository"]}],
["Stars plugin (default)", { ["Stars plugin (default)", {
plugin_stars:true, plugin_stars:true,
}, {skip:["terminal"]}], }, {skip:["terminal", "repository"]}],
["Stargazers plugin (default)", { ["Stargazers plugin (default)", {
plugin_stargazers:true, plugin_stargazers:true,
}, {skip:["terminal"]}], }, {skip:["terminal"]}],
["Gists plugin (default)", { ["Gists plugin (default)", {
plugin_gists:true, plugin_gists:true,
}, {skip:["terminal"]}], }, {skip:["terminal", "repository"]}],
] ]
//Tests run //Tests run