aboutsummaryrefslogtreecommitdiff
path: root/views/layouts
diff options
context:
space:
mode:
authorJoe Mou <dev@mou.fo>2026-09-21 17:55:06 -0400
committerJoe Mou <dev@mou.fo>2026-09-25 01:43:53 -0400
commit499bba129c842c00c1a28d85bc044ab609aee44e (patch)
treebb69fa242a20e3c285fb6c41092b59f207f6855d /views/layouts
parent3204ecf1c48e730f02fb83d7c09d2c778a6f6bdd (diff)
Add discussions
Discussions are served from GitHub's older server-rendered HTML, with no embeddedData JSON to read, so the scraper walks the DOM the way the pull request and wiki code does. A discussion's timeline opens with its own post and continues with its comments, each carrying its replies nested inside it, which is where the recursion in _discussionComment.eta comes from. Categories, upvotes, and the answer a Q&A discussion is marked with all come along. Only what GitHub renders up front is shown: neither the next page of discussions nor the replies it hides behind a "Show N previous replies" button are fetched, so a comment says how many replies it is missing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'views/layouts')
-rw-r--r--views/layouts/repo.eta2
1 files changed, 2 insertions, 0 deletions
diff --git a/views/layouts/repo.eta b/views/layouts/repo.eta
index b1fb65c..6381196 100644
--- a/views/layouts/repo.eta
+++ b/views/layouts/repo.eta
@@ -15,6 +15,7 @@ layout("/layouts/base.eta", {
<a href="/<%= it.repo.owner %>/<%= it.repo.name %>">Code</a>
<a href="/<%= it.repo.owner %>/<%= it.repo.name %>/issues">Issues</a>
<a href="/<%= it.repo.owner %>/<%= it.repo.name %>/pulls">Pull requests</a>
+ <a href="/<%= it.repo.owner %>/<%= it.repo.name %>/discussions">Discussions</a>
<a href="/<%= it.repo.owner %>/<%= it.repo.name %>/releases">Releases</a>
<a href="/<%= it.repo.owner %>/<%= it.repo.name %>/wiki">Wiki</a>
<% if (it.branch) { %>
@@ -27,6 +28,7 @@ layout("/layouts/base.eta", {
<option value="code" <%= it.searchType === "code" ? "selected" : "" %>>Code</option>
<option value="issues" <%= it.searchType === "issues" || it.searchType == null ? "selected" : "" %>>Issues</option>
<option value="pullrequests" <%= it.searchType === "pullrequests" ? "selected" : "" %>>Pull requests</option>
+ <option value="discussions" <%= it.searchType === "discussions" ? "selected" : "" %>>Discussions</option>
</select>
<button type="submit">Search</button>
</form>