Lazy-load markdown renderer on about page for smaller bundle size

This commit is contained in:
Eliot Berriot 2018-12-20 00:47:05 +01:00
parent 3682aa81db
commit 17d86a2832
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
7 changed files with 13 additions and 262 deletions

View file

@ -1,7 +1,6 @@
import Vue from 'vue'
import moment from 'moment'
import showdown from 'showdown'
export function truncate (str, max, ellipsis) {
max = max || 100
@ -14,13 +13,6 @@ export function truncate (str, max, ellipsis) {
Vue.filter('truncate', truncate)
export function markdown (str) {
const converter = new showdown.Converter()
return converter.makeHtml(str)
}
Vue.filter('markdown', markdown)
export function ago (date) {
const m = moment(date)
return m.fromNow()