| 1 |
{% extends "base.html" %} |
| 2 |
|
| 3 |
{% block title %}{{ item.title }} - Makenotwork{% endblock %} |
| 4 |
{% block body_attrs %} class="article-page"{% endblock %} |
| 5 |
|
| 6 |
{% block head %} |
| 7 |
<meta property="og:title" content="{{ item.title }} - {{ creator_username }}"> |
| 8 |
<meta property="og:description" content="{{ item.description }}"> |
| 9 |
<meta property="og:type" content="article"> |
| 10 |
<meta property="og:url" content="{{ host_url }}/i/{{ item.id }}"> |
| 11 |
<meta property="og:site_name" content="Makenot.work"> |
| 12 |
{% if let Some(img) = item.cover_image_url %} |
| 13 |
<meta property="og:image" content="{{ img }}"> |
| 14 |
<meta name="twitter:card" content="summary_large_image"> |
| 15 |
<meta name="twitter:image" content="{{ img }}"> |
| 16 |
{% else %} |
| 17 |
<meta name="twitter:card" content="summary"> |
| 18 |
{% endif %} |
| 19 |
<meta name="twitter:title" content="{{ item.title }} - {{ creator_username }}"> |
| 20 |
<meta name="twitter:description" content="{{ item.description }}"> |
| 21 |
<script type="application/ld+json"> |
| 22 |
{ |
| 23 |
"@context": "https://schema.org", |
| 24 |
"@type": "Article", |
| 25 |
"headline": "{{ item.title_json()|safe }}", |
| 26 |
"description": "{{ item.description_json()|safe }}", |
| 27 |
"url": "{{ host_url }}/i/{{ item.id }}", |
| 28 |
"author": { |
| 29 |
"@type": "Person", |
| 30 |
"name": "{{ creator_username }}", |
| 31 |
"url": "{{ host_url }}/u/{{ creator_username }}" |
| 32 |
}, |
| 33 |
"datePublished": "{{ item.release_date }}"{% if let Some(img) = item.cover_image_url %}, |
| 34 |
"image": "{{ img }}"{% endif %}, |
| 35 |
"isPartOf": { |
| 36 |
"@type": "WebSite", |
| 37 |
"name": "Makenot.work", |
| 38 |
"url": "{{ host_url }}" |
| 39 |
} |
| 40 |
} |
| 41 |
</script> |
| 42 |
{% endblock %} |
| 43 |
|
| 44 |
{% block content %} |
| 45 |
{% include "partials/site_header.html" %} |
| 46 |
|
| 47 |
<article class="article-container"> |
| 48 |
<header class="author-header"> |
| 49 |
<div class="author-avatar">{{ creator_avatar_initials }}</div> |
| 50 |
<div class="author-info"> |
| 51 |
<div class="author-name"><a href="/u/{{ creator_username }}">{% if let Some(name) = creator_display_name %}{{ name }}{% else %}{{ creator_username }}{% endif %}</a></div> |
| 52 |
<div class="article-meta">{{ item.release_date }}{% match item.content %}{% when crate::types::ItemContent::Text with { reading_time, .. } %}{% if let Some(rt) = reading_time %} | {{ rt }}{% endif %}{% when _ %}{% endmatch %}</div> |
| 53 |
</div> |
| 54 |
</header> |
| 55 |
|
| 56 |
<h1 class="article-title">{{ item.title }}</h1> |
| 57 |
|
| 58 |
{% if !item.description.is_empty() %} |
| 59 |
<p class="article-deck">{{ item.description }}</p> |
| 60 |
{% endif %} |
| 61 |
|
| 62 |
{% if let Some(text) = excerpt %} |
| 63 |
<div class="article-body article-body--excerpt"> |
| 64 |
<p>{{ text }}</p> |
| 65 |
</div> |
| 66 |
{% endif %} |
| 67 |
|
| 68 |
<div class="store-cta"> |
| 69 |
{% if has_access %} |
| 70 |
<p class="store-cta-lead">You have access to this article.</p> |
| 71 |
<a href="/l/{{ item.id }}" class="btn-primary">Read in library →</a> |
| 72 |
{% else if is_free %} |
| 73 |
{% if let Some(_user) = session_user %} |
| 74 |
{% if in_library %} |
| 75 |
<span class="library-status">In your library · <a href="/l/{{ item.id }}">Read now →</a></span> |
| 76 |
{% else %} |
| 77 |
<button class="add-to-library-btn btn-primary" |
| 78 |
hx-post="/api/library/add/{{ item.id }}" |
| 79 |
hx-swap="outerHTML">Add to Library - Free</button> |
| 80 |
{% endif %} |
| 81 |
{% else %} |
| 82 |
<a href="/login?redirect=/l/{{ item.id }}" class="btn-primary">Log in to read - Free</a> |
| 83 |
{% endif %} |
| 84 |
{% else %} |
| 85 |
<p class="store-cta-price">{{ item.price }}</p> |
| 86 |
{% if let Some(_user) = session_user %} |
| 87 |
<a href="/purchase/{{ item.id }}" class="btn-primary">{% if item.pwyw_enabled %}Pay What You Want{% else %}Buy Once{% endif %} - {{ item.price }}</a> |
| 88 |
{% else %} |
| 89 |
<a href="/login?redirect=/i/{{ item.id }}" class="btn-primary">Log in to purchase</a> |
| 90 |
{% endif %} |
| 91 |
<p class="store-cta-note">Support {{ creator_username }} directly — 0% platform fee.</p> |
| 92 |
{% endif %} |
| 93 |
</div> |
| 94 |
|
| 95 |
<footer class="article-footer"> |
| 96 |
<div class="author-bio"> |
| 97 |
<div class="author-avatar">{{ creator_avatar_initials }}</div> |
| 98 |
<div class="author-bio-content"> |
| 99 |
<div class="author-bio-name"> |
| 100 |
<a href="/u/{{ creator_username }}">{% if let Some(name) = creator_display_name %}{{ name }}{% else %}{{ creator_username }}{% endif %}</a> |
| 101 |
</div> |
| 102 |
</div> |
| 103 |
</div> |
| 104 |
|
| 105 |
{% if !item.tags.is_empty() %} |
| 106 |
<div class="article-tags"> |
| 107 |
{% for tag in item.tags %} |
| 108 |
<a href="/discover?tag={{ tag.slug }}" class="article-tag article-tag--plain">{{ tag.name }}</a> |
| 109 |
{% endfor %} |
| 110 |
</div> |
| 111 |
{% endif %} |
| 112 |
</footer> |
| 113 |
</article> |
| 114 |
|
| 115 |
{% include "partials/discussion_section.html" %} |
| 116 |
|
| 117 |
<footer class="text-reader-footer"> |
| 118 |
<a href="/i/{{ item.id }}" data-copy-link>Copy link</a> · |
| 119 |
<a href="/">Makenot<span class="dot">.</span>work</a> | Fair distribution for creatives of all kinds |
| 120 |
</footer> |
| 121 |
{% endblock %} |
| 122 |
|