Files snapshot from main

./wiki/projects/one-page-per-commit.md

One Page Per Commit

Currently, it generates one page per commit per branch and tag. Like, each commit that exists on a branch has its own url of /branch/branch-name/commits/123abc, and if that same commit is on other-branch, then it will also have /branch/other-branch/commits/123abc, even though the content of the commit is the same between the two.

The only thing different on these pages is which branch is set as the "current" branch in the ref dropdown menu at the top of the page.

This will be pretty wasteful for large repositories with a lot of branches and tags.

I think it would be a better idea to only generate one HTML page for the commit.

What to change

  • Get rid of flatPatches, as it is right now
  • Should just be flatMap of commits per repo
  • Pagination data for the commits page is this new list, URL should not include the branch or tag name
  • The currentRef for the commits pages should be the commit itself. The menu in the nav should show this -- have a special case for the commits page.
  • Clicking any new links should just go to the default branch (kinda sucks, but that's also what github and codeberg do)
  • Links to files on the commits page should instead give you a dropdown menu with a list of branches/tags that have that file in them.

Some notes:

  • The commit page will not have a currentRef or currentRefType that is set to a branch or tag
  • Is this now the right time to think about having per-commit snapshots? This can be part of that.
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
b1c071 Tucker McKnight
# One Page Per Commit

Currently, it generates one page per commit per branch and tag. Like, each commit
that exists on a branch has its own url of /branch/branch-name/commits/123abc, and
if that same commit is on `other-branch`, then it will also have
/branch/other-branch/commits/123abc, even though the content of the commit is the same
between the two.

The only thing different on these pages is which branch is set as the "current" branch
in the ref dropdown menu at the top of the page.

This will be pretty wasteful for large repositories with a lot of branches and tags.

I think it would be a better idea to only generate one HTML page for the commit.

## What to change

- Get rid of flatPatches, as it is right now
- Should just be flatMap of commits per repo
- Pagination data for the commits page is this new list, URL should not include
  the branch or tag name
- The currentRef for the commits pages should be the commit itself. The menu in the
  nav should show this -- have a special case for the commits page.
- Clicking any new links should just go to the default branch (kinda sucks, but that's
  also what github and codeberg do)
- Links to files on the commits page should instead give you a dropdown menu with a
  list of branches/tags that have that file in them.

## Some notes:
- The commit page will not have a currentRef or currentRefType that is set to a
  branch or tag
- Is this now the right time to think about having per-commit snapshots? This can
  be part of that.