Skip to content

Commit

Permalink
Include local media files in website, update links in template
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdesmet committed Sep 15, 2023
1 parent 36d909d commit 6ed5416
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ exclude:
- Gemfile
- Gemfile.lock
- LICENSE
- example/*
- example/*.csv
- example/*.json
- tests/*
- "*.json"
- vendor # Avoids https://github.com/jekyll/jekyll/issues/2938
Expand Down
8 changes: 5 additions & 3 deletions _layouts/example.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ <h3 id="{{ event_id }}">Event {{ event_id }}</h3>
{% assign obs = media_observations | where: 'mediaID', media_id | first %}
{% assign public = med.filePublic | downcase %}
{% if public == "false" %}
{% assign public = false %}
{% assign file_path = '/assets/placeholder.svg' | relative_url %}
{% elsif med.filePath contains 'http' %}
{% assign file_path = med.filePath %}
{% else %}
{% assign public = true %}
{% assign file_path = med.filePath | prepend: '/example/' | relative_url %}
{% endif %}
<div class="carousel-item{% if forloop.first %} active{% endif %}">
<img class="d-block w-100" src="{% if public %}{{ med.filePath }}{% else %}{{ '/assets/placeholder.svg' | relative_url }}{% endif %}" alt="{{ med.timestamp }}">
<img class="d-block w-100" src="{{ file_path }}" alt="{{ med.timestamp }}">
{% if obs.bboxX %}
<div class="bbox" style="
position: absolute;
Expand Down

0 comments on commit 6ed5416

Please sign in to comment.