Skip to content

Commit 9d39fe5

Browse files
committed
Add 404 page, feed, and service worker configuration; include MathJax and search data
1 parent 3e67ee1 commit 9d39fe5

File tree

9 files changed

+180
-0
lines changed

9 files changed

+180
-0
lines changed

assets/.DS_Store

0 Bytes
Binary file not shown.

assets/404.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
layout: page
3+
title: "404: Page not found"
4+
permalink: /404.html
5+
6+
redirect_from:
7+
- /norobots/
8+
- /assets/
9+
- /posts/
10+
---
11+
12+
{% include lang.html %}
13+
14+
<p class="lead">{{ site.data.locales[lang].not_found.statement }}</p>

assets/css/jekyll-theme-chirpy.scss

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
---
3+
4+
@use 'main
5+
{%- if jekyll.environment == 'production' -%}
6+
.bundle
7+
{%- endif -%}
8+
';
9+
10+
/* append your custom style below */

assets/feed.xml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
layout: compress
3+
permalink: /feed.xml
4+
# Atom Feed, reference: https://validator.w3.org/feed/docs/atom.html
5+
---
6+
7+
{% capture source %}
8+
<feed xmlns="http://www.w3.org/2005/Atom">
9+
<id>{{ "/" | absolute_url }}</id>
10+
<title>{{ site.title }}</title>
11+
<subtitle>{{ site.description }}</subtitle>
12+
<updated>{{ site.time | date_to_xmlschema }}</updated>
13+
<author>
14+
<name>{{ site.social.name }}</name>
15+
<uri>{{ "/" | absolute_url }}</uri>
16+
</author>
17+
<link rel="self" type="application/atom+xml" href="{{ page.url | absolute_url }}"/>
18+
<link rel="alternate" type="text/html" hreflang="{{ site.alt_lang | default: site.lang }}"
19+
href="{{ '/' | absolute_url }}"/>
20+
<generator uri="https://jekyllrb.com/" version="{{ jekyll.version }}">Jekyll</generator>
21+
<rights> © {{ 'now' | date: '%Y' }} {{ site.social.name }} </rights>
22+
<icon>{{ site.baseurl }}/assets/img/favicons/favicon.ico</icon>
23+
<logo>{{ site.baseurl }}/assets/img/favicons/favicon-96x96.png</logo>
24+
25+
{% for post in site.posts limit: 5 %}
26+
{% assign post_absolute_url = post.url | absolute_url %}
27+
<entry>
28+
<title>{{ post.title }}</title>
29+
<link href="{{ post_absolute_url }}" rel="alternate" type="text/html" title="{{ post.title | xml_escape }}" />
30+
<published>{{ post.date | date_to_xmlschema }}</published>
31+
{% if post.last_modified_at %}
32+
<updated>{{ post.last_modified_at | date_to_xmlschema }}</updated>
33+
{% else %}
34+
<updated>{{ post.date | date_to_xmlschema }}</updated>
35+
{% endif %}
36+
<id>{{ post_absolute_url }}</id>
37+
<content type="text/html" src="{{ post_absolute_url }}" />
38+
<author>
39+
<name>{{ post.author | default: site.social.name }}</name>
40+
</author>
41+
42+
{% if post.categories %}
43+
{% for category in post.categories %}
44+
<category term="{{ category }}" />
45+
{% endfor %}
46+
{% endif %}
47+
48+
<summary>{% include post-description.html max_length=400 %}</summary>
49+
50+
</entry>
51+
{% endfor %}
52+
</feed>
53+
{% endcapture %}
54+
{{ source | replace: '&', '&amp;' }}

assets/js/.DS_Store

6 KB
Binary file not shown.

assets/js/data/mathjax.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
layout: compress
3+
# WARNING: Don't use '//' to comment out code, use '{% comment %}' and '{% endcomment %}' instead.
4+
---
5+
6+
{%- comment -%}
7+
See: <https://docs.mathjax.org/en/latest/options/input/tex.html#tex-options>
8+
{%- endcomment -%}
9+
10+
MathJax = {
11+
tex: {
12+
{%- comment -%} start/end delimiter pairs for in-line math {%- endcomment -%}
13+
inlineMath: [
14+
['$', '$'],
15+
['\\(', '\\)']
16+
],
17+
{%- comment -%} start/end delimiter pairs for display math {%- endcomment -%}
18+
displayMath: [
19+
['$$', '$$'],
20+
['\\[', '\\]']
21+
],
22+
{%- comment -%} equation numbering {%- endcomment -%}
23+
tags: 'ams'
24+
}
25+
};

assets/js/data/search.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
layout: compress
3+
swcache: true
4+
---
5+
6+
[
7+
{% for post in site.posts %}
8+
{
9+
"title": {{ post.title | jsonify }},
10+
"url": {{ post.url | relative_url | jsonify }},
11+
"categories": {{ post.categories | join: ', ' | jsonify }},
12+
"tags": {{ post.tags | join: ', ' | jsonify }},
13+
"date": "{{ post.date }}",
14+
{% include no-linenos.html content=post.content %}
15+
{% assign _content = content | strip_html | strip_newlines %}
16+
"snippet": {{ _content | truncate: 200 | jsonify }},
17+
"content": {{ _content | jsonify }}
18+
}{% unless forloop.last %},{% endunless %}
19+
{% endfor %}
20+
]

assets/js/data/swconf.js

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
layout: compress
3+
permalink: '/:path/swconf.js'
4+
# Note that this file will be fetched by the ServiceWorker, so it will not be cached.
5+
---
6+
7+
const swconf = {
8+
{% if site.pwa.cache.enabled %}
9+
cacheName: 'chirpy-{{ "now" | date: "%s" }}',
10+
11+
{%- comment -%} Resources added to the cache during PWA installation. {%- endcomment -%}
12+
resources: [
13+
'{{ "/assets/css/:THEME.css" | replace: ':THEME', site.theme | relative_url }}',
14+
'{{ "/" | relative_url }}',
15+
{% for tab in site.tabs %}
16+
'{{- tab.url | relative_url -}}',
17+
{% endfor %}
18+
19+
{% assign cache_list = site.static_files | where: 'swcache', true %}
20+
{% for file in cache_list %}
21+
'{{ file.path | relative_url }}'{%- unless forloop.last -%},{%- endunless -%}
22+
{% endfor %}
23+
],
24+
25+
interceptor: {
26+
{%- comment -%} URLs containing the following paths will not be cached. {%- endcomment -%}
27+
paths: [
28+
{% for path in site.pwa.cache.deny_paths %}
29+
{% unless path == empty %}
30+
'{{ path | relative_url }}'{%- unless forloop.last -%},{%- endunless -%}
31+
{% endunless %}
32+
{% endfor %}
33+
],
34+
35+
{%- comment -%} URLs containing the following prefixes will not be cached. {%- endcomment -%}
36+
urlPrefixes: [
37+
{% if site.analytics.goatcounter.id != nil and site.pageviews.provider == 'goatcounter' %}
38+
'https://{{ site.analytics.goatcounter.id }}.goatcounter.com/counter/'
39+
{% endif %}
40+
]
41+
},
42+
43+
purge: false
44+
{% else %}
45+
purge: true
46+
{% endif %}
47+
};

assets/robots.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
permalink: /robots.txt
3+
# The robots rules
4+
---
5+
6+
User-agent: *
7+
8+
Disallow: /norobots/
9+
10+
Sitemap: {{ '/sitemap.xml' | absolute_url }}

0 commit comments

Comments
 (0)