Skip to content

Commit

Permalink
Pull out a couple of template variables
Browse files Browse the repository at this point in the history
As part of this I've removed the `smartify` filter, which turns out to
have a noticeable impact on performance -- from ~11s to ~8s on my MBA!
This filter is really quite slow, and irrelevant for a site title that
doesn't have anything in need of SmartyPants.
  • Loading branch information
alexwlchan committed Apr 5, 2024
1 parent 4fead65 commit 89774da
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
18 changes: 12 additions & 6 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,24 @@ liquid:
# (e.g. I don't want to set an empty `nav_section: ""` for every page
# which doesn't belong to a section).

# ================
# Remaining config

# ==================
# Template variables
# ==================
#
# These variables aren't part of any third-party Jekyll plugin; they're
# placeholders used in my templates.

title: "alexwlchan"

author: "Alex Chan"
email: "[email protected]"

description: "Alex Chan's personal blog"
email: "[email protected]"
url: "https://alexwlchan.net"

description: "Alex Chan's personal website"

# ================
# Remaining config

date_format: "%-d %B %Y"

permalink: "/:year/:title/"
Expand Down
2 changes: 1 addition & 1 deletion src/_includes/head.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% assign safe_title = page.title | markdownify_oneline | smartify | strip_html %}

<title>{% if page.title and page.title != site.title and page.title != "" %}{{ safe_title }} &ndash; {% endif %}{{ site.title | smartify }}</title>
<title>{% if page.title and page.title != site.title and page.title != "" %}{{ safe_title }} &ndash; {% endif %}{{ site.title }}</title>

<meta name="description" content="{{ page.summary | default: site.description | escape }}">

Expand Down
2 changes: 1 addition & 1 deletion src/atom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ layout: default_xml
<link href="{{ '/' | absolute_url }}" rel="alternate" type="text/html" />
<updated>{{ site.time | date_to_xmlschema }}</updated>
<id>{{ '/' | absolute_url | xml_escape }}</id>
<title type="html">{{ site.title | smartify | xml_escape }}</title>
<title type="html">{{ site.title | xml_escape }}</title>
<subtitle>{{ site.description | xml_escape }}</subtitle>

<author>
Expand Down

0 comments on commit 89774da

Please sign in to comment.