Adjustments to the katex integration, part 2.

This commit is contained in:
Fredrik Jonsson 2023-03-17 16:44:50 +01:00
commit eee22b08f5
4 changed files with 37 additions and 15 deletions

View file

@ -1,4 +1,3 @@
/* eslint-disable no-undef */
(function () {
'use strict';

21
assets/js/math.js Normal file
View file

@ -0,0 +1,21 @@
/**
* @file
* A JavaScript file for Katex auto renderer.
*/
(function () {
'use strict';
document.addEventListener('DOMContentLoaded', function () {
// eslint-disable-next-line no-undef
renderMathInElement(document.body, {
delimiters: [
{left: '$$', right: '$$', display: true},
{left: '$', right: '$', display: false}
],
throwOnError: false
});
});
})();

View file

@ -1,12 +1,13 @@
/* eslint-disable no-undef, guard-for-in */
/**
* @file
* A JavaScript file for flexsearch.
*/
/* eslint-disable */
import * as params from '@params';
/* eslint-enable */
/* eslint-disable no-undef, guard-for-in */
(function () {
'use strict';
@ -14,8 +15,8 @@ import * as params from '@params';
const index = new FlexSearch.Document({
document: {
id: 'id',
index: ['title','tags','content','date'],
store: ['title','summary','date','permalink']
index: ['title', 'tags', 'content', 'date'],
store: ['title', 'summary', 'date', 'permalink']
},
tokenize: 'forward'
});

View file

@ -1,12 +1,13 @@
/* eslint-disable no-undef */
/**
* @file
* A JavaScript file for analytic tracking.
*/
/* eslint-disable */
import * as params from '@params';
/* eslint-enable */
/* eslint-disable no-undef */
const cookiebanner = params.cookieConsent;
const cookieconsent = localStorage.getItem('cookieconsent');
const idSite = params.piwikSiteID;