feat: cms integration

This commit is contained in:
Cory Dransfeldt 2024-06-01 07:16:49 -07:00
parent ff77bdaf36
commit d23243b177
No known key found for this signature in database
1050 changed files with 1032 additions and 27229 deletions

View file

@ -25,7 +25,7 @@
{%- assign pageDescription = meta.siteDescription -%}
{%- if schema == 'blog' -%}
{%- assign pageDescription = post_excerpt | markdown | strip_html -%}
{%- assign pageDescription = post.description | markdown | strip_html -%}
{%- elsif artist.description -%}
{%- assign pageDescription = artist.description | truncate: 300 -%}
{%- elsif book.description -%}
@ -42,9 +42,6 @@
{%- assign ogImage = meta.meta_data.opengraph_default -%}
{%- case schema -%}
{%- when 'blog' -%}
{%- assign ogBlogSlug = title | slugifyString -%}
{%- assign ogImage = meta.url | append: '/assets/img/ogi/' | append: ogBlogSlug | append: '-preview.png' -%}
{%- when 'music' -%}
{%- assign ogImage = music.recent.artists[0].image -%}
{%- when 'music-index' -%}

View file

@ -10,7 +10,7 @@
"id": "{{ entry.url | btoa }}",
"title": "{{ entry.title | replaceQuotes }}",
"url": "{{ entry.url }}",
"content_text": "{{ entry.title | replaceQuotes }}{% if entry.url | tagLookup: tagMap %} {{ entry.url | tagLookup: tagMap }} {{ entry.url }}{% else %} {{ entry.url }}{% endif %}",
"content_text": "{{ entry.title | replaceQuotes }} {{ entry.url }}",
"date_published": "{{ entry.date | stringToRFC822Date }}"
}{% if not forloop.last %},{% endif %}
{%- endfor %}

View file

@ -15,17 +15,16 @@
<height>144</height>
</image>
{% for entry in entries limit: 20 -%}
{% assign author = entry.url | stripUtm | authorLookup %}
{% assign rating = entry.rating %}
<item>
<title>
{{ entry.title | escape }}
{% if author %} via {{ author }}{% endif %}
{% if entry.authors %} via {{ entry.authors.name }}{% endif %}
{% if rating %} ({{ rating }}){% endif %}
</title>
<link>{{ entry.url | stripUtm | encodeAmp }}</link>
<link>{{ entry.url | encodeAmp }}</link>
<pubDate>{{ entry.date | stringToRFC822Date }}</pubDate>
<guid>{{ entry.url | stripUtm | encodeAmp }}</guid>
<guid>{{ entry.url | encodeAmp }}</guid>
<description>{{ entry.excerpt | escape }}</description>
</item>
{%- endfor %}

View file

@ -1,7 +1,7 @@
{%- assign posts = postData | filterByPostType: postType %}
<div class="article-widget-wrapper">
<div class="section-header-wrapper">
<h2 id="artists" class="section-header posts flex-centered">
<h2 class="section-header posts flex-centered">
{% tablericon icon title %}
{{ title }}
</h2>
@ -15,11 +15,11 @@
</time>
</div>
<a href="{{ post.url }}">
<h2 class="flex-centered">{{ post.data.title }}</h2>
<h2 class="flex-centered">{{ post.title }}</h2>
</a>
<span class="p-author h-card hidden">{{ meta.siteName }}</span>
<div class="p-summary hidden">{{ post.data.post_excerpt }}</div>
{{ post.data.post_excerpt | markdown | truncateByWordCount: 25 }}
{{ post.description | truncate: 300 }}
</article>
{% endfor %}
{% if postType != 'featured' %}

View file

@ -3,7 +3,7 @@
<div class="media-grid {% if shape == 'square' %}square{% else %}vertical{% endif %}">
{% for item in media limit: count | default: media.size %}
{% assign alt = item.alt | strip | escape %}
<a href="{{ item.url | stripUtm }}" title="{{ alt }}">
<a href="{{ item.url }}" title="{{ alt }}">
<div class="item-wrapper shadow">
<div class="meta-text">
{% if item.title %}

View file

@ -1,14 +1,14 @@
{% assign posts = posts | getPopularPosts: analytics %}
{% if posts.size > 0 %}
{% assign postData = posts | getPopularPosts: analytics %}
{% if postData.size > 0 %}
<h2 class="link-list-header flex-centered">
{% tablericon "flame" "Popular" %}
Popular posts
</h2>
<ul class="link-list">
{% for post in posts limit: 5 %}
{% for post in postData limit: 5 %}
<li>
<a class="no-underline" href="{{post.url}}" title="{{ post.data.title | escape}}">
{{ post.data.title }}
<a class="no-underline" href="{{ post.url }}" title="{{ post.title | escape}}">
{{ post.title }}
</a>
</li>
{% endfor %}

View file

@ -5,12 +5,11 @@
</h2>
<ul class="link-list">
{% for link in links limit: 5 %}
{% assign author = link.data.link | stripUtm | authorLookup %}
<li>
<a href="{{ link.data.link }}" title="{{ link.data.title | escape }}">
{{ link.data.title }}
<a href="{{ link.link }}" title="{{ link.title | escape }}">
{{ link.title }}
</a>
{% if author %} via {{ author }}{% endif %}
{% if link.authors %} via <a href="{{ link.authors.url }}">{{ link.authors.name }}</a>{% endif %}
</li>
{% endfor %}
</ul>

View file

@ -1,4 +0,0 @@
<script type="module" src="/assets/scripts/components/webcare-webshare.js"></script>
<webcare-webshare share-text="{{ title }} {{ url | tagLookup: tagMap }}" share-url="{{ url }}" copy-text="{{ title }} {{ url | tagLookup: tagMap }} {{ url }}">
<button class="share icon-small icon-center-vertical" disabled>{% tablericon "share" "Share" %}</button>
</webcare-webshare>

View file

@ -1,6 +0,0 @@
{% assign filteredTags = tags | filterTags %}
<div{% if hasSpace %} style="margin-bottom:var(--sizing-md)"{% endif %}>
{% for tag in filteredTags limit: 10 %}
<a class="tag-element" href="/tags/{{ tag | downcase }}">{{ tag | formatTag }}</a>
{% endfor %}
</div>

View file

@ -7,21 +7,19 @@ schema: blog
<div class="default-wrapper">
<article class="h-entry">
<div class="flex-centered gap-xs icon-small icon-light">
{% render "partials/widgets/share-button.liquid", url:postUrl, title:title, tagMap:collections.tagMap %}
{% tablericon "calendar-month" "Date" %}
<time class="dt-published" datetime="{{ date }}">
{{ date | date: "%B %e, %Y" }}
</time>
</div>
<h2 class="p-name">{{ title }}</h2>
<div class="text-small">{% render "partials/widgets/tags.liquid", tags:tags %}</div>
<span class="p-author h-card hidden">{{ meta.author }}</span>
<div class="p-summary hidden">{{ post_excerpt }}</div>
<div class="p-summary hidden">{{ post.description }}</div>
<div class="e-content">
{% render "partials/banners/old-post.liquid", date:date %}
{% render "partials/banners/old-post.liquid", date:post.date %}
{{ content }}
</div>
</article>
</div>
{% render "partials/widgets/mastodon-post.liquid", postUrl:postUrl, linkPosts:linkPosts %}
{% render "partials/widgets/addon-links.liquid", posts:collections.posts, analytics:analytics, links:collections.links %}
{% render "partials/widgets/addon-links.liquid", posts:posts, analytics:analytics, links:collections.links %}