diff --git a/_config.yml b/_config.yml index 10c8f1102a4f..6c3f3cedd943 100644 --- a/_config.yml +++ b/_config.yml @@ -380,9 +380,40 @@ enable_progressbar: true # enables a horizontal progress bar linked to the verti bootstrap-table: version: "1.22.1" +chartjs: + version: "4.4.1" +d3: + version: "7.8.5" + integrity: "sha256-1rA678n2xEx7x4cTZ5x4wpUCj6kUMZEZ5cxLSVSFWxw=" +diff2html: + version: "3.4.47" + integrity: + css: "sha256-IMBK4VNZp0ivwefSn51bswdsrhk0HoMTLc2GqFHFBXg=" + js: "sha256-eU2TVHX633T1o/bTQp6iIJByYJEtZThhF9bKz/DcbbY=" +echarts: + version: "5.4.3" + integrity: + library: "sha256-EVZCmhajjLhgTcxlGMGUBtQiYULZCPjt0uNTFEPFTRk=" + dark_theme: "sha256-UmFIP/4VvOqBDIl2QWl1HBuAJ1XWs/iFZxT5yJRZOKo=" +highlightjs: + version: "11.9.0" + integrity: + css: + light: "sha256-Oppd74ucMR5a5Dq96FxjEzGF7tTw2fZ/6ksAqDCM8GY=" + dark: "sha256-nyCNAiECsdDHrr/s2OQsp5l9XeY2ZJ0rMepjCT2AkBk=" +imagesloaded: + version: "5.0.0" + integrity: "sha256-htrLFfZJ6v5udOG+3kNLINIKh2gvoKqwEhHYfTTMICc=" +img-comparison-slider: + version: "8.0.6" jquery: version: "3.6.0" integrity: "sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" +leaflet: + version: "1.9.4" + integrity: + css: "sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" + js: "sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" mathjax: version: "3.2.0" masonry: @@ -396,6 +427,23 @@ mdb: medium_zoom: version: "1.1.0" integrity: "sha256-ZgMyDAIYDYGxbcpJcfUnYwNevG/xi9OHKaR/8GK+jWc=" +mermaid: + version: "10.7.0" + integrity: "sha256-TtLOdUA8mstPoO6sGvHIGx2ceXrrX4KgIItO06XOn8A=" +swiper: + version: "11.0.5" + integrity: + css: "sha256-yUoNxsvX+Vo8Trj3lZ/Y5ZBf8HlBFsB6Xwm7rH75/9E=" + js: "sha256-BPrwikijIybg9OQC5SYFFqhBjERYOn97tCureFgYH1E=" +vega: + version: "5.27.0" + integrity: "sha256-Yot/cfgMMMpFwkp/5azR20Tfkt24PFqQ6IQS+80HIZs=" +vega-embed: + version: "6.24.0" + integrity: "sha256-FPCJ9JYCC9AZSpvC/t/wHBX7ybueZhIqOMjpWqfl3DU=" +vega-lite: + version: "5.16.3" + integrity: "sha256-TvBvIS5jUN4BSy009usRjNzjI1qRrHPYv7xVLJyjUyw=" # ----------------------------------------------------------------------------- # Get external JSON data diff --git a/_includes/head.liquid b/_includes/head.liquid index 1035e72e51b2..b8c27ab4b84f 100644 --- a/_includes/head.liquid +++ b/_includes/head.liquid @@ -17,8 +17,9 @@ {% endif %} - + - -{% endif %} -{% if page.tikzjax %} - - + {% endif %} @@ -56,6 +54,7 @@ {% if site.enable_darkmode %} {% if page.map %} {% endif %} @@ -77,29 +77,51 @@ {% if page.code_diff %} - + {% endif %} - {% if page.images %} + {% if page.images.compare %} - + {% endif %} + {% if page.images.slider %} {% endif %} {% endif %} + +{% if page.tikzjax %} + +{% endif %} diff --git a/_includes/metadata.liquid b/_includes/metadata.liquid index b1c7ccb77aae..b7373704b85f 100644 --- a/_includes/metadata.liquid +++ b/_includes/metadata.liquid @@ -14,13 +14,15 @@ {% endif %} +{% capture author_name %}{{ site.first_name }}{% if site.middle_name %} {{ site.middle_name }}{% endif %} {{ site.last_name }}{% endcapture %} + {% if site.title == 'blank' %} - {% capture title %}{{ site.first_name }} {{ site.middle_name }} {{ site.last_name }}{% endcapture %} + {% capture title %}{{ author_name }}{% endcapture %} {% else %} {% capture title %}{{ site.title }}{% endcapture %} {% endif %} @@ -36,7 +38,7 @@ {{ title }} {% endif %} - + {% if page.keywords or site.keywords %} @@ -223,7 +225,7 @@ "author": { "@type": "Person", - "name": "{{ site.first_name }} {{ site.middle_name }} {{ site.last_name }}" + "name": "{{ author_name }}" }, "url": "{{ page.url | prepend: site.baseurl | prepend: site.url }}", "@type": "{% if is_blog_post %}BlogPosting{% else %}WebSite{% endif %}", @@ -232,7 +234,7 @@ {% if sameaslinks != blank %} "sameAs": {{ sameaslinks }}, {% endif %} - "name": "{{ site.first_name }} {{ site.middle_name }} {{ site.last_name }}", + "name": "{{ author_name }}", "@context": "https://schema.org" } diff --git a/_includes/scripts/chartjs.liquid b/_includes/scripts/chartjs.liquid index 4f43933072f8..8574f749ec7f 100644 --- a/_includes/scripts/chartjs.liquid +++ b/_includes/scripts/chartjs.liquid @@ -1,5 +1,5 @@ {% if page.chart and page.chart.chartjs %} - + - -{% endif %} diff --git a/_includes/scripts/diff2html.liquid b/_includes/scripts/diff2html.liquid new file mode 100644 index 000000000000..e3add886e74e --- /dev/null +++ b/_includes/scripts/diff2html.liquid @@ -0,0 +1,31 @@ +{% if page.code_diff %} + + + +{% endif %} diff --git a/_includes/scripts/echarts.liquid b/_includes/scripts/echarts.liquid index cbac2be52e7f..8b61abd51c81 100644 --- a/_includes/scripts/echarts.liquid +++ b/_includes/scripts/echarts.liquid @@ -1,13 +1,15 @@ {% if page.chart and page.chart.echarts %} {% if site.enable_darkmode %} {% endif %} @@ -16,26 +18,30 @@ /* Create echarts chart as another node and hide the code block, appending the echarts node after it this is done to enable retrieving the code again when changing theme between light/dark */ - document.querySelectorAll('pre>code.language-echarts').forEach((elem) => { - const jsonData = elem.textContent; - const backup = elem.parentElement; - backup.classList.add('unloaded'); - /* create echarts node */ - let chartElement = document.createElement('div'); - chartElement.classList.add('echarts'); - backup.after(chartElement); + document.onreadystatechange = () => { + if (document.readyState === 'complete') { + document.querySelectorAll('pre>code.language-echarts').forEach((elem) => { + const jsonData = elem.textContent; + const backup = elem.parentElement; + backup.classList.add('unloaded'); + /* create echarts node */ + let chartElement = document.createElement('div'); + chartElement.classList.add('echarts'); + backup.after(chartElement); - /* create echarts */ - if (theme === 'dark') { - var chart = echarts.init(chartElement, 'dark-fresh-cut'); - } else { - var chart = echarts.init(chartElement); - } + /* create echarts */ + if (theme === 'dark') { + var chart = echarts.init(chartElement, 'dark-fresh-cut'); + } else { + var chart = echarts.init(chartElement); + } - chart.setOption(JSON.parse(jsonData)); - window.addEventListener('resize', function () { - chart.resize(); - }); - }); + chart.setOption(JSON.parse(jsonData)); + window.addEventListener('resize', function () { + chart.resize(); + }); + }); + } + }; {% endif %} diff --git a/_includes/scripts/imageLayouts.liquid b/_includes/scripts/imageLayouts.liquid index 131fcbc198b6..bb8c5a2c744b 100644 --- a/_includes/scripts/imageLayouts.liquid +++ b/_includes/scripts/imageLayouts.liquid @@ -1,11 +1,12 @@ {% if page.images %} {% if page.images.compare %} - + {% endif %} {% if page.images.slider %} {% endif %} diff --git a/_includes/scripts/leaflet.liquid b/_includes/scripts/leaflet.liquid index 516f23985d97..13b2bda64b41 100644 --- a/_includes/scripts/leaflet.liquid +++ b/_includes/scripts/leaflet.liquid @@ -1,28 +1,32 @@ {% if page.map %} {% endif %} diff --git a/_includes/scripts/masonry.liquid b/_includes/scripts/masonry.liquid index c82f774b9a4b..cbc3c9a71eb6 100644 --- a/_includes/scripts/masonry.liquid +++ b/_includes/scripts/masonry.liquid @@ -6,6 +6,11 @@ integrity="{{ site.masonry.integrity }}" crossorigin="anonymous" > - + {% endif %} diff --git a/_includes/scripts/mermaid.liquid b/_includes/scripts/mermaid.liquid index ebfd577f3f34..e4f18396dba7 100644 --- a/_includes/scripts/mermaid.liquid +++ b/_includes/scripts/mermaid.liquid @@ -1,45 +1,55 @@ {% if page.mermaid and page.mermaid.enabled %} {% if page.mermaid.zoomable %} - + {% endif %} {% endif %} diff --git a/_includes/scripts/tikzjax.liquid b/_includes/scripts/tikzjax.liquid new file mode 100644 index 000000000000..aa2a3c163c37 --- /dev/null +++ b/_includes/scripts/tikzjax.liquid @@ -0,0 +1,3 @@ +{% if page.tikzjax %} + +{% endif %} diff --git a/_includes/scripts/vega.liquid b/_includes/scripts/vega.liquid index 1e8c397c8d79..c870cf3577ae 100644 --- a/_includes/scripts/vega.liquid +++ b/_includes/scripts/vega.liquid @@ -1,17 +1,20 @@ {% if page.chart and page.chart.vega_lite %} @@ -20,21 +23,25 @@ /* Create vega lite chart as another node and hide the code block, appending the vega lite node after it this is done to enable retrieving the code again when changing theme between light/dark */ - document.querySelectorAll('pre>code.language-vega_lite').forEach((elem) => { - const jsonData = elem.textContent; - const backup = elem.parentElement; - backup.classList.add('unloaded'); - /* create vega lite node */ - let chartElement = document.createElement('div'); - chartElement.classList.add('vega-lite'); - backup.after(chartElement); + document.onreadystatechange = () => { + if (document.readyState === 'complete') { + document.querySelectorAll('pre>code.language-vega_lite').forEach((elem) => { + const jsonData = elem.textContent; + const backup = elem.parentElement; + backup.classList.add('unloaded'); + /* create vega lite node */ + let chartElement = document.createElement('div'); + chartElement.classList.add('vega-lite'); + backup.after(chartElement); - /* Embed the visualization in the container */ - if (theme === 'dark') { - vegaEmbed(chartElement, JSON.parse(jsonData), { theme: 'dark' }); - } else { - vegaEmbed(chartElement, JSON.parse(jsonData)); + /* Embed the visualization in the container */ + if (theme === 'dark') { + vegaEmbed(chartElement, JSON.parse(jsonData), { theme: 'dark' }); + } else { + vegaEmbed(chartElement, JSON.parse(jsonData)); + } + }); } - }); + }; {% endif %} diff --git a/_layouts/default.liquid b/_layouts/default.liquid index c5a7fabfef25..6809a73d75ff 100644 --- a/_layouts/default.liquid +++ b/_layouts/default.liquid @@ -48,11 +48,12 @@ {% include scripts/bootstrap.liquid %} {% include scripts/masonry.liquid %} {% include scripts/mermaid.liquid %} - {% include scripts/codeDiff.liquid %} + {% include scripts/diff2html.liquid %} {% include scripts/leaflet.liquid %} {% include scripts/chartjs.liquid %} {% include scripts/echarts.liquid %} {% include scripts/vega.liquid %} + {% include scripts/tikzjax.liquid %} {% include scripts/misc.liquid %} {% include scripts/badges.liquid %} {% include scripts/mathjax.liquid %} diff --git a/_posts/2023-07-04-jupyter-notebook.md b/_posts/2023-07-04-jupyter-notebook.md index 80fce4b28308..8c1a1fc8f42c 100644 --- a/_posts/2023-07-04-jupyter-notebook.md +++ b/_posts/2023-07-04-jupyter-notebook.md @@ -13,11 +13,16 @@ To include a jupyter notebook in a post, you can use the following code: {% raw %} -```html -{::nomarkdown} {% assign jupyter_path = "assets/jupyter/blog.ipynb" | relative_url %} {% capture notebook_exists %}{% file_exists -assets/jupyter/blog.ipynb %}{% endcapture %} {% if notebook_exists == "true" %} {% jupyter_notebook jupyter_path %} {% else %} -

Sorry, the notebook you are looking for does not exist.

-{% endif %} {:/nomarkdown} +```liquid +{::nomarkdown} +{% assign jupyter_path = 'assets/jupyter/blog.ipynb' | relative_url %} +{% capture notebook_exists %}{% file_exists assets/jupyter/blog.ipynb %}{% endcapture %} +{% if notebook_exists == 'true' %} + {% jupyter_notebook jupyter_path %} +{% else %} +

Sorry, the notebook you are looking for does not exist.

+{% endif %} +{:/nomarkdown} ``` {% endraw %}