Compare commits
6 Commits
0ba5799c75
...
77dade1d1d
Author | SHA1 | Date | |
---|---|---|---|
77dade1d1d | |||
d140422225 | |||
2defe99c73 | |||
0766211d79 | |||
b854eade3c | |||
c6f34f8eaa |
|
@ -44,9 +44,6 @@ defaultContentLanguage = 'en'
|
||||||
languageCode = "en-us"
|
languageCode = "en-us"
|
||||||
|
|
||||||
[params]
|
[params]
|
||||||
bergamotJsUrl = "https://static.danilafe.com/bergamot/bergamot.js"
|
|
||||||
bergamotObjectLanguageJsUrl = "https://static.danilafe.com/bergamot/objectlang.js"
|
|
||||||
katexJsUrl = "https://static.danilafe.com/katex/katex.min.js"
|
|
||||||
plausibleAnalyticsDomain = "danilafe.com"
|
plausibleAnalyticsDomain = "danilafe.com"
|
||||||
githubUsername = "DanilaFe"
|
githubUsername = "DanilaFe"
|
||||||
siteSourceUrl = "https://dev.danilafe.com/Web-Projects/blog-static/src/branch/master"
|
siteSourceUrl = "https://dev.danilafe.com/Web-Projects/blog-static/src/branch/master"
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
<div class="bergamot-exercise">
|
|
||||||
<details open>
|
|
||||||
<summary>
|
|
||||||
<span class="bergamot-exercise-label">
|
|
||||||
<span class="bergamot-exercise-number"></span>
|
|
||||||
{{ if or (eq (.Get "label") "") (eq (.Get "label") nil) }}{{ else }}({{ .Get "label" }}){{ end }}:
|
|
||||||
</span>
|
|
||||||
</summary>
|
|
||||||
{{ transform.Markdownify .Inner }}
|
|
||||||
|
|
||||||
<div class="bergamot-button-group">
|
|
||||||
{{ if or (eq (.Get "preset") "") (eq (.Get "preset") nil) }}
|
|
||||||
{{ else }}
|
|
||||||
<button class="bergamot-button bergamot-play" onclick='window.Bergamot.runPreset(this.parentElement, "bergamot-widget-container-{{ .Get "id" }}", "{{ .Get "preset" }}")'>{{ partial "icon.html" "play" }}Start Bergamot</button>
|
|
||||||
<button class="bergamot-button bergamot-close bergamot-hidden" onclick='window.Bergamot.close(this.parentElement, "bergamot-widget-container-{{ .Get "id" }}")'>{{ partial "icon.html" "x" }}Close Bergamot</button>
|
|
||||||
{{ end }}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="bergamot-widget-container-{{ .Get "id" }}"></div>
|
|
||||||
</details>
|
|
||||||
</div>
|
|
|
@ -1,10 +0,0 @@
|
||||||
<script>
|
|
||||||
window.addEventListener('load', function() {
|
|
||||||
window.Bergamot.presets['{{ .Get "name" }}'] = {
|
|
||||||
rules: '{{ .Inner }}',
|
|
||||||
inputPrompt: '{{ .Get "prompt" }}',
|
|
||||||
query: '{{ .Get "query" }}',
|
|
||||||
renderPreset: '{{ default "default" (.Get "rendering") }}'
|
|
||||||
};
|
|
||||||
});
|
|
||||||
</script>
|
|
|
@ -1,3 +0,0 @@
|
||||||
<script>
|
|
||||||
window.Bergamot.renderPresets['{{ .Get "name" }}'] = '{{ .Inner }}';
|
|
||||||
</script>
|
|
|
@ -1,6 +0,0 @@
|
||||||
<div id="{{ .Get "id" }}"></div>
|
|
||||||
<script>
|
|
||||||
window.addEventListener('load', function() {
|
|
||||||
window.Bergamot.run(null, '{{ .Get "id" }}', '{{ .Get "prompt" }}', '{{ .Inner }}', '{{ default "default" (.Get "rendering") }}', '{{ .Get "query" }}');
|
|
||||||
});
|
|
||||||
</script>
|
|
|
@ -1,34 +0,0 @@
|
||||||
<script defer src="{{ .Site.Params.katexJsUrl }}" crossorigin="anonymous"></script>
|
|
||||||
<script defer>
|
|
||||||
class KatexExpressionShim extends HTMLElement {
|
|
||||||
static observedAttributes = ["expression", "katex-options"];
|
|
||||||
targetSpan;
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
doRender() {
|
|
||||||
if (!this.targetSpan) return;
|
|
||||||
|
|
||||||
const options = this.hasAttribute("katex-options") ?
|
|
||||||
this.getAttribute("katex-options") : {};
|
|
||||||
katex.render(
|
|
||||||
this.getAttribute("expression"),
|
|
||||||
this.targetSpan,
|
|
||||||
JSON.parse(options)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
connectedCallback() {
|
|
||||||
this.targetSpan = document.createElement('span');
|
|
||||||
this.appendChild(this.targetSpan);
|
|
||||||
this.doRender();
|
|
||||||
}
|
|
||||||
|
|
||||||
attributeChangedCallback(name, oldValue, newValue) {
|
|
||||||
this.doRender();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
customElements.define("katex-expression", KatexExpressionShim);
|
|
||||||
</script>
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 84278b2e91c9bcfcc08b34c08daa355e7c8f336a
|
Subproject commit dde3fb61aec70675a84b196dc437cb68783b5550
|
Loading…
Reference in New Issue
Block a user