Merge branch 'master' of https://github.com/lowlighter/metrics
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > contributors/commit")
|
||||
return /after: "MOCKED_CURSOR"/m.test(query)
|
||||
? ({
|
||||
user:{
|
||||
repositoryDiscussions:{
|
||||
edges:[],
|
||||
nodes:[],
|
||||
}
|
||||
}
|
||||
})
|
||||
: ({
|
||||
user:{
|
||||
repositoryDiscussions:{
|
||||
edges:new Array(100).fill(null).map(_ => ({cursor:"MOCKED_CURSOR"})),
|
||||
nodes:new Array(100).fill(null).map(_ => ({
|
||||
category:{
|
||||
emoji:faker.random.arrayElement([":chart_with_upwards_trend:", ":chart_with_downwards_trend:", ":bar_char:"]),
|
||||
name:faker.lorem.slug()
|
||||
}
|
||||
}))
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > contributors/commit")
|
||||
return ({
|
||||
user:{
|
||||
started:{totalCount:faker.datatype.number(1000)},
|
||||
comments:{totalCount:faker.datatype.number(1000)},
|
||||
answers:{totalCount:faker.datatype.number(1000)}
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/**Mocked data */
|
||||
export default function({faker, query, login = faker.internet.userName()}) {
|
||||
console.debug("metrics/compute/mocks > mocking graphql api result > stars/default")
|
||||
return ({
|
||||
repository:{
|
||||
createdAt: faker.date.past(),
|
||||
description:"📊 An image generator with 20+ metrics about your GitHub account such as activity, community, repositories, coding habits, website performances, music played, starred topics, etc. that you can put on your profile or elsewhere !",
|
||||
forkCount:faker.datatype.number(100),
|
||||
isFork:false,
|
||||
issues:{
|
||||
totalCount:faker.datatype.number(100),
|
||||
},
|
||||
nameWithOwner:"lowlighter/metrics",
|
||||
openGraphImageUrl:"https://repository-images.githubusercontent.com/293860197/7fd72080-496d-11eb-8fe0-238b38a0746a",
|
||||
pullRequests:{
|
||||
totalCount:faker.datatype.number(100),
|
||||
},
|
||||
stargazerCount:faker.datatype.number(10000),
|
||||
licenseInfo:{
|
||||
nickname:null,
|
||||
name:"MIT License",
|
||||
},
|
||||
primaryLanguage:{
|
||||
color:"#f1e05a",
|
||||
name:"JavaScript",
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -586,6 +586,20 @@
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Discussions
|
||||
...(set.plugins.enabled.discussions
|
||||
? ({
|
||||
discussions: {
|
||||
categories: {
|
||||
stats: { '🙏 Q&A': faker.datatype.number(100), '📣 Announcements': faker.datatype.number(100), '💡 Ideas': faker.datatype.number(100), '💬 General': faker.datatype.number(100) },
|
||||
favorite: '📣 Announcements'
|
||||
},
|
||||
started: faker.datatype.number(1000),
|
||||
comments: faker.datatype.number(1000),
|
||||
answers: faker.datatype.number(1000),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Posts
|
||||
...(set.plugins.enabled.posts
|
||||
? ({
|
||||
@@ -664,7 +678,31 @@
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Stars
|
||||
//Repositories
|
||||
...(set.plugins.enabled.repositories
|
||||
? ({
|
||||
repositories: {
|
||||
list: new Array(Number(options["repositories.featured"].split(",").length) - 1).fill(null).map((_, i) => ({
|
||||
created: faker.date.past(),
|
||||
description: faker.lorem.sentence(),
|
||||
forkCount: faker.datatype.number(100),
|
||||
isFork: faker.datatype.boolean(),
|
||||
issues: {
|
||||
totalCount: faker.datatype.number(100),
|
||||
},
|
||||
nameWithOwner: `${faker.random.word()}/${faker.random.word()}`,
|
||||
openGraphImageUrl: faker.internet.url(),
|
||||
pullRequests: {
|
||||
totalCount: faker.datatype.number(100),
|
||||
},
|
||||
stargazerCount: faker.datatype.number(10000),
|
||||
licenseInfo: { nickname: null, name: "License" },
|
||||
primaryLanguage: { color: faker.internet.color(), name: faker.lorem.word() },
|
||||
})),
|
||||
},
|
||||
})
|
||||
: null),
|
||||
//Stargazers
|
||||
...(set.plugins.enabled.stargazers
|
||||
? ({
|
||||
get stargazers() {
|
||||
|
||||
21
source/plugins/discussions/README.md
Normal file
21
source/plugins/discussions/README.md
Normal file
@@ -0,0 +1,21 @@
|
||||
### 💬 Discussions
|
||||
|
||||
The *discussions* plugin displays your GitHub discussions metrics.
|
||||
|
||||
<table>
|
||||
<td align="center">
|
||||
<img src="https://github.com/lowlighter/lowlighter/blob/master/metrics.plugin.discussions.svg">
|
||||
<img width="900" height="1" alt="">
|
||||
</td>
|
||||
</table>
|
||||
|
||||
#### ℹ️ Examples workflows
|
||||
|
||||
[➡️ Available options for this plugin](metadata.yml)
|
||||
|
||||
```yaml
|
||||
- uses: lowlighter/metrics@latest
|
||||
with:
|
||||
# ... other options
|
||||
plugin_discussions: yes
|
||||
```
|
||||
46
source/plugins/discussions/index.mjs
Normal file
46
source/plugins/discussions/index.mjs
Normal file
@@ -0,0 +1,46 @@
|
||||
//Setup
|
||||
export default async function({login, q, imports, graphql, queries, data, account}, {enabled = false} = {}) {
|
||||
//Plugin execution
|
||||
try {
|
||||
//Check if plugin is enabled and requirements are met
|
||||
if ((!enabled)||(!q.discussions))
|
||||
return null
|
||||
|
||||
//Load inputs
|
||||
imports.metadata.plugins.discussions.inputs({data, account, q})
|
||||
const discussions = {categories:{}}
|
||||
|
||||
//Fetch general statistics
|
||||
const stats = Object.fromEntries(Object.entries((await graphql(queries.discussions.statistics({login}))).user).map(([key, value]) => [key, value.totalCount]))
|
||||
Object.assign(discussions, stats)
|
||||
|
||||
//Load started discussions
|
||||
{
|
||||
const fetched = []
|
||||
const categories = {}
|
||||
let cursor = null
|
||||
let pushed = 0
|
||||
do {
|
||||
console.debug(`metrics/compute/${login}/discussions > retrieving discussions after ${cursor}`)
|
||||
const {user:{repositoryDiscussions:{edges = [], nodes = []} = {}}} = await graphql(queries.discussions.categories({login, after:cursor ? `after: "${cursor}"` : ""}))
|
||||
cursor = edges?.[edges?.length - 1]?.cursor
|
||||
fetched.push(...nodes)
|
||||
pushed = nodes.length
|
||||
console.debug(`metrics/compute/${login}/discussions > retrieved ${pushed} discussions after ${cursor}`)
|
||||
} while ((pushed) && (cursor))
|
||||
|
||||
//Compute favorite category
|
||||
for (const category of [...fetched.map(({category:{emoji, name}}) => `${imports.emoji.get(emoji)} ${name}`)])
|
||||
categories[category] = (categories[category] ?? 0) + 1
|
||||
discussions.categories.stats = categories
|
||||
discussions.categories.favorite = Object.entries(categories).sort((a, b) => b[1] - a[1]).map(([name]) => name).shift() ?? null
|
||||
}
|
||||
|
||||
//Results
|
||||
return discussions
|
||||
}
|
||||
//Handle errors
|
||||
catch (error) {
|
||||
throw {error:{message:"An error occured", instance:error}}
|
||||
}
|
||||
}
|
||||
12
source/plugins/discussions/metadata.yml
Normal file
12
source/plugins/discussions/metadata.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
name: "💬 Discussions"
|
||||
cost: 1 GraphQL request + 1 GraphQL request per 100 discussions started
|
||||
category: github
|
||||
supports:
|
||||
- user
|
||||
inputs:
|
||||
|
||||
# Enable or disable plugin
|
||||
plugin_discussions:
|
||||
description: GitHub discussions metrics
|
||||
type: boolean
|
||||
default: no
|
||||
15
source/plugins/discussions/queries/categories.graphql
Normal file
15
source/plugins/discussions/queries/categories.graphql
Normal file
@@ -0,0 +1,15 @@
|
||||
query DiscussionsCategories {
|
||||
user(login: "$login") {
|
||||
repositoryDiscussions($after first: 100, orderBy: {field: CREATED_AT, direction: DESC}) {
|
||||
edges {
|
||||
cursor
|
||||
}
|
||||
nodes {
|
||||
category {
|
||||
emoji
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
13
source/plugins/discussions/queries/statistics.graphql
Normal file
13
source/plugins/discussions/queries/statistics.graphql
Normal file
@@ -0,0 +1,13 @@
|
||||
query DiscussionsStatistics {
|
||||
user(login: "$login") {
|
||||
started: repositoryDiscussions {
|
||||
totalCount
|
||||
}
|
||||
comments: repositoryDiscussionComments {
|
||||
totalCount
|
||||
}
|
||||
answers: repositoryDiscussionComments(onlyAnswers: true) {
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
}
|
||||
5
source/plugins/discussions/tests.yml
Normal file
5
source/plugins/discussions/tests.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
- name: Discussions plugin (default)
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
token: MOCKED_TOKEN
|
||||
plugin_discussions: yes
|
||||
26
source/plugins/repositories/README.md
Normal file
26
source/plugins/repositories/README.md
Normal file
@@ -0,0 +1,26 @@
|
||||
### 📓 Repositories
|
||||
|
||||
The *repositories* plugin can display a list of chosen featured repositories.
|
||||
|
||||
<table>
|
||||
<td align="center">
|
||||
<img src="https://github.com/lowlighter/lowlighter/blob/master/metrics.plugin.repositories.svg">
|
||||
<img width="900" height="1" alt="">
|
||||
</td>
|
||||
</table>
|
||||
|
||||
It is mostly intended for external usage as [pinned repositories](https://www.google.com/search?client=firefox-b-d&q=github+pinned+repositories) is probably a better alternative if you want to embed them on your profile.
|
||||
|
||||
Because of limitations of using SVG inside of `<img>` tags, people won't be able to click on it.
|
||||
|
||||
#### ℹ️ Examples workflows
|
||||
|
||||
[➡️ Available options for this plugin](metadata.yml)
|
||||
|
||||
```yaml
|
||||
- uses: lowlighter/metrics@latest
|
||||
with:
|
||||
# ... other options
|
||||
plugin_repositories: yes
|
||||
plugin_repositories_list: lowlighter/metrics, denoland/deno # List of repositories you want to feature
|
||||
```
|
||||
38
source/plugins/repositories/index.mjs
Normal file
38
source/plugins/repositories/index.mjs
Normal file
@@ -0,0 +1,38 @@
|
||||
//Setup
|
||||
export default async function({login, q, imports, graphql, queries, data, account}, {enabled = false} = {}) {
|
||||
//Plugin execution
|
||||
try {
|
||||
//Check if plugin is enabled and requirements are met
|
||||
if ((!enabled)||(!q.repositories))
|
||||
return null
|
||||
|
||||
//Load inputs
|
||||
let {featured} = imports.metadata.plugins.repositories.inputs({data, account, q})
|
||||
|
||||
//Initialization
|
||||
const repositories = {list:[]}
|
||||
|
||||
//Fetch repositories informations
|
||||
for (const repo of featured) {
|
||||
const {owner = login, name} = repo.match(/^(?:(?<owner>[\s\S]*)[/])?(?<name>[\s\S]+)$/)?.groups ?? {}
|
||||
const {repository} = await graphql(queries.repositories.repository({owner, name}))
|
||||
repositories.list.push(repository)
|
||||
|
||||
//Format date
|
||||
const time = (Date.now() - new Date(repository.createdAt).getTime()) / (24 * 60 * 60 * 1000)
|
||||
let created = new Date(repository.createdAt).toDateString().substring(4)
|
||||
if (time < 1)
|
||||
created = `${Math.ceil(time * 24)} hour${Math.ceil(time * 24) >= 2 ? "s" : ""} ago`
|
||||
else if (time < 30)
|
||||
created = `${Math.floor(time)} day${time >= 2 ? "s" : ""} ago`
|
||||
repository.created = created
|
||||
}
|
||||
|
||||
//Results
|
||||
return repositories
|
||||
}
|
||||
//Handle errors
|
||||
catch (error) {
|
||||
throw {error:{message:"An error occured", instance:error}}
|
||||
}
|
||||
}
|
||||
22
source/plugins/repositories/metadata.yml
Normal file
22
source/plugins/repositories/metadata.yml
Normal file
@@ -0,0 +1,22 @@
|
||||
name: "📓 Repositories"
|
||||
cost: 1 GraphQL request per repository
|
||||
category: github
|
||||
supports:
|
||||
- user
|
||||
- organization
|
||||
inputs:
|
||||
|
||||
# Enable or disable plugin
|
||||
plugin_repositories:
|
||||
description: Display chosen featured repositories
|
||||
type: boolean
|
||||
default: no
|
||||
|
||||
# Featured repositories to display
|
||||
# If no owner is specified, it will implicitly use the current account login as owner
|
||||
plugin_repositories_featured:
|
||||
description: List of repositories to display
|
||||
type: array
|
||||
format: comma-separated
|
||||
default: ""
|
||||
example: lowlighter/metrics
|
||||
26
source/plugins/repositories/queries/repository.graphql
Normal file
26
source/plugins/repositories/queries/repository.graphql
Normal file
@@ -0,0 +1,26 @@
|
||||
query RepositoriesRepository {
|
||||
repository(owner: "$owner", name: "$name") {
|
||||
createdAt
|
||||
description
|
||||
forkCount
|
||||
isFork
|
||||
issues {
|
||||
totalCount
|
||||
}
|
||||
nameWithOwner
|
||||
openGraphImageUrl
|
||||
licenseInfo {
|
||||
nickname
|
||||
spdxId
|
||||
name
|
||||
}
|
||||
pullRequests {
|
||||
totalCount
|
||||
}
|
||||
stargazerCount
|
||||
primaryLanguage {
|
||||
color
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
6
source/plugins/repositories/tests.yml
Normal file
6
source/plugins/repositories/tests.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
- name: Repositories plugin (default)
|
||||
uses: lowlighter/metrics@latest
|
||||
with:
|
||||
token: MOCKED_TOKEN
|
||||
plugin_repositories: yes
|
||||
plugin_repositories_list: metrics
|
||||
@@ -7,6 +7,7 @@
|
||||
"languages",
|
||||
"notable",
|
||||
"projects",
|
||||
"repositories",
|
||||
"gists",
|
||||
"pagespeed",
|
||||
"habits",
|
||||
@@ -25,6 +26,7 @@
|
||||
"anilist",
|
||||
"wakatime",
|
||||
"skyline",
|
||||
"discussions",
|
||||
"support",
|
||||
"stackoverflow",
|
||||
"stock",
|
||||
|
||||
48
source/templates/classic/partials/discussions.ejs
Normal file
48
source/templates/classic/partials/discussions.ejs
Normal file
@@ -0,0 +1,48 @@
|
||||
<% if (plugins.discussions) { %>
|
||||
<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="M1.5 2.75a.25.25 0 01.25-.25h8.5a.25.25 0 01.25.25v5.5a.25.25 0 01-.25.25h-3.5a.75.75 0 00-.53.22L3.5 11.44V9.25a.75.75 0 00-.75-.75h-1a.25.25 0 01-.25-.25v-5.5zM1.75 1A1.75 1.75 0 000 2.75v5.5C0 9.216.784 10 1.75 10H2v1.543a1.457 1.457 0 002.487 1.03L7.061 10h3.189A1.75 1.75 0 0012 8.25v-5.5A1.75 1.75 0 0010.25 1h-8.5zM14.5 4.75a.25.25 0 00-.25-.25h-.5a.75.75 0 110-1.5h.5c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0114.25 12H14v1.543a1.457 1.457 0 01-2.487 1.03L9.22 12.28a.75.75 0 111.06-1.06l2.22 2.22v-2.19a.75.75 0 01.75-.75h1a.25.25 0 00.25-.25v-5.5z"></path></svg>
|
||||
<% if (!plugins.discussions.error) { %>
|
||||
<%= plugins.discussions.started %> Discussion<%= s(plugins.discussions.started) %> started
|
||||
<% } else { %>
|
||||
Discussions
|
||||
<% } %>
|
||||
</h2>
|
||||
<% if (plugins.discussions.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.discussions.error.message %>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<% } else { %>
|
||||
<div class="row">
|
||||
<section class="largeable-column-fields">
|
||||
<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="M16 1.25v4.146a.25.25 0 01-.427.177L14.03 4.03l-3.75 3.75a.75.75 0 11-1.06-1.06l3.75-3.75-1.543-1.543A.25.25 0 0111.604 1h4.146a.25.25 0 01.25.25zM2.75 3.5a.25.25 0 00-.25.25v7.5c0 .138.112.25.25.25h2a.75.75 0 01.75.75v2.19l2.72-2.72a.75.75 0 01.53-.22h4.5a.25.25 0 00.25-.25v-2.5a.75.75 0 111.5 0v2.5A1.75 1.75 0 0113.25 13H9.06l-2.573 2.573A1.457 1.457 0 014 14.543V13H2.75A1.75 1.75 0 011 11.25v-7.5C1 2.784 1.784 2 2.75 2h5.5a.75.75 0 010 1.5h-5.5z"></path></svg>
|
||||
<%= plugins.discussions.comments %> Comment<%= s(plugins.discussions.comments) %>
|
||||
</div>
|
||||
</section>
|
||||
<section class="largeable-column-fields">
|
||||
<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.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>
|
||||
<%= plugins.discussions.answers %> Answer<%= s(plugins.discussions.answers) %>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<% if (Object.keys(plugins.discussions.categories.stats).length) { %>
|
||||
<div class="row fill-width">
|
||||
<section>
|
||||
<div class="field">
|
||||
<% for (const [category, posts] of Object.entries(plugins.discussions.categories.stats)) { %>
|
||||
<div class="label label-flex"><%= category %> <div class="label-right"><%= posts %></div> </div>
|
||||
<% } %>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<% } %>
|
||||
<% } %>
|
||||
</section>
|
||||
<% } %>
|
||||
78
source/templates/classic/partials/repositories.ejs
Normal file
78
source/templates/classic/partials/repositories.ejs
Normal file
@@ -0,0 +1,78 @@
|
||||
<% if (plugins.repositories) { %>
|
||||
<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="M0 2.75A2.75 2.75 0 012.75 0h10.5A2.75 2.75 0 0116 2.75v10.5A2.75 2.75 0 0113.25 16H2.75A2.75 2.75 0 010 13.25V2.75zM2.75 1.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25h10.5c.69 0 1.25-.56 1.25-1.25V2.75c0-.69-.56-1.25-1.25-1.25H2.75z"></path><path d="M8 4a.75.75 0 01.75.75V6.7l1.69-.975a.75.75 0 01.75 1.3L9.5 8l1.69.976a.75.75 0 01-.75 1.298L8.75 9.3v1.951a.75.75 0 01-1.5 0V9.299l-1.69.976a.75.75 0 01-.75-1.3L6.5 8l-1.69-.975a.75.75 0 01.75-1.3l1.69.976V4.75A.75.75 0 018 4z"></path></svg>
|
||||
Featured repositories
|
||||
</h2>
|
||||
<div class="row">
|
||||
<section class="largeable-flex-wrap">
|
||||
<% if (plugins.repositories.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.repositories.error.message %>
|
||||
</div>
|
||||
<% } else if (plugins.repositories.list.length) { %>
|
||||
<% for (const repository of plugins.repositories.list) { %>
|
||||
<div class="row fill-width largeable-width-half">
|
||||
<section class="repository">
|
||||
<div class="field">
|
||||
<% if (repository.isFork) { %>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z"></path></svg>
|
||||
<% } else { %>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M2 2.5A2.5 2.5 0 014.5 0h8.75a.75.75 0 01.75.75v12.5a.75.75 0 01-.75.75h-2.5a.75.75 0 110-1.5h1.75v-2h-8a1 1 0 00-.714 1.7.75.75 0 01-1.072 1.05A2.495 2.495 0 012 11.5v-9zm10.5-1V9h-8c-.356 0-.694.074-1 .208V2.5a1 1 0 011-1h8zM5 12.25v3.25a.25.25 0 00.4.2l1.45-1.087a.25.25 0 01.3 0L8.6 15.7a.25.25 0 00.4-.2v-3.25a.25.25 0 00-.25-.25h-3.5a.25.25 0 00-.25.25z"></path></svg>
|
||||
<% } %>
|
||||
<div class="name">
|
||||
<span><%= repository.nameWithOwner %></span>
|
||||
<span>created <%= repository.created %></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field description">
|
||||
<%= repository.description %>
|
||||
</div>
|
||||
<div class="field infos">
|
||||
<% if (repository.primaryLanguage) { %>
|
||||
<div class="language">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill="<%= repository.primaryLanguage.color %>" fill-rule="evenodd" d="M8 4a4 4 0 100 8 4 4 0 000-8z"></path></svg>
|
||||
<%= repository.primaryLanguage.name %>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (repository.licenseInfo) { %>
|
||||
<div>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8.75.75a.75.75 0 00-1.5 0V2h-.984c-.305 0-.604.08-.869.23l-1.288.737A.25.25 0 013.984 3H1.75a.75.75 0 000 1.5h.428L.066 9.192a.75.75 0 00.154.838l.53-.53-.53.53v.001l.002.002.002.002.006.006.016.015.045.04a3.514 3.514 0 00.686.45A4.492 4.492 0 003 11c.88 0 1.556-.22 2.023-.454a3.515 3.515 0 00.686-.45l.045-.04.016-.015.006-.006.002-.002.001-.002L5.25 9.5l.53.53a.75.75 0 00.154-.838L3.822 4.5h.162c.305 0 .604-.08.869-.23l1.289-.737a.25.25 0 01.124-.033h.984V13h-2.5a.75.75 0 000 1.5h6.5a.75.75 0 000-1.5h-2.5V3.5h.984a.25.25 0 01.124.033l1.29.736c.264.152.563.231.868.231h.162l-2.112 4.692a.75.75 0 00.154.838l.53-.53-.53.53v.001l.002.002.002.002.006.006.016.015.045.04a3.517 3.517 0 00.686.45A4.492 4.492 0 0013 11c.88 0 1.556-.22 2.023-.454a3.512 3.512 0 00.686-.45l.045-.04.01-.01.006-.005.006-.006.002-.002.001-.002-.529-.531.53.53a.75.75 0 00.154-.838L13.823 4.5h.427a.75.75 0 000-1.5h-2.234a.25.25 0 01-.124-.033l-1.29-.736A1.75 1.75 0 009.735 2H8.75V.75zM1.695 9.227c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L3 6.327l-1.305 2.9zm10 0c.285.135.718.273 1.305.273s1.02-.138 1.305-.273L13 6.327l-1.305 2.9z"></path></svg>
|
||||
<%= f.license(repository.licenseInfo) %>
|
||||
</div>
|
||||
<% } %>
|
||||
<div>
|
||||
<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>
|
||||
<%= f(repository.stargazerCount) %>
|
||||
</div>
|
||||
<div>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M5 3.25a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm0 2.122a2.25 2.25 0 10-1.5 0v.878A2.25 2.25 0 005.75 8.5h1.5v2.128a2.251 2.251 0 101.5 0V8.5h1.5a2.25 2.25 0 002.25-2.25v-.878a2.25 2.25 0 10-1.5 0v.878a.75.75 0 01-.75.75h-4.5A.75.75 0 015 6.25v-.878zm3.75 7.378a.75.75 0 11-1.5 0 .75.75 0 011.5 0zm3-8.75a.75.75 0 100-1.5.75.75 0 000 1.5z"></path></svg>
|
||||
<%= f(repository.forkCount) %>
|
||||
</div>
|
||||
<div>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path d="M8 9.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z"></path><path fill-rule="evenodd" d="M8 0a8 8 0 100 16A8 8 0 008 0zM1.5 8a6.5 6.5 0 1113 0 6.5 6.5 0 01-13 0z"></path></svg>
|
||||
<%= f(repository.issues.totalCount) %>
|
||||
</div>
|
||||
<div>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.177 3.073L9.573.677A.25.25 0 0110 .854v4.792a.25.25 0 01-.427.177L7.177 3.427a.25.25 0 010-.354zM3.75 2.5a.75.75 0 100 1.5.75.75 0 000-1.5zm-2.25.75a2.25 2.25 0 113 2.122v5.256a2.251 2.251 0 11-1.5 0V5.372A2.25 2.25 0 011.5 3.25zM11 2.5h-1V4h1a1 1 0 011 1v5.628a2.251 2.251 0 101.5 0V5A2.5 2.5 0 0011 2.5zm1 10.25a.75.75 0 111.5 0 .75.75 0 01-1.5 0zM3.75 12a.75.75 0 100 1.5.75.75 0 000-1.5z"></path></svg>
|
||||
<%= f(repository.pullRequests.totalCount) %>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<% } %>
|
||||
<% } else { %>
|
||||
<div class="row fill-width largeable-width-half">
|
||||
<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="M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8zm6.5-.25A.75.75 0 017.25 7h1a.75.75 0 01.75.75v2.75h.25a.75.75 0 010 1.5h-2a.75.75 0 010-1.5h.25v-2h-.25a.75.75 0 01-.75-.75zM8 6a1 1 0 100-2 1 1 0 000 2z"></path></svg>
|
||||
Configure this plugin with repositories you want to feature!
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<% } %>
|
||||
</section>
|
||||
</div>
|
||||
</section>
|
||||
<% } %>
|
||||
Reference in New Issue
Block a user