pengx17 / logseq-publish

Archived. Please check https://github.com/logseq/publish-spa instead

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

如何在流程中对导出HTML的进行额外操作?

WsinGithub opened this issue · comments

commented

目前导出页面的公式渲染有问题,或者更深层地,
/js下的脚本(包括渲染公式的katex.js)的加载有问题?
这应该是logseq的bug,但我反馈了几个月了也没回应...应该不是当前工作重点吧...

以下是需求:
如何在action中进行修改,实现在导出的HTML的<head>标签内自动化写入以下信息?

<script src="static/js/katex.min.js"></script>
<link href="https://cdn.bootcdn.net/ajax/libs/KaTeX/0.12.0/contrib/copy-tex.css" rel="stylesheet"></link>
<script src="https://cdn.bootcdn.net/ajax/libs/KaTeX/0.12.0/contrib/copy-tex.js"></script>
<script src="static/js/mhchem.min.js"></script>

以实现渲染公式的目的,感谢!

增加一个 action,使用 sed 等工具修改 index.html 即可,比如

sed -i -s 's/<head>/<head>balabala/g' index.html

增加一个 action,使用 sed 等工具修改 index.html 即可,比如

sed -i -s 's/<head>/<head>balabala/g' index.html

thanks a lot, I also want to rewrite the index.html. the github action is just a linux run environment, so everything can try in linux way,wOw!

Closed for resolved.