mirror of
https://github.com/koodiklinikka/koodiklinikka.fi.git
synced 2026-02-19 03:54:22 +00:00
Upgrade dependencies, etc. (#55)
* Run prettify * Upgrade dependencies and switch out some libraries: * timeago (freshly jquery dependent) -> ReactTimeAgo * next-ga -> react-ga and custom plumbing * Move static/ to public/static/ As per https://github.com/zeit/next.js/blob/master/errors/static-dir-deprecated.md * Fix cons->icons typo * Import only what's necessary from lodash (223 -> 180 kb) * Asyncify MembershipInfoForm
This commit is contained in:
committed by
Riku Rouvila
parent
db98341a51
commit
dcf26deb0f
@@ -1,16 +1,23 @@
|
||||
import _ from "lodash";
|
||||
import lodashTemplate from "lodash/template";
|
||||
import defaultTemplateSettings from "lodash/templateSettings";
|
||||
import githubEvent from "parse-github-event";
|
||||
import twitterText from "twitter-text";
|
||||
|
||||
const isVisibleGithubEvent = ({ type }) =>
|
||||
type !== "PushEvent" && type !== "DeleteEvent";
|
||||
|
||||
const templateSettings = {
|
||||
...defaultTemplateSettings,
|
||||
interpolate: /{{([\s\S]+?)}}/g,
|
||||
};
|
||||
|
||||
export default {
|
||||
github(items) {
|
||||
return items.filter(isVisibleGithubEvent).map(item => {
|
||||
_.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
|
||||
|
||||
const template = _.template(githubEvent.parse(item).text);
|
||||
const template = lodashTemplate(
|
||||
githubEvent.parse(item).text,
|
||||
templateSettings
|
||||
);
|
||||
|
||||
const repository = `https://github.com/${item.repo.name}`;
|
||||
let branch;
|
||||
|
||||
Reference in New Issue
Block a user