include ../mixins/post include ../mixins/sub include ../mixins/header include ../mixins/head include ../utils - var subs = [] doctype html html +head() +subMgmt() script. function updateButton(sub) { var b = document.getElementById("button-container"); b.innerHTML = ''; const button = document.createElement("button"); if (issub(sub)) { button.innerText = "unsubscribe"; button.onclick = ()=>unsubscribe(sub); } else { button.innerText = "subscribe"; button.onclick = ()=>subscribe(sub); } b.appendChild(button); } function toggleDetails(details_id) { var detailsElement = document.getElementById(details_id); if (detailsElement) { detailsElement.open = !detailsElement.open; } } document.addEventListener('DOMContentLoaded', ()=>updateButton("#{subreddit}")); body main#content +header() div.hero div.sub-title h1 a(href=`/r/${subreddit}`) | r/#{subreddit} div#button-container if about p #{about.public_description} details summary.sorting sorting by #{query.sort + (query.t?' '+query.t:'')} div.sort-opts a(href=`/r/${subreddit}?sort=hot`) hot a(href=`/r/${subreddit}?sort=new`) new a(href=`/r/${subreddit}?sort=rising`) rising a(href=`/r/${subreddit}?sort=top`) top a(href=`/r/${subreddit}?sort=top&t=day`) top day a(href=`/r/${subreddit}?sort=top&t=week`) top week a(href=`/r/${subreddit}?sort=top&t=month`) top month a(href=`/r/${subreddit}?sort=top&t=year`) top year a(href=`/r/${subreddit}?sort=top&t=all`) top all if posts each child in posts.posts +post(child.data) if posts.after div.footer div.footer-item - var newQuery = {...query, after: posts.after} a(href=`/r/${subreddit}?${encodeQueryParams(newQuery)}`) next ⟶