fix title extraction

This commit is contained in:
a 2024-01-23 13:59:14 -06:00
parent ae1221736e
commit add9440485
8 changed files with 64 additions and 12 deletions

View file

@ -1,6 +1,3 @@
+++
+++
# Activity
an Activity is just an object that has an `actor`. it represents an action that was performed.

View file

@ -1,4 +1,5 @@
+++
title = "activitypub"
+++
shortcomings

View file

@ -0,0 +1,2 @@
+++
+++

View file

@ -0,0 +1,30 @@
+++
title = "case sensitivity in emails"
+++
domain names are case-insensitive, but the local part of an email MAY be case sensitive, though it SHOULD NOT be case sensitive.
https://www.reddit.com/r/todayilearned/comments/2r264r/comment/cnbuk7w/
> Way back when Compuserve and AOL were top-tier ISPs, maybe. Each of the RFCs supercedes the old ones. Even your source acknowledges this isn't the practice:
>
>> Interpretation of the local-part of an email address is dependent on the conventions and policies implemented in the mail server. For example, case sensitivity may distinguish mailboxes differing only in capitalization of characters of the local-part, although this is not very common.[6]
>
> Your source also goes on to talk about updates, like Google making their own additions with the extra dots and plus sign.
>> Gmail ignores all dots in the local-part for the purposes of determining account identity.[7] This prevents the creation of user accounts your.user.name or yourusername when the account your.username already exists.
>
> This may be misleading because the information about the email protocols has been updated, and the old protocols are no longer valid.
> - RFC 821 was the original (1982) email protocol, sure +case sensitive.
> - RFC 2821 (2001) makes 821 & others obsolete - still +case-sensitive.
> - RFC 5321 (2008) RFC 2821 is obsolete - perhaps, but no longer considered common
>
>> Mailbox = Local-part "@" ( Domain / address-literal )
>>
>> Local-part = Dot-string / Quoted-string ; MAY be case-sensitive
>
> RFC 6530 (2012)- acknowledges this is a bad idea.
>> 10.1. Choices of Mailbox Names and Unicode Normalization
>>
>> It has long been the case that the email syntax permits choices about mailbox names that are unwise in practice, if one actually intends the mailboxes to be accessible to a broad range of senders. The most often cited examples involve the use of case-sensitivity and tricky quoting of embedded characters in mailbox local parts. These deliberately unusual constructions are permitted by the protocols, and servers are expected to support them. Although they can provide value in special cases, taking advantage of them is almost always bad practice unless the intent is to create some form of security by obscurity
>
> e-mail addresses WERE supposed to be case sensitive, but it was always a bad idea

View file

@ -0,0 +1,4 @@
+++
+++
why's it called "incognito mode" or "private browsing mode"? it's always been a misnomer. it's not private. it's not hiding your identity or fingerprint in any way. it's just a session without any of your usual cookies, and it clears itself after closing. it should be called "amnesia mode".

View file

@ -1,4 +1,5 @@
{{ define "main" }}
{{ $currentFolderName := or $.File.ContentBaseName "index" }}
<main>
<section class="section list">
<div class="container">
@ -6,7 +7,7 @@
{{ if .IsHome }}
<h1 class="section-title">{{.Site.Title}}</h1>
{{ else }}
<h1 class="section-title">{{.File.Dir}}</h1>
<h1 class="section-title">{{or .Title .File.Dir}}</h1>
{{ end }}
</header>
<div class="content">
@ -14,7 +15,7 @@
</div>
{{ with .Sections }}
<nav>
<h2 class="subsections-title">Sub-sections of {{ or $.File.ContentBaseName "index" }}</h2>
<h2 class="subsections-title">Sub-sections of {{ $currentFolderName }}</h2>
<ul class="subsections">
{{ range where . "Section" "not in" (slice "search" "sitemap") }}
<li>
@ -28,15 +29,14 @@
{{ end }}
{{ with .RegularPages }}
<nav>
<h2 class="subpages-title">Pages within {{ or $.File.ContentBaseName "index" }}</h2>
<h2 class="subpages-title">Pages within {{ $currentFolderName }}</h2>
<ul class="subpages">
{{ range . }}
<li>
<a href="{{ .Permalink }}">
{{ $header := substr (delimit (findRE "^#{1} ([^{\n]+)" .RawContent 1) "") 2 }}
{{ $firstH1 := partial "name.html" . }}
{{ if .Site.Params.use_titles_in_section_lists}}
{{ or .Title $header .File.BaseFileName }}
{{ or .Title $firstH1 .File.BaseFileName }}
{{ else }}
{{ .File.LogicalName }}
{{ end }}

View file

@ -0,0 +1,16 @@
{{ $firstH1 :=
(
substr
(
delimit
(
findRE
"^#{1} ([^{\n]+)"
.RawContent
1
)
""
)
2
)
}}

View file

@ -1,7 +1,9 @@
{{ "<!-- title -->" | safeHTML }}
<title itemprop="name">{{ .Title }} - {{ .Site.Title }}</title>
<meta property="og:title" content="{{ .Title }}" />
<meta name="twitter:title" content="{{ .Title }}" />
{{ $firstH1 := partial "name.html" . }}
{{ $title := or .Title $firstH1 $.File.ContentBaseName }}
<title itemprop="name">{{ $title }} - {{ .Site.Title }}</title>
<meta property="og:title" content="{{ $title }}" />
<meta name="twitter:title" content="{{ $title }}" />
<meta name="application-name" content="{{ .Site.Title }}" />
<meta property="og:site_name" content="{{ .Site.Title }}" />