Update readme
This commit is contained in:
@@ -54,6 +54,7 @@ This way you'll be able to rapidly test SVG renders with your browser.
|
||||
|
||||
* `index.mjs` contains the metrics server entry point
|
||||
* `src/app.mjs` contains the metrics server code which serves, renders, restricts/rate limit, etc.
|
||||
* `src/html/*` contains the metrics server static files
|
||||
|
||||
#### GitHub action
|
||||
|
||||
|
||||
38
README.md
38
README.md
@@ -98,6 +98,9 @@ jobs:
|
||||
# Template to use (see src/templates to get a list of supported templates)
|
||||
template: classic
|
||||
|
||||
# Base content to include in metrics (list of comma-separated sections name as string)
|
||||
base: "header, activity, community, repositories, metadata"
|
||||
|
||||
# Enable Google PageSpeed metrics for account attached website
|
||||
# See https://developers.google.com/speed/docs/insights/v5/get-started for more informations
|
||||
plugin_pagespeed: no
|
||||
@@ -111,7 +114,9 @@ jobs:
|
||||
plugin_traffic: no
|
||||
|
||||
# Enable coding habits metrics
|
||||
# You can also configure the number of activity events to base habits on (up to 100)
|
||||
plugin_habits: no
|
||||
plugin_habits_from: 100
|
||||
|
||||
# Skip commits flagged with [Skip GitHub Action] from commits count
|
||||
plugin_selfskip: no
|
||||
@@ -359,6 +364,39 @@ The following errors code can be encountered if on a server instance :
|
||||
Plugins are features which are disabled by default but they can provide additional metrics.
|
||||
In return they may require additional configuration and tend to consume additional API requests.
|
||||
|
||||
#### Base content
|
||||
|
||||
By default, generated metrics contains the following sections :
|
||||
* `header`, which usually contains your username, your two-week commits calendars and a few additional data
|
||||
* `activity`, which contains your recent activity (commits, pull requests opened/reviewed, issues opened, comments, etc.)
|
||||
* `community`, which contains your community stats (following, sponsors, stars, watching, organizations, etc.)
|
||||
* `repositories`, which contains your repositories stats (license, forks, stars, watchers, packages, gists, etc.)
|
||||
* `metadata`, which contains informations about generated metrics (last updated date, etc.)
|
||||
|
||||
<summary>💬 About</summary>
|
||||
|
||||
You can explicitely opt-out from them, if you want to keep only a few sections or if you want to use a plugin as standalone.
|
||||
|
||||
##### Setup with GitHub actions
|
||||
|
||||
Choose the parts you want to keep and update your workflow. For exemple, to keep only `header` and `repositories` sections, add the following to your workflow :
|
||||
```yaml
|
||||
- uses: lowlighter/metrics@latest
|
||||
with:
|
||||
# ... other options
|
||||
base: "header, repositories" # opt-out from "activity", "community" and "metadata"
|
||||
```
|
||||
|
||||
##### Setup in your own instance
|
||||
|
||||
Pass `?base.activity=0&base.` in url when generating metrics.
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
# Base content to include in metrics (list of comma-separated sections name as string)
|
||||
|
||||
|
||||
#### ⏱️ PageSpeed
|
||||
|
||||
The *pagespeed* plugin allows you to add the performances of the website attached to the GitHub user account :
|
||||
|
||||
2
action/dist/index.js
vendored
2
action/dist/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -66,8 +66,6 @@
|
||||
//Base elements
|
||||
const base = {}
|
||||
let parts = (core.getInput("base")||"").split(",").map(part => part.trim())
|
||||
if (!parts.length)
|
||||
parts = conf.settings.plugins.base.parts
|
||||
for (const part of conf.settings.plugins.base.parts)
|
||||
base[`base.${part}`] = parts.includes(part)
|
||||
console.log(`Base parts | ${parts.join(", ")}`)
|
||||
|
||||
@@ -72,11 +72,11 @@
|
||||
<template v-else>
|
||||
<img class="metrics preview-inline" :src="templates.placeholder" alt="metrics">
|
||||
</template>
|
||||
<div class="error" v-if="generated.error">An error occurred. Please try again later.</div>
|
||||
</div>
|
||||
<template v-if="user">
|
||||
<button @click="generate" :disabled="generated.pending">{{ generated.pending ? "Working on it :)" : "Generate your metrics !" }}</button>
|
||||
</template>
|
||||
<div class="error" v-if="generated.error">An error occurred. Please try again later.</div>
|
||||
</div>
|
||||
<div class="step">
|
||||
<h2>4. Embed these metrics on your GitHub profile</h2>
|
||||
|
||||
@@ -104,14 +104,16 @@
|
||||
}
|
||||
.generator .preview-inliner {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.generator .preview-inline .metrics {
|
||||
.generator .preview-inliner .metrics {
|
||||
width: 100%;
|
||||
max-width: 480px;
|
||||
}
|
||||
@media only screen and (min-width: 1180px) {
|
||||
.generator .preview-inline {
|
||||
.generator .preview-inliner {
|
||||
display: none;
|
||||
}
|
||||
.generator .preview {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
export default async function build() {
|
||||
//Build code
|
||||
let {code} = await ncc(`${__dirname}/index.mjs`, {
|
||||
//minify:true,
|
||||
minify:true,
|
||||
sourceMap:false,
|
||||
sourceMapRegister:false,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user