Skip to content

Commit abbcdbf

Browse files
committed
feat(layout): add Font Awesome image attribution icon to post header
Automatically generates a Pexels photo credit link from the image URL and displays a small info-circle icon in the bottom-right corner of the header image. Enhances ethical attribution while preserving the clean Spectral theme aesthetic.
1 parent 06fe026 commit abbcdbf

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

_layouts/post.html

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
<article id="main">
1717
<header style="position: relative; overflow: hidden;">
1818
{% if page.image %}
19+
{% assign image_id = page.image | split: '/' | slice: -2, 1 | first %}
20+
{% assign credit_url = "https://www.pexels.com/photo/" | append: image_id | append: "/" %}
1921
<div style="
2022
position: absolute;
2123
top: 0; left: 0;
@@ -25,7 +27,20 @@
2527
background-position: center;
2628
filter: brightness({{ page.image_brightness | default: 0.5 }});
2729
z-index: 0;
28-
"></div>
30+
">
31+
<a href="{{ credit_url }}" target="_blank" title="Image credit on Pexels" style="
32+
position: absolute;
33+
bottom: 10px;
34+
right: 10px;
35+
z-index: 2;
36+
color: white;
37+
opacity: 0.9;
38+
font-size: 2rem;
39+
text-decoration: none;
40+
">
41+
<i class="fa fa-camera" aria-hidden="true"></i>
42+
</a>
43+
</div>
2944
{% endif %}
3045

3146
<div style="position: relative; z-index: 1; padding: 2rem; color: {{ page.text_color | default: 'white' }};">

0 commit comments

Comments
 (0)