Bundling JS with ESBuild (#702)

* add npm dependencies used in this theme

* implement helper to configure JS and ESBuild

* migrate jquery popper.js bootstrap fontawesome to js bundle

* refactor main.js into smaller pieces, and moved navbar.js to assets

* remove list.js. It adjusts post card height to be the same, but is actually not needed.

* refactored notes.js, search.js, single.js into application.js

* move ityped to js asset, implement experiences horizontal vertical line in css

* align recent post height via css

* migrated home.js and refactored into various sections

* migrated darkMode feature to js bundle

* moved mermaid feature to js bundle

* migrate syntax highlight to js bundle

* migrate katex ( js portion ) to js bundle

* migrate pdf-js to js bundle by delegating to cdn

* set explicit comparisions for feature envvars so js can properly optimize

* removed goat-counter

* more fixes for broken achievements and small bugs

* more bug fixes

* allow configuration of hightlight.js, fix video-player shortcode

* remove jquery all together

* add null handling and fix merge conflicts

Co-authored-by: Aaron Qian <aaron@yeet.io>
This commit is contained in:
Aaron Qian 2023-01-05 10:42:54 -08:00 committed by GitHub
parent fe14b0fbf5
commit 02db3d3044
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
491 changed files with 4919 additions and 151344 deletions

View file

@ -54,7 +54,7 @@
<div class="title">
<h1>{{ .Page.Title }}</h1>
</div>
{{ if site.Params.enableTags }}
{{ if site.Params.features.tags.enable }}
<div class="taxonomy-terms">
<ul style="padding-left: 0;">
{{ range .Params.tags }}
@ -158,7 +158,7 @@
<!----- Add comment support ----->
{{ if site.Params.features.comment.enable }}
{{ partial "comments.html" site.Params.features.comment }}
{{ partial "comments.html" site.Params.features.comment.services }}
{{ end }}
<!-- Keep backward compatibility with old config.yaml -->
@ -179,7 +179,7 @@
{{ define "toc" }}
<section class="toc-section" id="toc-section">
{{ if and site.Params.enableTOC ( .Params.enableTOC | default true ) }}
{{ if and site.Params.features.toc.enable ( .Params.enableTOC | default true ) }}
<div class="toc-holder">
<h5 class="text-center pl-3">{{ i18n "toc_heading" }}</h5>
<hr>
@ -192,20 +192,9 @@
{{ end }}
{{ define "scripts" }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js"></script>
<script src="{{ "/js/single.js" | relURL }}"></script>
<script>
hljs.initHighlightingOnLoad();
</script>
<!-------------- Enable Math support for this page ---------------->
{{ if .Params.math }}
{{ if site.Params.features.math.enable }}
{{ partial "math.html" . }}
{{ end }}
<!-------------- Enable mermaid support for this page ---------------->
{{ if .Params.mermaid }}
{{ partial "mermaid.html" . }}
{{ end }}
{{ end }}