mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 09:09:24 +02:00
Lazy-load markdown renderer on about page for smaller bundle size
This commit is contained in:
parent
3682aa81db
commit
17d86a2832
7 changed files with 13 additions and 262 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue