Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ backend/supabase/.temp/
/supabase/

# release notes pages, generated before each deploy (scripts/gen-releases.py)
/site/releases/
/site/changelog/

# wrangler (Cloudflare Pages deploy) cache
.wrangler/
Expand Down
37 changes: 19 additions & 18 deletions scripts/gen-releases.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env python3
"""Release notes pages for the site, built from the GitHub releases.
"""The site's changelog pages, built from the GitHub releases.

Writes into site/releases/ (generated, not committed):
Writes into site/changelog/ (generated, not committed; site/_redirects sends the old
/releases/ URLs here):
index.html the digest: every release, newest first, grouped by month
v<X.Y.Z>/index.html one page per release, with its downloads
feed.xml Atom feed of recent releases
Expand Down Expand Up @@ -32,7 +33,7 @@
SITE = "https://screenforge.studio"
ROOT = Path(__file__).resolve().parent.parent
SITE_DIR = ROOT / "site"
OUT = SITE_DIR / "releases"
OUT = SITE_DIR / "changelog"
# commit subjects that are not changes to the app
SKIP = re.compile(r"^(Release \d|Merge |Cargo\.lock|Site:|Site |CI\b|ci:|Update screencast\b|README)", re.I)
# how many changes the digest shows per release before "and n more"
Expand Down Expand Up @@ -156,16 +157,16 @@ def downloads(r):

def release_page(t, r, newer, older):
v, d, items = version(r), date(r), changes(r["body"])
url = f"{SITE}/releases/v{v}/"
title = f"ScreenForge {v} release notes"
url = f"{SITE}/changelog/v{v}/"
title = f"ScreenForge {v} changelog"
lis = "\n".join(f" <li>{inline(i)}</li>" for i in items) or " <li>Maintenance release: fixes and internal changes.</li>"
dl = downloads(r)
ld = {"@context": "https://schema.org", "@type": "SoftwareApplication", "name": "ScreenForge", "softwareVersion": v, "datePublished": d.strftime("%Y-%m-%d"), "operatingSystem": "macOS, Windows, Linux", "applicationCategory": "MultimediaApplication", "url": url, "releaseNotes": url, "downloadUrl": r["html_url"]}
pager = '<nav class="pager" aria-label="Other releases">'
pager += f'<a href="../v{version(older)}/">← {version(older)}</a>' if older else "<span></span>"
pager += f'<a href="../v{version(newer)}/">{version(newer)} →</a>' if newer else "<span></span>"
pager += "</nav>"
body = f""" <div class="eyebrow"><a href="../">Release notes</a></div>
body = f""" <div class="eyebrow"><a href="../">Changelog</a></div>
<h1>ScreenForge {v}</h1>
<p class="stamp">Released <time datetime="{d.strftime('%Y-%m-%d')}">{long_date(d)}</time></p>

Expand All @@ -178,12 +179,12 @@ def release_page(t, r, newer, older):
{'<div class="dl">' + ''.join(dl) + '</div>' if dl else ''}
<p>Or get the newest version from the <a href="../../download.html">download page</a>. Every file and the full changelog are on <a href="{html.escape(r['html_url'])}">GitHub</a>.</p>
{pager}"""
extra = f'<script type="application/ld+json">{json.dumps(ld)}</script>\n<link rel="alternate" type="application/atom+xml" title="ScreenForge releases" href="{SITE}/releases/feed.xml">\n'
extra = f'<script type="application/ld+json">{json.dumps(ld)}</script>\n<link rel="alternate" type="application/atom+xml" title="ScreenForge changelog" href="{SITE}/changelog/feed.xml">\n'
return t.page(2, url, title, f"ScreenForge {v} ({long_date(d)}): " + summary(items, 120), body, extra)


def digest_page(t, releases):
url = f"{SITE}/releases/"
url = f"{SITE}/changelog/"
latest = releases[0]
months, order = {}, []
for r in releases:
Expand All @@ -207,13 +208,13 @@ def digest_page(t, releases):
{shown}
</ul>{more}
</article>""")
body = f""" <div class="eyebrow">Release notes</div>
body = f""" <div class="eyebrow">Changelog</div>
<h1>What’s new in ScreenForge</h1>
<p class="lede">Every update to ScreenForge, newest first. Open a version to see everything in it and download it. The app tells you when a new one is out, or you can <a href="feed.xml">follow updates with RSS</a>.</p>
{chr(10).join(parts)}"""
extra = f'<link rel="alternate" type="application/atom+xml" title="ScreenForge releases" href="{SITE}/releases/feed.xml">\n'
extra = f'<link rel="alternate" type="application/atom+xml" title="ScreenForge changelog" href="{SITE}/changelog/feed.xml">\n'
desc = f"What changed in each ScreenForge version, newest first. Latest: {version(latest)} ({long_date(date(latest))}): " + summary(changes(latest["body"]), 90)
return t.page(1, url, "ScreenForge release notes", desc, body, extra)
return t.page(1, url, "ScreenForge changelog", desc, body, extra)


def feed(releases):
Expand All @@ -224,18 +225,18 @@ def feed(releases):
content = "<ul>" + "".join(f"<li>{inline(i)}</li>" for i in items) + "</ul>"
entries.append(f""" <entry>
<title>ScreenForge {v}</title>
<link href="{SITE}/releases/v{v}/"/>
<id>{SITE}/releases/v{v}/</id>
<link href="{SITE}/changelog/v{v}/"/>
<id>{SITE}/changelog/v{v}/</id>
<updated>{r['published_at']}</updated>
<summary>{e(summary(items, 200))}</summary>
<content type="html">{e(content)}</content>
</entry>""")
return f"""<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>ScreenForge releases</title>
<link href="{SITE}/releases/"/>
<link rel="self" href="{SITE}/releases/feed.xml"/>
<id>{SITE}/releases/</id>
<title>ScreenForge changelog</title>
<link href="{SITE}/changelog/"/>
<link rel="self" href="{SITE}/changelog/feed.xml"/>
<id>{SITE}/changelog/</id>
<updated>{releases[0]['published_at']}</updated>
<author><name>ScreenForge</name></author>
{chr(10).join(entries)}
Expand All @@ -244,7 +245,7 @@ def feed(releases):


def sitemap(releases):
urls = [(f"{SITE}/releases/", date(releases[0]))] + [(f"{SITE}/releases/v{version(r)}/", date(r)) for r in releases]
urls = [(f"{SITE}/changelog/", date(releases[0]))] + [(f"{SITE}/changelog/v{version(r)}/", date(r)) for r in releases]
rows = "\n".join(f" <url><loc>{u}</loc><lastmod>{d.strftime('%Y-%m-%d')}</lastmod></url>" for u, d in urls)
return f'<?xml version="1.0" encoding="UTF-8"?>\n<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">\n{rows}\n</urlset>\n'

Expand Down
2 changes: 1 addition & 1 deletion scripts/site/footer.en.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<a href="comparison.html">compare</a>
<a href="privacy.html">privacy</a>
<a href="terms.html">terms</a>
<a href="releases/">releases</a>
<a href="changelog/">changelog</a>
<a class="x" href="https://x.com/ScreenForgeHQ" rel="me noopener" aria-label="ScreenForge on X" title="@ScreenForgeHQ on X"><svg viewBox="0 0 24 24" width="13" height="13" fill="currentColor" aria-hidden="true"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg></a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion scripts/site/footer.es.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<a href="es/comparison.html">comparar</a>
<a href="privacy.html">privacidad</a>
<a href="terms.html">términos</a>
<a href="releases/">novedades</a>
<a href="changelog/">novedades</a>
<a class="x" href="https://x.com/ScreenForgeHQ" rel="me noopener" aria-label="ScreenForge en X" title="@ScreenForgeHQ en X"><svg viewBox="0 0 24 24" width="13" height="13" fill="currentColor" aria-hidden="true"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg></a>
</div>
</div>
Expand Down
46 changes: 40 additions & 6 deletions scripts/site_partials.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python3
"""The site's shared footer: one source, filled into every page.
Also the FAQPage structured data of any page with a <div class="faq">, built from its questions.

scripts/site/footer.en.html and footer.es.html hold the footer with links relative to the
site root. Every page under site/ gets the footer of its language (pages under site/es/ the
Expand All @@ -9,9 +10,15 @@
python3 scripts/site_partials.py # update the pages in place
python3 scripts/site_partials.py --check # list pages whose footer differs; exit 1 if any

A page's FAQ structured data is the <script type="application/ld+json" data-faq> before </head>,
rebuilt from the page's <div class="faq"> (each <h3> with the text after it), so edit the questions
in the page, never the script block.

Edit the footer in scripts/site/, never in a page: the site workflow runs this before every
deploy, so a page's own copy is replaced.
"""
import html as htmllib
import json
import os
import re
import sys
Expand Down Expand Up @@ -42,11 +49,38 @@ def rel(m):
return RELATIVE.sub(rel, text)


FAQ = re.compile(r'<div class="faq">(.*?)\n </div>', re.S)
QUESTION = re.compile(r"<h3>(.*?)</h3>(.*?)(?=<h3>|$)", re.S)
FAQ_LD = re.compile(r'\n?<script type="application/ld\+json" data-faq>.*?</script>', re.S)


def text(fragment: str) -> str:
return htmllib.unescape(re.sub(r"\s+", " ", re.sub(r"<[^>]+>", " ", fragment))).strip()


def faq_ld(html: str) -> str:
"""The FAQPage block for the page's FAQ, or "" when it has none."""
m = FAQ.search(html)
if not m:
return ""
entities = [
{"@type": "Question", "name": text(q), "acceptedAnswer": {"@type": "Answer", "text": text(a)}}
for q, a in QUESTION.findall(m.group(1))
]
data = {"@context": "https://schema.org", "@type": "FAQPage", "mainEntity": entities}
body = json.dumps(data, ensure_ascii=False, indent=1).replace("</", "<\\/")
return f'\n<script type="application/ld+json" data-faq>\n{body}\n</script>'


def apply(page: Path, html: str) -> str:
if not FOOTER.search(html):
return html
f = footer(page)
return FOOTER.sub(lambda _: f, html, count=1)
if FOOTER.search(html):
f = footer(page)
html = FOOTER.sub(lambda _: f, html, count=1)
ld = faq_ld(html)
html = FAQ_LD.sub("", html, count=1)
if ld:
html = html.replace("\n</head>", ld + "\n</head>", 1)
return html


def main():
Expand All @@ -61,9 +95,9 @@ def main():
page.write_text(new, encoding="utf-8")
if check:
for p in changed:
print(f"footer differs: {p}")
print(f"footer or FAQ data differs: {p}")
sys.exit(1 if changed else 0)
print(f"footer updated on {len(changed)} page(s)")
print(f"footer and FAQ data updated on {len(changed)} page(s)")


if __name__ == "__main__":
Expand Down
4 changes: 3 additions & 1 deletion site/404.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
<meta property="og:image" content="https://screenforge.studio/og.png?v=6">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="ScreenForge app icon and logo: screen recordings that look professionally edited">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@ScreenForgeHQ">
<meta name="twitter:image" content="https://screenforge.studio/og.png?v=6">
<meta name="twitter:image:alt" content="ScreenForge app icon and logo: screen recordings that look professionally edited">
<link rel="icon" href="favicon.ico?v=9" sizes="any">
<link rel="icon" type="image/svg+xml" href="favicon.svg?v=9">
<link rel="icon" type="image/png" sizes="512x512" href="icon.png?v=9">
Expand Down Expand Up @@ -451,7 +453,7 @@ <h1>Nothing on <em>this track.</em></h1>
<a href="comparison.html">compare</a>
<a href="privacy.html">privacy</a>
<a href="terms.html">terms</a>
<a href="releases/">releases</a>
<a href="changelog/">changelog</a>
<a class="x" href="https://x.com/ScreenForgeHQ" rel="me noopener" aria-label="ScreenForge on X" title="@ScreenForgeHQ on X"><svg viewBox="0 0 24 24" width="13" height="13" fill="currentColor" aria-hidden="true"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg></a>
</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions site/_redirects
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/screen-studio-alternative /comparison 301
/screen-studio-alternative.html /comparison 301
/releases /changelog/ 301
/releases/* /changelog/:splat 301
8 changes: 5 additions & 3 deletions site/comparison.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Jam vs Screen Studio vs ScreenForge — ScreenForge</title>
<title>Screen Studio Alternative: Jam vs Screen Studio vs ScreenForge</title>
<meta name="description" content="Jam, Screen Studio and ScreenForge compared on platforms, engine, editing features, voice-over, music, wallpapers, AI and price. Written by the ScreenForge author, gaps included. A Screen Studio alternative for Windows and Linux.">
<link rel="canonical" href="https://screenforge.studio/comparison">
<link rel="alternate" hreflang="en" href="https://screenforge.studio/comparison">
Expand All @@ -14,14 +14,16 @@
<meta property="og:url" content="https://screenforge.studio/comparison">
<meta property="og:locale" content="en_US">
<meta property="og:locale:alternate" content="es_ES">
<meta property="og:title" content="Jam vs Screen Studio vs ScreenForge">
<meta property="og:title" content="Screen Studio Alternative: Jam vs Screen Studio vs ScreenForge">
<meta property="og:description" content="Jam, Screen Studio and ScreenForge compared on platforms, engine, editing features, voice-over, music, wallpapers, AI and price. Written by the ScreenForge author, gaps included. A Screen Studio alternative for Windows and Linux.">
<meta property="og:image" content="https://screenforge.studio/comparison-og.png?v=1">
<meta property="og:image:width" content="1600">
<meta property="og:image:height" content="900">
<meta property="og:image:alt" content="Comparison table of Jam, Screen Studio and ScreenForge">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@ScreenForgeHQ">
<meta name="twitter:image" content="https://screenforge.studio/comparison-og.png?v=1">
<meta name="twitter:image:alt" content="Comparison table of Jam, Screen Studio and ScreenForge">
<link rel="icon" href="favicon.ico?v=9" sizes="any">
<link rel="icon" type="image/svg+xml" href="favicon.svg?v=9">
<link rel="icon" type="image/png" sizes="512x512" href="icon.png?v=9">
Expand Down Expand Up @@ -565,7 +567,7 @@ <h2>Sources</h2>
<a href="comparison.html">compare</a>
<a href="privacy.html">privacy</a>
<a href="terms.html">terms</a>
<a href="releases/">releases</a>
<a href="changelog/">changelog</a>
<a class="x" href="https://x.com/ScreenForgeHQ" rel="me noopener" aria-label="ScreenForge on X" title="@ScreenForgeHQ on X"><svg viewBox="0 0 24 24" width="13" height="13" fill="currentColor" aria-hidden="true"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg></a>
</div>
</div>
Expand Down
15 changes: 9 additions & 6 deletions site/download.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@
<meta property="og:image" content="https://screenforge.studio/og.png?v=6">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="ScreenForge app icon and logo: screen recordings that look professionally edited">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@ScreenForgeHQ">
<meta name="twitter:image" content="https://screenforge.studio/og.png?v=6">
<meta name="twitter:image:alt" content="ScreenForge app icon and logo: screen recordings that look professionally edited">
<link rel="icon" href="favicon.ico?v=9" sizes="any">
<link rel="icon" type="image/svg+xml" href="favicon.svg?v=9">
<link rel="icon" type="image/png" sizes="512x512" href="icon.png?v=9">
Expand Down Expand Up @@ -185,12 +187,12 @@
.badge .k { background: var(--panel); color: var(--dim); border-right: 1px solid var(--line-2); }
.badge .v { color: var(--jade); }
.badge.gold .v { color: var(--gold); }
h1 {
h1, h2.h1 {
font-family: var(--display); font-weight: 900;
font-size: clamp(40px, 7.4vw, 92px); line-height: .95;
letter-spacing: -.045em; color: var(--white); max-width: 15ch;
}
h1 em { font-style: normal; color: var(--jade); }
h1 em, h2.h1 em { font-style: normal; color: var(--jade); }
.tagline {
margin-top: 22px; font-family: var(--display); font-weight: 700;
font-size: clamp(18px, 2.4vw, 26px); letter-spacing: -.02em; line-height: 1.25;
Expand Down Expand Up @@ -358,9 +360,10 @@
body > main { flex: 1 0 auto; width: 100%; }
.doc { max-width: 820px; margin: 0 auto; padding: 72px 28px 96px; position: relative; }
.doc.wide { max-width: 1180px; }
.doc h1 { font-size: clamp(34px, 5.6vw, 58px); line-height: 1.02; max-width: 18ch; letter-spacing: -.04em; }
.doc h1, .doc h2.h1 { font-size: clamp(34px, 5.6vw, 58px); line-height: 1.02; max-width: 18ch; letter-spacing: -.04em; }
.stamp { font-family: var(--mono); font-size: 12.5px; color: var(--dim); margin: 16px 0 40px; }
.doc h2 { font-size: 22px; margin: 56px 0 14px; max-width: none; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.doc h2.h1 { margin: 0; font-weight: 900; }
.doc h2 .n { color: var(--jade-deep); font-family: var(--mono); font-size: 14px; font-weight: 400; margin-right: 10px; letter-spacing: 0; }
.doc h3 { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--white); margin: 26px 0 8px; letter-spacing: -.01em; line-height: 1.3; }
.doc p { margin-bottom: 15px; font-size: 15.5px; }
Expand Down Expand Up @@ -510,7 +513,7 @@ <h2>Install</h2>
</section>

<section class="plat" id="linux" data-os="linux">
<h1>Download ScreenForge for <em>Linux.</em></h1>
<h2 class="h1">Download ScreenForge for <em>Linux.</em></h2>
<p class="stamp">x86_64 · ffmpeg included · recording and editing are free</p>

<div class="reqs" aria-label="requirements">
Expand Down Expand Up @@ -546,7 +549,7 @@ <h2>Install</h2>
</section>

<section class="plat" id="windows" data-os="windows">
<h1>Download ScreenForge for <em>Windows.</em></h1>
<h2 class="h1">Download ScreenForge for <em>Windows.</em></h2>
<p class="stamp">x86_64 · Windows 10 or later · ffmpeg included · recording and editing are free</p>

<div class="reqs" aria-label="requirements">
Expand Down Expand Up @@ -588,7 +591,7 @@ <h2>Install</h2>
<a href="comparison.html">compare</a>
<a href="privacy.html">privacy</a>
<a href="terms.html">terms</a>
<a href="releases/">releases</a>
<a href="changelog/">changelog</a>
<a class="x" href="https://x.com/ScreenForgeHQ" rel="me noopener" aria-label="ScreenForge on X" title="@ScreenForgeHQ on X"><svg viewBox="0 0 24 24" width="13" height="13" fill="currentColor" aria-hidden="true"><path d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"/></svg></a>
</div>
</div>
Expand Down
Loading
Loading