Skip to content

Commit e1655b4

Browse files
committed
fix: clickable links
1 parent 299606f commit e1655b4

3 files changed

Lines changed: 17 additions & 4 deletions

File tree

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3.8'
22

33
services:
44
app:
5-
image: ghcr.io/cooklang/federation:0.1.8
5+
image: ghcr.io/cooklang/federation:0.1.9
66
build: .
77
ports:
88
- "${PORT:-3100}:${PORT:-3100}"

src/web/templates/feeds.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ <h3 class="text-xl font-semibold text-gray-900 mb-1">
4444
<p class="text-gray-600 text-sm mb-2">by {{ feed.author }}</p>
4545
{% endif %}
4646

47-
<p class="text-gray-500 text-sm mb-3 break-all">{{ feed.url }}</p>
47+
<a href="{{ feed.url }}" target="_blank" rel="noopener noreferrer" class="text-gray-500 text-sm mb-3 break-all hover:text-orange-600 hover:underline block">{{ feed.url }}</a>
4848

4949
<div class="flex items-center gap-4 text-sm text-gray-600">
5050
<span class="flex items-center">

src/web/templates/recipe.html

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% extends "base.html" %}
22

3-
{% block title %}{{ recipe.title }} - Cooklang Federation{% endblock %}
3+
{% block title %}{% if let Some(metadata) = recipe.metadata %}{% if let Some(title) = metadata.title %}{{ title }}{% else %}{{ recipe.title }}{% endif %}{% else %}{{ recipe.title }}{% endif %} - Cooklang Federation{% endblock %}
44

55
{% block content %}
66
<div class="container-recipe py-8">
@@ -11,7 +11,7 @@
1111

1212
<!-- Recipe Header -->
1313
<div class="recipe-card p-8 mb-6">
14-
<h1 class="gradient-title text-5xl mb-6 text-balance">{{ recipe.title }}</h1>
14+
<h1 class="gradient-title text-5xl mb-6 text-balance">{% if let Some(metadata) = recipe.metadata %}{% if let Some(title) = metadata.title %}{{ title }}{% else %}{{ recipe.title }}{% endif %}{% else %}{{ recipe.title }}{% endif %}</h1>
1515

1616
<!-- Display metadata from parsed recipe (like cookcli) -->
1717
{% if let Some(metadata) = recipe.metadata %}
@@ -85,6 +85,19 @@ <h1 class="gradient-title text-5xl mb-6 text-balance">{{ recipe.title }}</h1>
8585
</div>
8686
{% endif %}
8787

88+
{% if let Some(source) = metadata.source %}
89+
<div class="metadata-pill">
90+
<span class="emoji">🔗</span>
91+
<span>
92+
{% if source.starts_with("http://") || source.starts_with("https://") %}
93+
<a href="{{ source }}" target="_blank" rel="noopener noreferrer" class="text-orange-600 hover:text-orange-700 hover:underline"><strong>Source</strong></a>
94+
{% else %}
95+
<strong>Source:</strong> {{ source }}
96+
{% endif %}
97+
</span>
98+
</div>
99+
{% endif %}
100+
88101
<!-- Custom metadata -->
89102
{% for (key, value) in metadata.custom %}
90103
<div class="metadata-pill">

0 commit comments

Comments
 (0)