fix katex fonts

This commit is contained in:
Lorin Werthen 2021-03-18 22:12:15 +01:00
parent 40c205e028
commit ac6ccd1eda
No known key found for this signature in database
GPG key ID: F11FFC921E0E08E0
3 changed files with 8 additions and 8 deletions

2
Rules
View file

@ -3,6 +3,8 @@
require 'json'
require 'icalendar'
require 'kramdown'
require 'kramdown-math-katex'
# Important!!!

View file

@ -15,7 +15,6 @@ pre .line-numbers {
transition: all .15s ease;
box-shadow: 0 4px 6px rgba(50,50,93,.11), 0 1px 3px rgba(0,0,0,.08);
}
a.box:hover {

View file

@ -5,13 +5,12 @@ class KatexDataSource < ::Nanoc::DataSource
def items
katex_css_path = File.join(Katex.gem_path, 'vendor', 'katex', 'stylesheets', 'katex.css')
katex_font_paths = Dir[File.join(Katex.gem_path, 'vendor', 'katex', 'fonts', '*')]
[
new_item(
File.open(katex_css_path).read,
{},
"/katex.css"
)
]
font_items = katex_font_paths.map do |e|
font_name = File.split(e)[-1]
new_item(File.open(e).read, {}, "/fonts/#{font_name}")
end
[new_item(File.open(katex_css_path).read, {}, "/katex.css")] + font_items
end
end