mirror of
https://github.com/cotes2020/chirpy-starter.git
synced 2025-07-02 12:28:57 +10:00
fix: update layout and import Chirpy template files
This commit is contained in:
25
assets/js/data/mathjax.js
Normal file
25
assets/js/data/mathjax.js
Normal file
@ -0,0 +1,25 @@
|
||||
---
|
||||
layout: compress
|
||||
# WARNING: Don't use '//' to comment out code, use '{% comment %}' and '{% endcomment %}' instead.
|
||||
---
|
||||
|
||||
{%- comment -%}
|
||||
See: <https://docs.mathjax.org/en/latest/options/input/tex.html#tex-options>
|
||||
{%- endcomment -%}
|
||||
|
||||
MathJax = {
|
||||
tex: {
|
||||
{%- comment -%} start/end delimiter pairs for in-line math {%- endcomment -%}
|
||||
inlineMath: [
|
||||
['$', '$'],
|
||||
['\\(', '\\)']
|
||||
],
|
||||
{%- comment -%} start/end delimiter pairs for display math {%- endcomment -%}
|
||||
displayMath: [
|
||||
['$$', '$$'],
|
||||
['\\[', '\\]']
|
||||
],
|
||||
{%- comment -%} equation numbering {%- endcomment -%}
|
||||
tags: 'ams'
|
||||
}
|
||||
};
|
20
assets/js/data/search.json
Normal file
20
assets/js/data/search.json
Normal file
@ -0,0 +1,20 @@
|
||||
---
|
||||
layout: compress
|
||||
swcache: true
|
||||
---
|
||||
|
||||
[
|
||||
{% for post in site.posts %}
|
||||
{
|
||||
"title": {{ post.title | jsonify }},
|
||||
"url": {{ post.url | relative_url | jsonify }},
|
||||
"categories": {{ post.categories | join: ', ' | jsonify }},
|
||||
"tags": {{ post.tags | join: ', ' | jsonify }},
|
||||
"date": "{{ post.date }}",
|
||||
{% include no-linenos.html content=post.content %}
|
||||
{% assign _content = content | strip_html | strip_newlines %}
|
||||
"snippet": {{ _content | truncate: 200 | jsonify }},
|
||||
"content": {{ _content | jsonify }}
|
||||
}{% unless forloop.last %},{% endunless %}
|
||||
{% endfor %}
|
||||
]
|
47
assets/js/data/swconf.js
Normal file
47
assets/js/data/swconf.js
Normal file
@ -0,0 +1,47 @@
|
||||
---
|
||||
layout: compress
|
||||
permalink: '/:path/swconf.js'
|
||||
# Note that this file will be fetched by the ServiceWorker, so it will not be cached.
|
||||
---
|
||||
|
||||
const swconf = {
|
||||
{% if site.pwa.cache.enabled %}
|
||||
cacheName: 'chirpy-{{ "now" | date: "%s" }}',
|
||||
|
||||
{%- comment -%} Resources added to the cache during PWA installation. {%- endcomment -%}
|
||||
resources: [
|
||||
'{{ "/assets/css/:THEME.css" | replace: ':THEME', site.theme | relative_url }}',
|
||||
'{{ "/" | relative_url }}',
|
||||
{% for tab in site.tabs %}
|
||||
'{{- tab.url | relative_url -}}',
|
||||
{% endfor %}
|
||||
|
||||
{% assign cache_list = site.static_files | where: 'swcache', true %}
|
||||
{% for file in cache_list %}
|
||||
'{{ file.path | relative_url }}'{%- unless forloop.last -%},{%- endunless -%}
|
||||
{% endfor %}
|
||||
],
|
||||
|
||||
interceptor: {
|
||||
{%- comment -%} URLs containing the following paths will not be cached. {%- endcomment -%}
|
||||
paths: [
|
||||
{% for path in site.pwa.cache.deny_paths %}
|
||||
{% unless path == empty %}
|
||||
'{{ path | relative_url }}'{%- unless forloop.last -%},{%- endunless -%}
|
||||
{% endunless %}
|
||||
{% endfor %}
|
||||
],
|
||||
|
||||
{%- comment -%} URLs containing the following prefixes will not be cached. {%- endcomment -%}
|
||||
urlPrefixes: [
|
||||
{% if site.analytics.goatcounter.id != nil and site.pageviews.provider == 'goatcounter' %}
|
||||
'https://{{ site.analytics.goatcounter.id }}.goatcounter.com/counter/'
|
||||
{% endif %}
|
||||
]
|
||||
},
|
||||
|
||||
purge: false
|
||||
{% else %}
|
||||
purge: true
|
||||
{% endif %}
|
||||
};
|
Reference in New Issue
Block a user