jekyll-theme-chirpy 6.5.5 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +8 -6
- data/_data/origin/basic.yml +3 -10
- data/_data/origin/cors.yml +17 -22
- data/_includes/analytics/cloudflare.html +7 -0
- data/_includes/analytics/goatcounter.html +6 -0
- data/_includes/analytics/google.html +13 -0
- data/_includes/analytics/matomo.html +14 -0
- data/_includes/analytics/umami.html +6 -0
- data/_includes/comments/disqus.html +5 -5
- data/_includes/comments/giscus.html +3 -3
- data/_includes/comments/utterances.html +4 -5
- data/_includes/comments.html +3 -3
- data/_includes/embed/audio.html +35 -0
- data/_includes/embed/bilibili.html +3 -4
- data/_includes/embed/video.html +59 -0
- data/_includes/embed/youtube.html +1 -1
- data/_includes/footer.html +8 -1
- data/_includes/head.html +21 -25
- data/_includes/js-selector.html +31 -37
- data/_includes/lang.html +3 -1
- data/_includes/{img-url.html → media-url.html} +8 -8
- data/_includes/mermaid.html +31 -27
- data/_includes/mode-toggle.html +24 -51
- data/_includes/pageviews/goatcounter.html +18 -0
- data/_includes/post-description.html +16 -0
- data/_includes/refactor-content.html +1 -1
- data/_includes/related-posts.html +2 -4
- data/_includes/search-loader.html +1 -1
- data/_includes/search-results.html +1 -1
- data/_includes/sidebar.html +2 -2
- data/_includes/toc.html +2 -2
- data/_includes/topbar.html +1 -1
- data/_layouts/compress.html +2 -2
- data/_layouts/default.html +3 -8
- data/_layouts/home.html +2 -5
- data/_layouts/post.html +17 -4
- data/_sass/addon/commons.scss +38 -46
- data/_sass/colors/typography-dark.scss +0 -4
- data/_sass/dist/bootstrap.css +5 -0
- data/_sass/layout/post.scss +23 -10
- data/_sass/main.bundle.scss +2 -0
- data/assets/css/jekyll-theme-chirpy.scss +5 -1
- data/assets/feed.xml +1 -8
- data/assets/js/data/mathjax.js +25 -0
- data/assets/js/data/swconf.js +0 -14
- data/assets/js/dist/app.min.js +4 -0
- data/assets/js/dist/categories.min.js +2 -2
- data/assets/js/dist/commons.min.js +2 -2
- data/assets/js/dist/home.min.js +2 -2
- data/assets/js/dist/misc.min.js +2 -2
- data/assets/js/dist/page.min.js +2 -2
- data/assets/js/dist/post.min.js +2 -2
- data/assets/js/dist/sw.min.js +5 -0
- metadata +22 -12
- data/_includes/goatcounter.html +0 -8
- data/_includes/google-analytics.html +0 -14
- data/assets/js/pwa/app.js +0 -54
- data/assets/js/pwa/sw.js +0 -101
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: c91a2e4a3421daca3bc3ddcafff42054a07939ca040eb23d9ea50c809059e37b
         | 
| 4 | 
            +
              data.tar.gz: 58c9f119e0304579bf48e3cd77dcd05cb7e40b56039af99292b391e66be84d63
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: b88b2e40a885e6a0ca252093fff60262f2535ae431049de18e1b92b2b3822f54a42ffb1747fe5482c1a6da169d9ca38b46dc9b2a769724632dc6c51f68e55474
         | 
| 7 | 
            +
              data.tar.gz: 46a3f94ee7f6d1858503bb4e4580fa27935781a39c68da9fdd80434678b13f7b8990892fbff485951465259a30a6fa92a2eb8945bb0fd2f80b44f66c5b9027cb
         | 
    
        data/README.md
    CHANGED
    
    | @@ -1,5 +1,7 @@ | |
| 1 | 
            +
            <!-- markdownlint-disable-next-line -->
         | 
| 1 2 | 
             
            <div align="center">
         | 
| 2 3 |  | 
| 4 | 
            +
              <!-- markdownlint-disable-next-line -->
         | 
| 3 5 | 
             
              # Chirpy Jekyll Theme
         | 
| 4 6 |  | 
| 5 7 | 
             
              A minimal, responsive, and feature-rich Jekyll theme for technical writing.
         | 
| @@ -18,7 +20,7 @@ | |
| 18 20 |  | 
| 19 21 | 
             
            ## Features
         | 
| 20 22 |  | 
| 21 | 
            -
            - Dark  | 
| 23 | 
            +
            - Dark Theme
         | 
| 22 24 | 
             
            - Localized UI language
         | 
| 23 25 | 
             
            - Pinned Posts on Home Page
         | 
| 24 26 | 
             
            - Hierarchical Categories
         | 
| @@ -28,13 +30,13 @@ | |
| 28 30 | 
             
            - Syntax Highlighting
         | 
| 29 31 | 
             
            - Mathematical Expressions
         | 
| 30 32 | 
             
            - Mermaid Diagrams & Flowcharts
         | 
| 31 | 
            -
            - Dark  | 
| 32 | 
            -
            - Embed  | 
| 33 | 
            -
            -  | 
| 33 | 
            +
            - Dark Mode Images
         | 
| 34 | 
            +
            - Embed Media
         | 
| 35 | 
            +
            - Comment Systems
         | 
| 34 36 | 
             
            - Built-in Search
         | 
| 35 37 | 
             
            - Atom Feeds
         | 
| 36 38 | 
             
            - PWA
         | 
| 37 | 
            -
            -  | 
| 39 | 
            +
            - Web Analytics
         | 
| 38 40 | 
             
            - SEO & Performance Optimization
         | 
| 39 41 |  | 
| 40 42 | 
             
            ## Documentation
         | 
| @@ -54,7 +56,7 @@ For details, see the "[Contributing Guidelines][contribute-guide]". | |
| 54 56 | 
             
            Thanks to [all the contributors][contributors] involved in the development of the project!
         | 
| 55 57 |  | 
| 56 58 | 
             
            [][contributors]
         | 
| 57 | 
            -
            <sub>  | 
| 59 | 
            +
            <sub> — Made with [contrib.rocks](https://contrib.rocks)</sub>
         | 
| 58 60 |  | 
| 59 61 | 
             
            ### Third-Party Assets
         | 
| 60 62 |  | 
    
        data/_data/origin/basic.yml
    CHANGED
    
    | @@ -4,13 +4,6 @@ webfonts: /assets/lib/fonts/main.css | |
| 4 4 |  | 
| 5 5 | 
             
            # Libraries
         | 
| 6 6 |  | 
| 7 | 
            -
            jquery:
         | 
| 8 | 
            -
              js: /assets/lib/jquery/jquery.min.js
         | 
| 9 | 
            -
             | 
| 10 | 
            -
            bootstrap:
         | 
| 11 | 
            -
              css: /assets/lib/bootstrap/bootstrap.min.css
         | 
| 12 | 
            -
              js: /assets/lib/bootstrap/bootstrap.bundle.min.js
         | 
| 13 | 
            -
             | 
| 14 7 | 
             
            toc:
         | 
| 15 8 | 
             
              css: /assets/lib/tocbot/tocbot.min.css
         | 
| 16 9 | 
             
              js: /assets/lib/tocbot/tocbot.min.js
         | 
| @@ -31,9 +24,9 @@ dayjs: | |
| 31 24 | 
             
                relativeTime: /assets/lib/dayjs/plugin/relativeTime.min.js
         | 
| 32 25 | 
             
                localizedFormat: /assets/lib/dayjs/plugin/localizedFormat.min.js
         | 
| 33 26 |  | 
| 34 | 
            -
             | 
| 35 | 
            -
              css: /assets/lib/ | 
| 36 | 
            -
              js: /assets/lib/ | 
| 27 | 
            +
            glightbox:
         | 
| 28 | 
            +
              css: /assets/lib/glightbox/glightbox.min.css
         | 
| 29 | 
            +
              js: /assets/lib/glightbox/glightbox.min.js
         | 
| 37 30 |  | 
| 38 31 | 
             
            lazy-polyfill:
         | 
| 39 32 | 
             
              css: /assets/lib/loading-attribute-polyfill/loading-attribute-polyfill.min.css
         | 
    
        data/_data/origin/cors.yml
    CHANGED
    
    | @@ -1,29 +1,24 @@ | |
| 1 | 
            -
            #  | 
| 2 | 
            -
             | 
| 3 | 
            -
            cdns:
         | 
| 4 | 
            -
              # Google Fonts
         | 
| 1 | 
            +
            # Resource Hints
         | 
| 2 | 
            +
            resource_hints:
         | 
| 5 3 | 
             
              - url: https://fonts.googleapis.com
         | 
| 4 | 
            +
                links:
         | 
| 5 | 
            +
                  - rel: preconnect
         | 
| 6 | 
            +
                  - rel: dns-prefetch
         | 
| 6 7 | 
             
              - url: https://fonts.gstatic.com
         | 
| 7 | 
            -
                 | 
| 8 | 
            -
             | 
| 9 | 
            -
             | 
| 8 | 
            +
                links:
         | 
| 9 | 
            +
                  - rel: preconnect
         | 
| 10 | 
            +
                    opts: [crossorigin]
         | 
| 11 | 
            +
                  - rel: dns-prefetch
         | 
| 10 12 | 
             
              - url: https://cdn.jsdelivr.net
         | 
| 11 | 
            -
             | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 14 | 
            -
            # fonts
         | 
| 13 | 
            +
                links:
         | 
| 14 | 
            +
                  - rel: preconnect
         | 
| 15 | 
            +
                  - rel: dns-prefetch
         | 
| 15 16 |  | 
| 16 | 
            -
             | 
| 17 | 
            +
            # Web Fonts
         | 
| 18 | 
            +
            webfonts: https://fonts.googleapis.com/css2?family=Lato:wght@300;400&family=Source+Sans+Pro:wght@400;600;700;900&display=swap
         | 
| 17 19 |  | 
| 18 20 | 
             
            # Libraries
         | 
| 19 21 |  | 
| 20 | 
            -
            jquery:
         | 
| 21 | 
            -
              js: https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js
         | 
| 22 | 
            -
             | 
| 23 | 
            -
            bootstrap:
         | 
| 24 | 
            -
              css: https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css
         | 
| 25 | 
            -
              js: https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js
         | 
| 26 | 
            -
             | 
| 27 22 | 
             
            toc:
         | 
| 28 23 | 
             
              css: https://cdn.jsdelivr.net/npm/tocbot@4.25.0/dist/tocbot.min.css
         | 
| 29 24 | 
             
              js: https://cdn.jsdelivr.net/npm/tocbot@4.25.0/dist/tocbot.min.js
         | 
| @@ -44,9 +39,9 @@ dayjs: | |
| 44 39 | 
             
                relativeTime: https://cdn.jsdelivr.net/npm/dayjs@1.11.10/plugin/relativeTime.min.js
         | 
| 45 40 | 
             
                localizedFormat: https://cdn.jsdelivr.net/npm/dayjs@1.11.10/plugin/localizedFormat.min.js
         | 
| 46 41 |  | 
| 47 | 
            -
             | 
| 48 | 
            -
              css: https://cdn.jsdelivr.net/npm/ | 
| 49 | 
            -
              js: https://cdn.jsdelivr.net/npm/ | 
| 42 | 
            +
            glightbox:
         | 
| 43 | 
            +
              css: https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/css/glightbox.min.css
         | 
| 44 | 
            +
              js: https://cdn.jsdelivr.net/npm/glightbox@3.3.0/dist/js/glightbox.min.js
         | 
| 50 45 |  | 
| 51 46 | 
             
            lazy-polyfill:
         | 
| 52 47 | 
             
              css: https://cdn.jsdelivr.net/npm/loading-attribute-polyfill@2.1.1/dist/loading-attribute-polyfill.min.css
         | 
| @@ -0,0 +1,13 @@ | |
| 1 | 
            +
            <!-- Global site tag (gtag.js) - Google Analytics -->
         | 
| 2 | 
            +
            <script defer src="https://www.googletagmanager.com/gtag/js?id={{ site.analytics.google.id }}"></script>
         | 
| 3 | 
            +
            <script>
         | 
| 4 | 
            +
              document.addEventListener('DOMContentLoaded', function (event) {
         | 
| 5 | 
            +
                window.dataLayer = window.dataLayer || [];
         | 
| 6 | 
            +
                function gtag() {
         | 
| 7 | 
            +
                  dataLayer.push(arguments);
         | 
| 8 | 
            +
                }
         | 
| 9 | 
            +
             | 
| 10 | 
            +
                gtag('js', new Date());
         | 
| 11 | 
            +
                gtag('config', '{{ site.analytics.google.id }}');
         | 
| 12 | 
            +
              });
         | 
| 13 | 
            +
            </script>
         | 
| @@ -0,0 +1,14 @@ | |
| 1 | 
            +
            <!-- Matomo -->
         | 
| 2 | 
            +
            <script type="text/javascript">
         | 
| 3 | 
            +
              var _paq = window._paq = window._paq || [];
         | 
| 4 | 
            +
              _paq.push(['trackPageView']);
         | 
| 5 | 
            +
              _paq.push(['enableLinkTracking']);
         | 
| 6 | 
            +
              (function() {
         | 
| 7 | 
            +
                var u="//{{ site.analytics.matomo.domain }}/";
         | 
| 8 | 
            +
                _paq.push(['setTrackerUrl', u+'matomo.php']);
         | 
| 9 | 
            +
                _paq.push(['setSiteId', {{ site.analytics.matomo.id }}]);
         | 
| 10 | 
            +
                var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
         | 
| 11 | 
            +
                g.type='text/javascript'; g.async=true; g.src=u+'matomo.js'; s.parentNode.insertBefore(g,s);
         | 
| 12 | 
            +
              })();
         | 
| 13 | 
            +
            </script>
         | 
| 14 | 
            +
            <!-- End Matomo Code -->
         | 
| @@ -10,7 +10,7 @@ | |
| 10 10 | 
             
                this.page.identifier = '{{ page.url }}';
         | 
| 11 11 | 
             
              };
         | 
| 12 12 |  | 
| 13 | 
            -
               | 
| 13 | 
            +
              {%- comment -%} Lazy loading {%- endcomment -%}
         | 
| 14 14 | 
             
              var disqus_observer = new IntersectionObserver(
         | 
| 15 15 | 
             
                function (entries) {
         | 
| 16 16 | 
             
                  if (entries[0].isIntersecting) {
         | 
| @@ -28,12 +28,12 @@ | |
| 28 28 | 
             
                { threshold: [0] }
         | 
| 29 29 | 
             
              );
         | 
| 30 30 |  | 
| 31 | 
            -
              disqus_observer.observe(document. | 
| 31 | 
            +
              disqus_observer.observe(document.getElementById('disqus_thread'));
         | 
| 32 32 |  | 
| 33 | 
            -
               | 
| 33 | 
            +
              {%- comment -%} Auto switch theme {%- endcomment -%}
         | 
| 34 34 | 
             
              function reloadDisqus() {
         | 
| 35 35 | 
             
                if (event.source === window && event.data && event.data.direction === ModeToggle.ID) {
         | 
| 36 | 
            -
                   | 
| 36 | 
            +
                  {%- comment -%} Disqus hasn't been loaded {%- endcomment -%}
         | 
| 37 37 | 
             
                  if (typeof DISQUS === 'undefined') {
         | 
| 38 38 | 
             
                    return;
         | 
| 39 39 | 
             
                  }
         | 
| @@ -44,7 +44,7 @@ | |
| 44 44 | 
             
                }
         | 
| 45 45 | 
             
              }
         | 
| 46 46 |  | 
| 47 | 
            -
              if (document. | 
| 47 | 
            +
              if (document.getElementById('mode-toggle')) {
         | 
| 48 48 | 
             
                window.addEventListener('message', reloadDisqus);
         | 
| 49 49 | 
             
              }
         | 
| 50 50 | 
             
            </script>
         | 
| @@ -2,7 +2,6 @@ | |
| 2 2 | 
             
            <script type="text/javascript">
         | 
| 3 3 | 
             
              (function () {
         | 
| 4 4 | 
             
                const origin = 'https://giscus.app';
         | 
| 5 | 
            -
                const iframe = 'iframe.giscus-frame';
         | 
| 6 5 | 
             
                const lightTheme = 'light';
         | 
| 7 6 | 
             
                const darkTheme = 'dark_dimmed';
         | 
| 8 7 |  | 
| @@ -25,6 +24,7 @@ | |
| 25 24 | 
             
                  'data-category': '{{ site.comments.giscus.category }}',
         | 
| 26 25 | 
             
                  'data-category-id': '{{ site.comments.giscus.category_id }}',
         | 
| 27 26 | 
             
                  'data-mapping': '{{ site.comments.giscus.mapping | default: 'pathname' }}',
         | 
| 27 | 
            +
                  'data-strict' : '{{ site.comments.giscus.strict | default: '0' }}',
         | 
| 28 28 | 
             
                  'data-reactions-enabled': '{{ site.comments.giscus.reactions_enabled | default: '1' }}',
         | 
| 29 29 | 
             
                  'data-emit-metadata': '0',
         | 
| 30 30 | 
             
                  'data-theme': initTheme,
         | 
| @@ -47,7 +47,7 @@ | |
| 47 47 | 
             
                    event.data &&
         | 
| 48 48 | 
             
                    event.data.direction === ModeToggle.ID
         | 
| 49 49 | 
             
                  ) {
         | 
| 50 | 
            -
                     | 
| 50 | 
            +
                    {%- comment -%} global theme mode changed {%- endcomment -%}
         | 
| 51 51 | 
             
                    const mode = event.data.message;
         | 
| 52 52 | 
             
                    const theme = mode === ModeToggle.DARK_MODE ? darkTheme : lightTheme;
         | 
| 53 53 |  | 
| @@ -57,7 +57,7 @@ | |
| 57 57 | 
             
                      }
         | 
| 58 58 | 
             
                    };
         | 
| 59 59 |  | 
| 60 | 
            -
                    const giscus = document. | 
| 60 | 
            +
                    const giscus = document.getElementsByClassName('giscus-frame')[0].contentWindow;
         | 
| 61 61 | 
             
                    giscus.postMessage({ giscus: message }, origin);
         | 
| 62 62 | 
             
                  }
         | 
| 63 63 | 
             
                });
         | 
| @@ -10,7 +10,6 @@ | |
| 10 10 | 
             
            <script type="text/javascript">
         | 
| 11 11 | 
             
              (function () {
         | 
| 12 12 | 
             
                const origin = 'https://utteranc.es';
         | 
| 13 | 
            -
                const iframe = 'iframe.utterances-frame';
         | 
| 14 13 | 
             
                const lightTheme = 'github-light';
         | 
| 15 14 | 
             
                const darkTheme = 'github-dark';
         | 
| 16 15 | 
             
                let initTheme = lightTheme;
         | 
| @@ -26,12 +25,12 @@ | |
| 26 25 | 
             
                addEventListener('message', (event) => {
         | 
| 27 26 | 
             
                  let theme;
         | 
| 28 27 |  | 
| 29 | 
            -
                   | 
| 28 | 
            +
                  {%- comment -%} credit to <https://github.com/utterance/utterances/issues/170#issuecomment-594036347> {%- endcomment -%}
         | 
| 30 29 | 
             
                  if (event.origin === origin) {
         | 
| 31 | 
            -
                     | 
| 30 | 
            +
                    {%- comment -%} page initial {%- endcomment -%}
         | 
| 32 31 | 
             
                    theme = initTheme;
         | 
| 33 32 | 
             
                  } else if (event.source === window && event.data && event.data.direction === ModeToggle.ID) {
         | 
| 34 | 
            -
                     | 
| 33 | 
            +
                    {%- comment -%} global theme mode changed {%- endcomment -%}
         | 
| 35 34 | 
             
                    const mode = event.data.message;
         | 
| 36 35 | 
             
                    theme = mode === ModeToggle.DARK_MODE ? darkTheme : lightTheme;
         | 
| 37 36 | 
             
                  } else {
         | 
| @@ -43,7 +42,7 @@ | |
| 43 42 | 
             
                    theme: theme
         | 
| 44 43 | 
             
                  };
         | 
| 45 44 |  | 
| 46 | 
            -
                  const utterances = document. | 
| 45 | 
            +
                  const utterances = document.getElementsByClassName('utterances-frame')[0].contentWindow;
         | 
| 47 46 | 
             
                  utterances.postMessage(message, origin);
         | 
| 48 47 | 
             
                });
         | 
| 49 48 | 
             
              })();
         | 
    
        data/_includes/comments.html
    CHANGED
    
    | @@ -1,5 +1,5 @@ | |
| 1 | 
            -
            <!-- | 
| 2 | 
            -
            {% if page.comments and site.comments. | 
| 3 | 
            -
              {% capture path %}comments/{{ site.comments. | 
| 1 | 
            +
            <!-- The comments switcher -->
         | 
| 2 | 
            +
            {% if page.comments and site.comments.provider %}
         | 
| 3 | 
            +
              {% capture path %}comments/{{ site.comments.provider }}.html{% endcapture %}
         | 
| 4 4 | 
             
              {% include {{ path }} %}
         | 
| 5 5 | 
             
            {% endif %}
         | 
| @@ -0,0 +1,35 @@ | |
| 1 | 
            +
            {% assign src = include.src | strip %}
         | 
| 2 | 
            +
            {% assign title = include.title | strip %}
         | 
| 3 | 
            +
            {% assign types = include.types | default: '' | strip | split: '|' %}
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            {% unless src contains '://' %}
         | 
| 6 | 
            +
              {%- capture src -%}
         | 
| 7 | 
            +
                {% include media-url.html src=src %}
         | 
| 8 | 
            +
              {%- endcapture -%}
         | 
| 9 | 
            +
            {% endunless %}
         | 
| 10 | 
            +
             | 
| 11 | 
            +
            <p>
         | 
| 12 | 
            +
              <audio class="embed-audio" controls>
         | 
| 13 | 
            +
                {% assign extension = src | split: '.' | last %}
         | 
| 14 | 
            +
                {% assign types = extension | concat: types %}
         | 
| 15 | 
            +
             | 
| 16 | 
            +
                {% assign ext_size = extension | size %}
         | 
| 17 | 
            +
                {% assign src_size = src | size %}
         | 
| 18 | 
            +
                {% assign slice_size = src_size | minus: ext_size %}
         | 
| 19 | 
            +
             | 
| 20 | 
            +
                {% assign filepath = src | slice: 0, slice_size %}
         | 
| 21 | 
            +
             | 
| 22 | 
            +
                {% for type in types %}
         | 
| 23 | 
            +
                  {% assign src = filepath | append: type %}
         | 
| 24 | 
            +
                  {% assign media_item = site.data.media | find: 'extension', type %}
         | 
| 25 | 
            +
                  {% assign mime_type = media_item.mime_type | default: type %}
         | 
| 26 | 
            +
                  <source src="{{ src }}" type="audio/{{ mime_type }}">
         | 
| 27 | 
            +
                {% endfor %}
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                Your browser does not support the audio tag. Here is a
         | 
| 30 | 
            +
                <a href="{{ src | strip }}">link to the audio file</a> instead.
         | 
| 31 | 
            +
              </audio>
         | 
| 32 | 
            +
              {% if title %}
         | 
| 33 | 
            +
                <em>{{ title }}</em>
         | 
| 34 | 
            +
              {% endif %}
         | 
| 35 | 
            +
            </p>
         | 
| @@ -1,10 +1,9 @@ | |
| 1 1 | 
             
            <iframe
         | 
| 2 | 
            -
              class="embed-video | 
| 2 | 
            +
              class="embed-video"
         | 
| 3 3 | 
             
              loading="lazy"
         | 
| 4 4 | 
             
              src="https://player.bilibili.com/player.html?bvid={{ include.id }}"
         | 
| 5 5 | 
             
              scrolling="no"
         | 
| 6 | 
            -
               | 
| 7 | 
            -
              frameborder="no"
         | 
| 6 | 
            +
              frameborder="0"
         | 
| 8 7 | 
             
              framespacing="0"
         | 
| 9 8 | 
             
              allowfullscreen="true"
         | 
| 10 | 
            -
            ></iframe>
         | 
| 9 | 
            +
            ></iframe>
         | 
| @@ -0,0 +1,59 @@ | |
| 1 | 
            +
            {% assign video_url = include.src %}
         | 
| 2 | 
            +
            {% assign title = include.title %}
         | 
| 3 | 
            +
            {% assign poster_url = include.poster %}
         | 
| 4 | 
            +
            {% assign types = include.types | default: '' | strip | split: '|' %}
         | 
| 5 | 
            +
             | 
| 6 | 
            +
            {% unless video_url contains '://' %}
         | 
| 7 | 
            +
              {%- capture video_url -%}
         | 
| 8 | 
            +
                {% include media-url.html src=video_url %}
         | 
| 9 | 
            +
              {%- endcapture -%}
         | 
| 10 | 
            +
            {% endunless %}
         | 
| 11 | 
            +
             | 
| 12 | 
            +
            {% if poster_url %}
         | 
| 13 | 
            +
              {% unless poster_url contains '://' %}
         | 
| 14 | 
            +
                {%- capture poster_url -%}
         | 
| 15 | 
            +
                  {% include media-url.html src=poster_url subpath=page.media_subpath %}
         | 
| 16 | 
            +
                {%- endcapture -%}
         | 
| 17 | 
            +
              {% endunless %}
         | 
| 18 | 
            +
              {% assign poster = 'poster="' | append: poster_url | append: '"' %}
         | 
| 19 | 
            +
            {% endif %}
         | 
| 20 | 
            +
             | 
| 21 | 
            +
            {% assign attributes = 'controls' %}
         | 
| 22 | 
            +
             | 
| 23 | 
            +
            {% if include.autoplay %}
         | 
| 24 | 
            +
              {% assign attributes = attributes | append: ' ' | append: 'autoplay' %}
         | 
| 25 | 
            +
            {% endif %}
         | 
| 26 | 
            +
             | 
| 27 | 
            +
            {% if include.loop %}
         | 
| 28 | 
            +
              {% assign attributes = attributes | append: ' ' | append: 'loop' %}
         | 
| 29 | 
            +
            {% endif %}
         | 
| 30 | 
            +
             | 
| 31 | 
            +
            {% if include.muted %}
         | 
| 32 | 
            +
              {% assign attributes = attributes | append: ' ' | append: 'muted' %}
         | 
| 33 | 
            +
            {% endif %}
         | 
| 34 | 
            +
             | 
| 35 | 
            +
            <p>
         | 
| 36 | 
            +
              <video class="embed-video file" {{ poster }} {{ attributes }}>
         | 
| 37 | 
            +
                {% assign extension = video_url | split: '.' | last %}
         | 
| 38 | 
            +
                {% assign types = extension | concat: types %}
         | 
| 39 | 
            +
             | 
| 40 | 
            +
                {% assign ext_size = extension | size %}
         | 
| 41 | 
            +
                {% assign src_size = video_url | size %}
         | 
| 42 | 
            +
                {% assign slice_size = src_size | minus: ext_size %}
         | 
| 43 | 
            +
             | 
| 44 | 
            +
                {% assign filepath = video_url | slice: 0, slice_size %}
         | 
| 45 | 
            +
             | 
| 46 | 
            +
                {% for type in types %}
         | 
| 47 | 
            +
                  {% assign src = filepath | append: type %}
         | 
| 48 | 
            +
                  {% assign media_item = site.data.media | find: 'extension', type %}
         | 
| 49 | 
            +
                  {% assign mime_type = media_item.mime_type | default: type %}
         | 
| 50 | 
            +
                  <source src="{{ src }}" type="video/{{ mime_type }}">
         | 
| 51 | 
            +
                {% endfor %}
         | 
| 52 | 
            +
             | 
| 53 | 
            +
                Your browser does not support the video tag. Here is a
         | 
| 54 | 
            +
                <a href="{{ video_url | strip }}">link to the video file</a> instead.
         | 
| 55 | 
            +
              </video>
         | 
| 56 | 
            +
              {% if title %}
         | 
| 57 | 
            +
                <em>{{ title }}</em>
         | 
| 58 | 
            +
              {% endif %}
         | 
| 59 | 
            +
            </p>
         | 
    
        data/_includes/footer.html
    CHANGED
    
    | @@ -34,7 +34,14 @@ | |
| 34 34 | 
             
                {%- endcapture -%}
         | 
| 35 35 |  | 
| 36 36 | 
             
                {%- capture _theme -%}
         | 
| 37 | 
            -
                  <a | 
| 37 | 
            +
                  <a
         | 
| 38 | 
            +
                    data-bs-toggle="tooltip"
         | 
| 39 | 
            +
                    data-bs-placement="top"
         | 
| 40 | 
            +
                    title="v{{ theme.version }}"
         | 
| 41 | 
            +
                    href="https://github.com/cotes2020/jekyll-theme-chirpy"
         | 
| 42 | 
            +
                    target="_blank"
         | 
| 43 | 
            +
                    rel="noopener"
         | 
| 44 | 
            +
                  >Chirpy</a>
         | 
| 38 45 | 
             
                {%- endcapture -%}
         | 
| 39 46 |  | 
| 40 47 | 
             
                {{ site.data.locales[include.lang].meta | replace: ':PLATFORM', _platform | replace: ':THEME', _theme }}
         | 
    
        data/_includes/head.html
    CHANGED
    
    | @@ -20,7 +20,7 @@ | |
| 20 20 |  | 
| 21 21 | 
             
                {% unless src contains '://' %}
         | 
| 22 22 | 
             
                  {%- capture img_url -%}
         | 
| 23 | 
            -
                    {% include  | 
| 23 | 
            +
                    {% include media-url.html src=src subpath=page.media_subpath absolute=true %}
         | 
| 24 24 | 
             
                  {%- endcapture -%}
         | 
| 25 25 |  | 
| 26 26 | 
             
                  {%- capture old_url -%}{{ src | absolute_url }}{%- endcapture -%}
         | 
| @@ -31,7 +31,7 @@ | |
| 31 31 |  | 
| 32 32 | 
             
              {% elsif site.social_preview_image %}
         | 
| 33 33 | 
             
                {%- capture img_url -%}
         | 
| 34 | 
            -
                  {% include  | 
| 34 | 
            +
                  {% include media-url.html src=site.social_preview_image absolute=true %}
         | 
| 35 35 | 
             
                {%- endcapture -%}
         | 
| 36 36 |  | 
| 37 37 | 
             
                {%- capture og_image -%}
         | 
| @@ -59,34 +59,30 @@ | |
| 59 59 |  | 
| 60 60 | 
             
              {% include_cached favicons.html %}
         | 
| 61 61 |  | 
| 62 | 
            -
               | 
| 63 | 
            -
             | 
| 64 | 
            -
             | 
| 65 | 
            -
             | 
| 66 | 
            -
             | 
| 67 | 
            -
                   | 
| 68 | 
            -
                  <link rel="dns-prefetch" href="{{ cdn.url }}" {{ cdn.args }}>
         | 
| 62 | 
            +
              <!-- Resource Hints -->
         | 
| 63 | 
            +
              {% unless site.assets.self_host.enabled %}
         | 
| 64 | 
            +
                {% for hint in site.data.origin.cors.resource_hints %}
         | 
| 65 | 
            +
                  {% for link in hint.links %}
         | 
| 66 | 
            +
                    <link rel="{{ link.rel }}" href="{{ hint.url }}" {{ link.opts | join: ' ' }}>
         | 
| 67 | 
            +
                  {% endfor %}
         | 
| 69 68 | 
             
                {% endfor %}
         | 
| 69 | 
            +
              {% endunless %}
         | 
| 70 70 |  | 
| 71 | 
            -
             | 
| 72 | 
            -
              {%  | 
| 73 | 
            -
             | 
| 74 | 
            -
               | 
| 75 | 
            -
              {% if jekyll.environment == 'production' and site.google_analytics.id != empty and site.google_analytics.id %}
         | 
| 76 | 
            -
                <link rel="preconnect" href="https://www.google-analytics.com" crossorigin="use-credentials">
         | 
| 77 | 
            -
                <link rel="dns-prefetch" href="https://www.google-analytics.com">
         | 
| 71 | 
            +
              <!-- Bootstrap -->
         | 
| 72 | 
            +
              {% unless jekyll.environment == 'production' %}
         | 
| 73 | 
            +
                <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css">
         | 
| 74 | 
            +
              {% endunless %}
         | 
| 78 75 |  | 
| 79 | 
            -
             | 
| 80 | 
            -
             | 
| 81 | 
            -
              {% endif %}
         | 
| 76 | 
            +
              <!-- Theme style -->
         | 
| 77 | 
            +
              <link rel="stylesheet" href="{{ '/assets/css/:THEME.css' | replace: ':THEME', site.theme | relative_url }}">
         | 
| 82 78 |  | 
| 83 | 
            -
              <!--  | 
| 84 | 
            -
              <link rel="stylesheet" href="{{ site.data.origin[type]. | 
| 79 | 
            +
              <!-- Web Font -->
         | 
| 80 | 
            +
              <link rel="stylesheet" href="{{ site.data.origin[type].webfonts | relative_url }}">
         | 
| 85 81 |  | 
| 86 | 
            -
              <!-- Font Awesome -->
         | 
| 82 | 
            +
              <!-- Font Awesome Icons -->
         | 
| 87 83 | 
             
              <link rel="stylesheet" href="{{ site.data.origin[type].fontawesome.css | relative_url }}">
         | 
| 88 84 |  | 
| 89 | 
            -
               | 
| 85 | 
            +
              <!-- 3rd-party Dependencies -->
         | 
| 90 86 |  | 
| 91 87 | 
             
              {% if site.toc and page.toc %}
         | 
| 92 88 | 
             
                <link rel="stylesheet" href="{{ site.data.origin[type].toc.css | relative_url }}">
         | 
| @@ -97,8 +93,8 @@ | |
| 97 93 | 
             
              {% endif %}
         | 
| 98 94 |  | 
| 99 95 | 
             
              {% if page.layout == 'page' or page.layout == 'post' %}
         | 
| 100 | 
            -
                <!--  | 
| 101 | 
            -
                <link rel="stylesheet" href="{{ site.data.origin[type]. | 
| 96 | 
            +
                <!-- Image Popup -->
         | 
| 97 | 
            +
                <link rel="stylesheet" href="{{ site.data.origin[type].glightbox.css | relative_url }}">
         | 
| 102 98 | 
             
              {% endif %}
         | 
| 103 99 |  | 
| 104 100 | 
             
              <!-- JavaScript -->
         | 
    
        data/_includes/js-selector.html
    CHANGED
    
    | @@ -2,12 +2,7 @@ | |
| 2 2 |  | 
| 3 3 | 
             
            <!-- commons -->
         | 
| 4 4 |  | 
| 5 | 
            -
            {% assign urls = site.data.origin[type]. | 
| 6 | 
            -
              | append: ','
         | 
| 7 | 
            -
              | append: site.data.origin[type].bootstrap.js
         | 
| 8 | 
            -
              | append: ','
         | 
| 9 | 
            -
              | append: site.data.origin[type].search.js
         | 
| 10 | 
            -
            %}
         | 
| 5 | 
            +
            {% assign urls = site.data.origin[type].search.js %}
         | 
| 11 6 |  | 
| 12 7 | 
             
            <!-- layout specified -->
         | 
| 13 8 |  | 
| @@ -20,7 +15,7 @@ | |
| 20 15 | 
             
                <!-- image lazy-loading & popup & clipboard -->
         | 
| 21 16 | 
             
                {% assign urls = urls
         | 
| 22 17 | 
             
                  | append: ','
         | 
| 23 | 
            -
                  | append: site.data.origin[type] | 
| 18 | 
            +
                  | append: site.data.origin[type].glightbox.js
         | 
| 24 19 | 
             
                  | append: ','
         | 
| 25 20 | 
             
                  | append: site.data.origin[type].clipboard.js
         | 
| 26 21 | 
             
                %}
         | 
| @@ -33,7 +28,7 @@ | |
| 33 28 | 
             
              or page.layout == 'category'
         | 
| 34 29 | 
             
              or page.layout == 'tag'
         | 
| 35 30 | 
             
            %}
         | 
| 36 | 
            -
              {% assign locale =  | 
| 31 | 
            +
              {% assign locale = include.lang | split: '-' | first %}
         | 
| 37 32 |  | 
| 38 33 | 
             
              {% assign urls = urls
         | 
| 39 34 | 
             
                | append: ','
         | 
| @@ -68,46 +63,45 @@ | |
| 68 63 | 
             
            {% endcase %}
         | 
| 69 64 |  | 
| 70 65 | 
             
            {% capture script %}{{ js_dist }}{{ js }}.min.js{% endcapture %}
         | 
| 71 | 
            -
            <script  | 
| 66 | 
            +
            <script src="{{ script | relative_url }}"></script>
         | 
| 72 67 |  | 
| 73 68 | 
             
            {% if page.math %}
         | 
| 74 69 | 
             
              <!-- MathJax -->
         | 
| 75 | 
            -
              <script>
         | 
| 76 | 
            -
                /* see: <https://docs.mathjax.org/en/latest/options/input/tex.html#tex-options> */
         | 
| 77 | 
            -
                MathJax = {
         | 
| 78 | 
            -
                  tex: {
         | 
| 79 | 
            -
                    /* start/end delimiter pairs for in-line math */
         | 
| 80 | 
            -
                    inlineMath: [
         | 
| 81 | 
            -
                      ['$', '$'],
         | 
| 82 | 
            -
                      ['\\(', '\\)']
         | 
| 83 | 
            -
                    ],
         | 
| 84 | 
            -
                    /* start/end delimiter pairs for display math */
         | 
| 85 | 
            -
                    displayMath: [
         | 
| 86 | 
            -
                      ['$$', '$$'],
         | 
| 87 | 
            -
                      ['\\[', '\\]']
         | 
| 88 | 
            -
                    ],
         | 
| 89 | 
            -
                    /* equation numbering */
         | 
| 90 | 
            -
                    tags: 'ams'
         | 
| 91 | 
            -
                  }
         | 
| 92 | 
            -
                };
         | 
| 93 | 
            -
              </script>
         | 
| 70 | 
            +
              <script src="{{ '/assets/js/data/mathjax.js' | relative_url }}"></script>
         | 
| 94 71 | 
             
              <script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=es6"></script>
         | 
| 95 72 | 
             
              <script id="MathJax-script" async src="{{ site.data.origin[type].mathjax.js | relative_url }}"></script>
         | 
| 96 73 | 
             
            {% endif %}
         | 
| 97 74 |  | 
| 75 | 
            +
            <!-- Pageviews -->
         | 
| 76 | 
            +
            {% if page.layout == 'post' %}
         | 
| 77 | 
            +
              {% assign provider = site.pageviews.provider %}
         | 
| 78 | 
            +
             | 
| 79 | 
            +
              {% if provider and provider != empty %}
         | 
| 80 | 
            +
                {% case provider %}
         | 
| 81 | 
            +
                  {% when 'goatcounter' %}
         | 
| 82 | 
            +
                    {% if site.analytics[provider].id != empty and site.analytics[provider].id %}
         | 
| 83 | 
            +
                      {% include pageviews/{{ provider }}.html %}
         | 
| 84 | 
            +
                    {% endif %}
         | 
| 85 | 
            +
                {% endcase %}
         | 
| 86 | 
            +
              {% endif %}
         | 
| 87 | 
            +
            {% endif %}
         | 
| 88 | 
            +
             | 
| 89 | 
            +
            {% if page.mermaid %}
         | 
| 90 | 
            +
              {% include mermaid.html %}
         | 
| 91 | 
            +
            {% endif %}
         | 
| 92 | 
            +
             | 
| 98 93 | 
             
            {% if jekyll.environment == 'production' %}
         | 
| 99 94 | 
             
              <!-- PWA -->
         | 
| 100 95 | 
             
              {% if site.pwa.enabled %}
         | 
| 101 96 | 
             
                <script defer src="{{ 'app.min.js' | prepend: js_dist | relative_url }}"></script>
         | 
| 102 97 | 
             
              {% endif %}
         | 
| 103 98 |  | 
| 104 | 
            -
              <!--  | 
| 105 | 
            -
              {%  | 
| 106 | 
            -
                {%  | 
| 107 | 
            -
             | 
| 108 | 
            -
             | 
| 109 | 
            -
             | 
| 110 | 
            -
             | 
| 111 | 
            -
             | 
| 112 | 
            -
              {% endif %}
         | 
| 99 | 
            +
              <!-- Web Analytics -->
         | 
| 100 | 
            +
              {% for analytics in site.analytics %}
         | 
| 101 | 
            +
                {% capture str %}{{ analytics }}{% endcapture %}
         | 
| 102 | 
            +
                {% assign type = str | split: '{' | first %}
         | 
| 103 | 
            +
                {% if site.analytics[type].id and site.analytics[type].id != empty %}
         | 
| 104 | 
            +
                  {% include analytics/{{ type }}.html %}
         | 
| 105 | 
            +
                {% endif %}
         | 
| 106 | 
            +
              {% endfor %}
         | 
| 113 107 | 
             
            {% endif %}
         | 
    
        data/_includes/lang.html
    CHANGED
    
    | @@ -1,7 +1,9 @@ | |
| 1 1 | 
             
            {% comment %}
         | 
| 2 2 | 
             
              Detect appearance language and return it through variable "lang"
         | 
| 3 3 | 
             
            {% endcomment %}
         | 
| 4 | 
            -
            {% if site.data.locales[ | 
| 4 | 
            +
            {% if site.data.locales[page.lang] %}
         | 
| 5 | 
            +
              {% assign lang = page.lang %}
         | 
| 6 | 
            +
            {% elsif site.data.locales[site.lang] %}
         | 
| 5 7 | 
             
              {% assign lang = site.lang %}
         | 
| 6 8 | 
             
            {% else %}
         | 
| 7 9 | 
             
              {% assign lang = 'en' %}
         |