Use thumbnail_url_small whenever possible in newsfeed #13
2 changed files with 7 additions and 4 deletions
|
|
@ -29,7 +29,7 @@ respective origins, and so they do not exist in git:
|
|||
|
||||
```sh
|
||||
# in the root of the repository, run:
|
||||
curl -o calendar.ics https://devhack.net/calendar.ics
|
||||
curl -o spaceapi.json https://devhack.net/spaceapi.json
|
||||
curl -o news.json https://devhack.net/news.json
|
||||
curl -Lo calendar.ics https://devhack.net/calendar.ics
|
||||
curl -Lo spaceapi.json https://devhack.net/spaceapi.json
|
||||
curl -Lo news.json https://devhack.net/news.json
|
||||
```
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ async function fetchNewsFeed(afterID = null) {
|
|||
username: item.author.username,
|
||||
content: item.content,
|
||||
thumbnailURL: item.thumbnail_url,
|
||||
thumbnailURLSmall: item.thumbnail_url_small,
|
||||
tracTicketID: item.trac_ticket_id,
|
||||
})
|
||||
);
|
||||
|
|
@ -112,6 +113,7 @@ function createNewsItem({
|
|||
username,
|
||||
content,
|
||||
thumbnailURL,
|
||||
thumbnailURLSmall,
|
||||
tracTicketID,
|
||||
}) {
|
||||
const newsItem = newsItemTemplate.content.firstElementChild.cloneNode(true);
|
||||
|
|
@ -138,7 +140,8 @@ function createNewsItem({
|
|||
elem(newsItem, ".news-thumbnail-link").href = thumbnailURL;
|
||||
elem(newsItem, ".news-thumbnail-link").target = "_blank";
|
||||
|
||||
elem(newsItem, ".news-thumbnail-image").src = thumbnailURL;
|
||||
elem(newsItem, ".news-thumbnail-image").src = thumbnailURLSmall ??
|
||||
thumbnailURL;
|
||||
elem(newsItem, ".news-thumbnail-image").alt = `thumbnail image for post`;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue