Files
wp-fedistream/templates/shortcodes/artist.twig
magdev 4a5d7b9f4d feat: Initial release v0.1.0
WP FediStream - Stream music over ActivityPub

Features:
- Custom post types: Artist, Album, Track, Playlist
- Custom taxonomies: Genre, Mood, License
- User roles: Artist, Label
- Admin dashboard with statistics
- Frontend templates and shortcodes
- Audio player with queue management
- ActivityPub integration with actor support
- WooCommerce product types for albums/tracks
- User library with favorites and history
- Notification system (in-app and email)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-28 23:23:05 +01:00

66 lines
3.2 KiB
Twig

{# Artist shortcode template #}
<div class="fedistream-shortcode fedistream-shortcode--artist fedistream-shortcode--{{ layout }}">
<div class="fedistream-artist">
<div class="fedistream-artist__header">
{% if post.thumbnail %}
<img src="{{ post.thumbnail }}" alt="{{ post.title|e('html_attr') }}" class="fedistream-artist__image">
{% else %}
<div class="fedistream-artist__placeholder">
<svg viewBox="0 0 24 24" fill="currentColor"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>
</div>
{% endif %}
<div class="fedistream-artist__info">
<h3 class="fedistream-artist__name">
<a href="{{ post.permalink }}">{{ post.title }}</a>
</h3>
{% if post.artist_type %}
<span class="fedistream-artist__type">{{ post.artist_type }}</span>
{% endif %}
{% if post.genres is not empty %}
<div class="fedistream-artist__genres">
{% for genre in post.genres %}
<a href="{{ genre.link }}" class="fedistream-tag">{{ genre.name }}</a>
{% endfor %}
</div>
{% endif %}
</div>
</div>
{% if layout == 'full' and post.content %}
<div class="fedistream-artist__bio">
{{ post.content|raw }}
</div>
{% endif %}
{% if show_albums and post.albums is not empty %}
<div class="fedistream-artist__albums">
<h4 class="fedistream-section__title">{{ __('Albums', 'wp-fedistream') }}</h4>
<div class="fedistream-grid fedistream-grid--small">
{% for album in post.albums|slice(0, 4) %}
{% include 'partials/card-album.twig' with { post: album } %}
{% endfor %}
</div>
</div>
{% endif %}
{% if show_tracks and post.tracks is not empty %}
<div class="fedistream-artist__tracks">
<h4 class="fedistream-section__title">{{ __('Popular Tracks', 'wp-fedistream') }}</h4>
<div class="fedistream-tracklist fedistream-tracklist--compact">
{% for track in post.tracks|slice(0, 5) %}
<div class="fedistream-tracklist__item" data-track-id="{{ track.id }}">
<span class="fedistream-tracklist__number">{{ loop.index }}</span>
<div class="fedistream-tracklist__info">
<a href="{{ track.permalink }}" class="fedistream-tracklist__title">{{ track.title }}</a>
</div>
{% if track.duration_formatted %}
<span class="fedistream-tracklist__duration">{{ track.duration_formatted }}</span>
{% endif %}
</div>
{% endfor %}
</div>
</div>
{% endif %}
</div>
</div>