feat: manually generate ogi to speed up builds

This commit is contained in:
Cory Dransfeldt 2024-05-02 14:49:04 -07:00
parent 25cc2f9d77
commit 7b7ce22aad
No known key found for this signature in database
303 changed files with 87 additions and 114 deletions

View file

@ -0,0 +1,46 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg width="1200" height="630" viewBox="0 0 1200 630" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
{% assign titleInLines = preview.data.title | splitLines: 40 %}
{% assign numberOfLines = titleInLines.length %}
{% if numberOfLines == 1 %}
{% assign verticalStartingPoint = 340 %}
{% elsif numberOfLines == 2 %}
{% assign verticalStartingPoint = 290 %}
{% elsif numberOfLines == 3 %}
{% assign verticalStartingPoint = 250 %}
{% elsif numberOfLines == 4 %}
{% assign verticalStartingPoint = 210 %}
{% elsif numberOfLines == 5 %}
{% assign verticalStartingPoint = 170 %}
{% endif %}
<svg id="visual" viewBox="0 0 1200 630" width="1200" height="630" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"><rect x="0" y="0" width="1200" height="630" fill="#000"></rect></svg>
<!-- date -->
<text
font-family="MonoLisa, Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, ui-monospace, monospace"
font-size="24"
font-weight="800"
fill="#fff"
>
<tspan x="80" y="{{ verticalStartingPoint | minus: 120 }}">
{{ preview.data.date | date: "MMMM d, yyyy" }}
</tspan>
</text>
<!-- title -->
<text
id="text"
font-family="MonoLisa, Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, ui-monospace, monospace"
font-size="40"
font-weight="800"
fill="#fff"
>
{% for line in titleInLines %}
{% capture spacing %}{{ forloop.index0 | times: 50 }}{% endcapture %}
<tspan x="80" y="{{ verticalStartingPoint | plus: spacing }}">
{{ line }}
</tspan>
{% endfor %}
</text>
</svg>

After

Width:  |  Height:  |  Size: 1.7 KiB