Add new blog post

This commit is contained in:
Joshua Goins 2023-03-27 15:07:15 -04:00
parent d2ea995f0c
commit 99f43a61e3
4 changed files with 218 additions and 0 deletions

View file

@ -0,0 +1,16 @@
---
title: "Future of Silica Viewer"
date: 2023-03-27
draft: false
summary: "Silica Viewer is leaving the App Store."
---
I will not be renewing my Apple Developer License for various reasons [I've already discussed elsewhere]({{<ref "/blog/breaking-even" >}}). It is due to expire sometime in the summer, so there's still a couple of months before it disappears off the App Store. I'm actually _losing_ money by selling my software on the App Store, and I don't really work on a Mac anymore. Plus more fun problems related to Apple infrastructure:
{{< stoot "mastodon.art" "109916077868745391" >}}
If you already bought Silica Viewer, nothing will change - you can continue to redownload it into perpetuity. This just means you can't pay money for it now, although I wouldn't want you to because I don't keep up with active development. As always, Silica Viewer is open source and free to use still.
![Screenshot of Silicate](macos.png)
For people looking for alternative software, check out [Silicate](https://github.com/Avarel/silicate) by [Avarel](http://antran.io/). It works on more platforms than Silica Viewer, and has a better rendering engine, along with other cool features! Thank you all who have supported by using my software, as always :)

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 KiB

View file

@ -346,6 +346,40 @@ pre {
margin-right: 0; margin-right: 0;
} }
.toot-header .toot-profile img {
border-radius: 9999px;
width: 48px;
height: auto;
}
.toot-blockquote {
line-height: 1.35em;
margin: 1.5rem auto;
padding: 1rem;
border: 2px solid gray;
border-radius: 12px;
}
.toot-header .toot-author {
display: flex;
flex-direction: column;
flex-grow: 1;
margin-left: 10px;
margin-top: 3px;
}
.toot-header .toot-author .toot-author-name {
font-weight: 700;
}
.toot-header .toot-author .toot-author-handle {
line-height: 1;
}
.toot-header {
display: flex;
}
.nice-list li:not(:last-child):not(:only-child)::after { .nice-list li:not(:last-child):not(:only-child)::after {
content: "·"; content: "·";

View file

@ -0,0 +1,168 @@
<!-- from https://www.brycewray.com/posts/2022/06/static-mastodon-toots-hugo/ -->
{{ $masIns := .Get 0 }}
{{ $tootLink := "" }}
{{ $card := "" }}
{{ $handleInst := "" }}
{{ $mediaMD5 := "" }}
{{ $imageCount := 0 }}
{{ $votesCount := 0 }}
{{ $id := .Get 1 }}
{{ $urlToGet := print "https://" $masIns "/api/v1/statuses/" $id }}
{{- with resources.GetRemote $urlToGet -}}
{{ if (resources.GetRemote $urlToGet).Err }}
<blockquote class="toot-blockquote">
<p class="ctr legal">[Source not online<br />
at time of site build.]</p>
</blockquote>
{{ else }}
{{ $json := unmarshal .Content }}
{{ $jsonHolder := $json }}{{/* Being safe */}}
{{ if isset $json "account" }}
{{ $tootLink = print "https://" $masIns "@" $json.account.acct "/status/" $id }}
{{ $handleInst = print "@" $json.account.acct "@" $masIns }}
{{ end }}
{{ if isset $json "content" }}
<blockquote class="generic-con" cite="{{ $tootLink }}">
<div class="toot-header">
<a class="toot-profile" href="https://{{ $masIns }}/@{{ $json.account.acct }}" rel="noopener">
<img
src="{{ $json.account.avatar }}"
alt="Mastodon avatar for {{ $handleInst }}"
loading="lazy"
/>
</a>
<div class="toot-author">
<span class="toot-author-name" rel="noopener">{{ $json.account.display_name }}</span>
<a class="toot-author-handle" href="https://{{ $masIns }}/@{{ $json.account.acct }}" rel="noopener">{{ $handleInst }}</a>
</div>
</div>
{{ $json.content | safeHTML }}
{{ with $json.media_attachments }}
{{ range $media_attachments := . }}
{{ if eq $media_attachments.type "image" }}
{{ $imageCount = (add ($imageCount) 1) }}
{{ end }}
{{ end }}
<div class="toot-img-grid-{{ $imageCount }}">
{{ range $media_attachments := . }}
{{ if eq $media_attachments.type "image" }}
{{ $mediaMD5 = md5 $media_attachments.url }}
<style>
.img-{{ $mediaMD5 }} {
aspect-ratio: {{ $media_attachments.meta.original.width }} / {{ $media_attachments.meta.original.height }};
}
</style>
<img
src="{{ $media_attachments.url }}"
alt="Image {{ $media_attachments.id }} from toot {{ $id }} on {{ $masIns }}"
class="toot-media-img img-{{ $mediaMD5 }}{{ if $json.sensitive }} toot-sens-blur{{ end }}"
loading="lazy"
{{- if $json.sensitive }}onclick="this.classList.toggle('toot-sens-blur-no')"{{- end }}
/>
{{- if $json.sensitive -}}
<div class="blur-text">
Sensitive content<br />
(flagged&nbsp;at&nbsp;origin)
</div>
{{- end -}}
{{ end }}
{{ end }}
</div>
{{/*
N.B.:
The above results in an empty, no-height div
when there's no image but there **is**
at least one item in `$media_attachments`.
Unfortunately, it seems to be the only way
to accomplish this. Not a good HTML practice,
but gets the job done.
*/}}
{{ range $media_attachments := . }}
{{ if eq $media_attachments.type "video" }}
{{ $mediaMD5 = md5 $media_attachments.url }}
<style>
.img-{{ $mediaMD5 }} {
aspect-ratio: {{ $media_attachments.meta.original.width }} / {{ $media_attachments.meta.original.height }};
}
</style>
<div class="ctr toot-video-wrapper">
<video muted playsinline controls class="ctr toot-media-img img-{{ $mediaMD5 }}{{ if $json.sensitive }} toot-sens-blur{{ end }}"{{- if $json.sensitive }}onclick="this.classList.toggle('toot-sens-blur-no')"{{- end }}>
<source src="{{ $media_attachments.url }}">
<p class="legal ctr">(Your browser doesn&rsquo;t support the <code>video</code> tag.)</p>
</video>
{{- if $json.sensitive -}}
<div class="blur-text">
Sensitive content<br />
(flagged&nbsp;at&nbsp;origin)
</div>
{{- end -}}
</div>
{{ end }}
{{ if eq $media_attachments.type "gifv" }}
{{ $mediaMD5 = md5 $media_attachments.url }}
<style>
.img-{{ $mediaMD5 }} {
aspect-ratio: {{ $media_attachments.meta.original.width }} / {{ $media_attachments.meta.original.height }};
}
</style>
<div class="ctr toot-video-wrapper">
<video loop autoplay muted playsinline controls controlslist="nofullscreen" class="ctr toot-media-img img-{{ $mediaMD5 }}{{ if $json.sensitive }} toot-sens-blur{{ end }}" {{- if $json.sensitive }}onclick="this.classList.toggle('toot-sens-blur-no')"{{- end }}>
<source src="{{ $media_attachments.url }}">
<p class="legal ctr">(Your browser doesn&rsquo;t support the <code>video</code> tag.)</p>
</video>
{{- if $json.sensitive -}}
<div class="blur-text">
Sensitive content<br />
(flagged&nbsp;at&nbsp;origin)
</div>
{{- end -}}
</div>
{{ end }}
{{ end }}
{{ end }}
{{ with $json.card }}
{{- $cardData := . -}}
{{- with $cardData.image -}}
<a href="{{ $cardData.url }}" rel="'noopener">
<div class="toot-card">
<div class="toot-card-image">
<img src="{{ $cardData.image }}" alt="Card image from {{ $masIns }} toot {{ $id }}" loading="lazy" class="toot-card-image-image" />
</div>
<div class="toot-card-content">
<p class="card-title">{{ $cardData.title }}</p>
<p class="card-description">{{ $cardData.description }}</p>
</div>
</div>
</a>
{{- end -}}
{{ end }}
{{ with $json.poll }}
{{ $poll := . }}
{{ with $poll.options }}
{{ range $pollOptions := . }}
{{ $votesCount = add $votesCount $pollOptions.votes_count }}
{{ end }}
<div class="toot-poll-wrapper">
{{ range $pollOptions := . }}
<div class="toot-poll-count">
<strong>{{ (mul 100 (div $pollOptions.votes_count $votesCount)) | lang.FormatPercent 1 }}</strong>
</div>
<div class="toot-poll-meter">
<meter id="vote-count" max="{{ $votesCount }}" value="{{ $pollOptions.votes_count }}"></meter>
</div>
<div class="toot-poll-title">{{ $pollOptions.title }}</div>
{{ end }}
</div>
<p class="legal toot-poll-total">{{ $votesCount }} people</p>
{{ end }}
{{ end }}
<div class="toot-footer">
<a href="https://{{ $masIns }}/@{{ $json.account.acct }}/{{ $json.id }}" class="toot-date" rel="noopener">{{ dateFormat "3:04 PM • January 2, 2006" $json.created_at }}</a>&nbsp;<span class="pokey">(UTC)</span>
</div>
</blockquote>
{{ end }}
{{ end }}
{{- end -}}