subdomain svg correction

This commit is contained in:
Levi Neuwirth 2026-04-13 10:26:25 -04:00
parent 93d909893d
commit e005380362
4 changed files with 11 additions and 8 deletions

View File

@ -76,18 +76,21 @@ isInternalPage url
| "https://" `T.isPrefixOf` url = False
| otherwise = True
-- | True if the URL points outside the site's domain.
-- | True if the URL points outside the site's content host.
--
-- Uses a strict hostname comparison rather than substring matching, so
-- that a hostile lookalike like @evil-levineuwirth.org.attacker.com@ is
-- correctly classified as external (and gets @rel=noopener noreferrer@
-- plus @target=_blank@ applied).
-- Only @levineuwirth.org@ and @www.levineuwirth.org@ count as the content
-- site itself. Sibling subdomains like @git.levineuwirth.org@ (Forgejo) are
-- distinct services and are classified as external so they receive their
-- brand icon, @target=_blank@, and @rel=noopener noreferrer@.
--
-- Uses strict hostname comparison rather than substring matching, so a
-- hostile lookalike like @evil-levineuwirth.org.attacker.com@ is also
-- correctly classified as external.
isExternal :: Text -> Bool
isExternal url =
case extractHost url of
Nothing -> False
Just host ->
not (host == siteHost || ("." <> siteHost) `T.isSuffixOf` host)
Just host -> host /= siteHost && host /= "www." <> siteHost
where
siteHost = "levineuwirth.org"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 529 B

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 114 KiB