Plugin markdown update (#211)

This commit is contained in:
Simon Lecoq
2021-04-07 14:13:56 +02:00
committed by GitHub
parent f93da199d6
commit a98530dd6b
10 changed files with 87 additions and 30 deletions

View File

@@ -20,28 +20,16 @@ I contributed to `{{ REPOSITORIES_CONTRIBUTED_TO }}` repositories and made `{{ C
## 🧩 Markdown plugins
Most of plugins from SVG templates can be reused directly by including image source in markdown, but some have them have their own **markdown** version which includes hyperlinks.
Most of plugins from SVG templates can be reused directly by including image source in markdown, but some have them have their own **markdown** version which includes hyperlinks and reduce image overhead.
### 📰 Recent activity
See [compatibility matrix](https://github.com/lowlighter/metrics#-templateplugin-compatibily-matrix) for more informations.
<%- await include(`partials/activity.ejs`) %>
### ✒️ Recent posts
*Coming soon*
### 🗼 Rss feed
<%- await include(`partials/posts.ejs`) %>
<%- await include(`partials/rss.ejs`) %>
### 🐤 Latest tweets
*Coming soon*
### 🌇 GitHub Skyline 3D calendar
*Coming soon*
### 📌 Starred topics
<%- await include(`partials/tweets.ejs`) %>
<%- await include(`partials/topics.ejs`) %>

View File

@@ -5,7 +5,7 @@
<%_ } else if (plugins.activity.events.length) { _%>
<%_ for (const {actor, type, repo, timestamp, ...event} of plugins.activity.events) { _%>
<%_ if (type === "comment") { _%>
* 💬 Commented on [#<%= event.number %> <%= event.title %>](https://github.com/<%= repo %>/<%= {issue:"issues", pr:"pulls", commit:"commit"}[event.on] %>/<%= event.number %>) from [<%= repo %>](https://github.com/<%= repo %>)
* 💬 Commented on [#<%= event.number %> <%= event.title %>](https://github.com/<%= repo %>/<%= {issue:"issues", pr:"pull", commit:"commit"}[event.on] %>/<%= event.number %>) from [<%= repo %>](https://github.com/<%= repo %>)
<%_ } else if (type === "member") { _%>
* 💼 Added [<%= event.user %>](https://github.com/<%= event.user %>) as collaborator in [<%= repo %>](https://github.com/<%= repo %>)
<%_ } else if (type === "star") { _%>
@@ -22,7 +22,7 @@
<%_ } else if (type === "issue") { _%>
* #️⃣ <%- event.action === "opened" ? "Opened" : event.action === "reopened" ? "Reopened" : "Closed" %> [#<%= event.number %> <%= event.title %>](https://github.com/<%= repo %>/issues/<%= event.number %>) in [<%= repo %>](https://github.com/<%= repo %>)
<%_ } else if (type === "pr") { _%>
* 🔃 <%- event.action === "opened" ? "Opened" : "Merged" %> [#<%= event.number %> <%= event.title %>](https://github.com/<%= repo %>/pulls/<%= event.number %>) in [<%= repo %>](https://github.com/<%= repo %>)
* 🔃 <%- event.action === "opened" ? "Opened" : "Merged" %> [#<%= event.number %> <%= event.title %>](https://github.com/<%= repo %>/pull/<%= event.number %>) in [<%= repo %>](https://github.com/<%= repo %>)
* <%= event.files.changed %> file<%= s(event.files.changed) %> changed `++<%= event.lines.added %> --<%= event.lines.deleted%>`
<%_ } else if (type === "wiki") { _%>
* 📝 Updated <%= event.pages.length %> wiki page<%= s(event.pages.length) %> in [<%= repo %>](https://github.com/<%= repo %>/wiki)
@@ -32,12 +32,15 @@
<%_ } else if (type === "public") { _%>
* 🚀 Made [<%= repo %>](https://github.com/<%= repo %>) public
<%_ } else if (type === "review") { _%>
* 🔍 Reviewed [#<%= event.number %> <%= event.title %>](https://github.com/<%= repo %>/pulls/<%= event.number %>) in [<%= repo %>](https://github.com/<%= repo %>)
* 🔍 Reviewed [#<%= event.number %> <%= event.title %>](https://github.com/<%= repo %>/pull/<%= event.number %>) in [<%= repo %>](https://github.com/<%= repo %>)
<%_ } else if (type === "ref/create") { _%>
* ⏺️ Created new <%= event.ref.type %> `<%= event.ref.name %>` in [<%= repo %>](https://github.com/<%= repo %>)
<%_ } else if (type === "ref/create") { _%>
* 🚮 Deleted <%= event.ref.type %> `<%= event.ref.name %>` from [<%= repo %>](https://github.com/<%= repo %>)
<%_ } _%>
<%_ if (plugins.activity.timestamps) { _%>
* *On <%= f.date(timestamp, {timeStyle:"short", dateStyle:"short"}) %>*
<%_ } _%>
<%_ } _%>
<%_ } else { _%>
No recent activity

View File

@@ -0,0 +1,35 @@
<%_ if (plugins.posts) { _%>
**[✒️ Recent posts from <%= plugins.posts?.source %>](<%= plugins.posts?.link %>)**
<%_ if (plugins.posts.error) { _%>
<%= plugins.posts.error.message _%>
<%_ } else if ((plugins.posts.list.length)&&(plugins.posts.descriptions)||(plugins.posts.covers)) { _%>
<%_ for (const {title, date, link, description = "", image} of plugins.posts.list) { _%>
<table>
<tr>
<%_ if (plugins.posts.covers) { _%>
<td rowspan="2" width="280">
<img src="<%= image %>" alt="" width="280">
</td>
<%_ } _%>
<th>
<a href="<%= link %>"><%= title.trim() %></a>
</th>
</tr>
<tr>
<td>
<%= description %>
<br>
<i>Published on <%= f.date(new Date(date), {dateStyle:"short"}) %></i>
</td>
</tr>
</table>
<%_ } _%>
<%_ } else if (plugins.posts.list.length) { _%>
<%_ for (const {title, date, link} of plugins.posts.list) { _%>
* [<%= title.trim() %>](<%= link %>)
* *Published on <%= f.date(new Date(date), {dateStyle:"short"}) %>*
<%_ } _%>
<%_ } else { _%>
No recent posts
<%_ } _%>
<%_ } _%>

View File

@@ -5,7 +5,7 @@
<%_ } else if (plugins.rss.feed.length) { _%>
<%_ for (const {title, link, date} of plugins.rss.feed) { _%>
* [<%= title %>](<%= link %>)
* Published on <%= f.date(new Date(date), {dateStyle:"short"}) %>
* *Published on <%= f.date(new Date(date), {dateStyle:"short"}) %>*
<%_ } _%>
<%_ } else { _%>
Empty RSS feed

View File

@@ -7,6 +7,6 @@
* <img src="<%= icon %>" width="24" height="24" alt=""> [<%= name %>](https://github.com/topics/<%= name.toLocaleLowerCase().replace(/ /g, "-") %>)
<%_ } _%>
<%_ } else { _%>
Empty RSS feed
No starred topics
<%_ } _%>
<%_ } _%>

View File

@@ -0,0 +1,21 @@
<%_ if (plugins.tweets) { _%>
**[🐤 Latest tweets from @<%= plugins.tweets.username %>](https://twitter.com/<%= plugins.tweets.username %>)**
<%_ if (plugins.tweets.error) { _%>
<%= plugins.tweets.error.message _%>
<%_ } else if (plugins.tweets.list.length) { _%>
<%_ for (const {text, createdAt, attachments} of plugins.tweets.list) { _%>
> <%- text %>
<%_ if (attachments) { _%>
<%_ for (const {image, title, description, website} of attachments) { _%>
>
> <a href="<%= website %>"><img src="<%= image %>" alt="<%= title %>" height="200"></a>
<%_ } _%>
<%_ } _%>
>
> *<%= createdAt %>*
<%_ } _%>
<%_ } else { _%>
No recent tweets
<%_ } _%>
<%_ } _%>