<% if (plugins.stackoverflow) { %>

Stackoverflow metrics

<% if (plugins.stackoverflow.error) { %>
<%= plugins.stackoverflow.error.message %>
<% } else { %>
<%= plugins.stackoverflow.user.reputation %> reputation point<%= s(plugins.stackoverflow.user.reputation) %>
<%= plugins.stackoverflow.user.questions %> question<%= s(plugins.stackoverflow.user.questions) %>
<%= plugins.stackoverflow.user.comments %> comment<%= s(plugins.stackoverflow.user.comments) %>
<%= plugins.stackoverflow.user.badges %> badge<%= s(plugins.stackoverflow.user.badges) %>
<%= plugins.stackoverflow.user.answers %> answer<%= s(plugins.stackoverflow.user.answers) %>
<% if (plugins.stackoverflow.lines) { %> <% } %> <% for (const section of plugins.stackoverflow.sections) { if (!plugins.stackoverflow[section]?.length) continue %>

<%= {"questions-recent":"Recent questions", "questions-top":"Top questions", "answers-recent":"Recent answers", "answers-top":"Top answers"}[section] %>

<% for (const {type, ...entry} of plugins.stackoverflow[section]) { %>
<% if (type === "question") { %>
<%- entry.title %>
<%= entry.tags.join(", ") %>
<% if (entry.answered) { %>
Resolved
<% } %>
<%- entry.body %>
<%= f(entry.upvotes) %>
<%= f(entry.downvotes) %>
<%= f(entry.views) %>
<%= f(entry.answers) %>
<%= f(entry.comments) %>
<%= entry.created %>
<% } else if (type === "answer") { %>
<%- entry.question?.title %>
<%= entry.question?.tags.join(", ") %>
<% if (entry.question?.answered) { %>
Resolved
<% } %>
<%- entry.body %>
<%= f(entry.upvotes) %>
<%= f(entry.downvotes) %>
<%= f(entry.comments) %>
<%= entry.created %>
<% if (entry.accepted) { %>
Accepted
<% } %>
<% } %>
<% } %>
<% } %> <% } %>
<% } %>