This commit is contained in:
flash 2018-05-27 00:26:27 +02:00
parent 44d86d523b
commit 489a347c22
4 changed files with 10 additions and 1 deletions

View file

@ -7,6 +7,7 @@
* NPM module files to be imported into /js/libraries.js * NPM module files to be imported into /js/libraries.js
*/ */
define('NODE_IMPORT_JS', [ define('NODE_IMPORT_JS', [
'highlightjs/highlight.pack.min.js',
'timeago.js/dist/timeago.min.js', 'timeago.js/dist/timeago.min.js',
'timeago.js/dist/timeago.locales.min.js', 'timeago.js/dist/timeago.locales.min.js',
]); ]);
@ -15,9 +16,10 @@ define('NODE_IMPORT_JS', [
* NPM module files to be imported into /css/libraries.css * NPM module files to be imported into /css/libraries.css
*/ */
define('NODE_IMPORT_CSS', [ define('NODE_IMPORT_CSS', [
'highlightjs/styles/default.css',
'highlightjs/styles/tomorrow-night.css',
]); ]);
/** /**
* BEYOND THIS POINT YOU WON'T HAVE TO EDIT THE CONFIG PRETTY MUCH EVER * BEYOND THIS POINT YOU WON'T HAVE TO EDIT THE CONFIG PRETTY MUCH EVER
*/ */

View file

@ -1,5 +1,6 @@
{ {
"dependencies": { "dependencies": {
"highlightjs": "^9.10.0",
"timeago.js": "^3.0.2" "timeago.js": "^3.0.2"
} }
} }

View file

@ -15,6 +15,7 @@
{% include '@mio/_layout/meta.twig' %} {% include '@mio/_layout/meta.twig' %}
<link href="https://static.flash.moe/fonts/visitor/visitor1.css" rel="stylesheet"> <link href="https://static.flash.moe/fonts/visitor/visitor1.css" rel="stylesheet">
<link href="/css/mio.css" rel="stylesheet"> <link href="/css/mio.css" rel="stylesheet">
<link href="/css/libraries.css" rel="stylesheet">
</head> </head>
<body class="mio"> <body class="mio">
<div class="mio__wrapper"> <div class="mio__wrapper">
@ -81,6 +82,7 @@
<script> <script>
window.addEventListener('load', () => { window.addEventListener('load', () => {
timeago().render(document.querySelectorAll('time')); timeago().render(document.querySelectorAll('time'));
hljs.initHighlighting();
}); });
// move this to an external JS/TS file eventually. // move this to an external JS/TS file eventually.

View file

@ -6,6 +6,10 @@
version "2.0.49" version "2.0.49"
resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-2.0.49.tgz#95bd7064caebf65bde10429dff491a1aea05b67d" resolved "https://registry.yarnpkg.com/@types/jquery/-/jquery-2.0.49.tgz#95bd7064caebf65bde10429dff491a1aea05b67d"
highlightjs@^9.10.0:
version "9.10.0"
resolved "https://registry.yarnpkg.com/highlightjs/-/highlightjs-9.10.0.tgz#fca9b78ddaa3b1abca89d6c3ee105ad270a80190"
timeago.js@^3.0.2: timeago.js@^3.0.2:
version "3.0.2" version "3.0.2"
resolved "https://registry.yarnpkg.com/timeago.js/-/timeago.js-3.0.2.tgz#32a67e7c0d887ea42ca588d3aae26f77de5e76cc" resolved "https://registry.yarnpkg.com/timeago.js/-/timeago.js-3.0.2.tgz#32a67e7c0d887ea42ca588d3aae26f77de5e76cc"