add userpages to the home page

This commit is contained in:
leah 2021-08-18 11:55:01 +01:00
parent f2e198afa5
commit b26f639726
2 changed files with 16 additions and 0 deletions

View File

@ -25,6 +25,7 @@
</div>
<main>
<div id="userpages" class="userpages-list">
<ul>
<?php
$usercount = 0;
foreach (glob("/home/*/public_html", GLOB_ONLYDIR) as $user):
@ -49,6 +50,7 @@
$usercount++; ?>
<li><a href="/~<?=$user?>/" class="userpage-item">~<?=$user?></a></li>
<?php endforeach; ?>
</ul>
</div>
</main>
</body>

View File

@ -34,4 +34,18 @@
</li>
</ul>
</div>
<div>
<h2>userpages</h2>
<script src="https://unpkg.com/htmx.org@1.5.0"></script>
<div
hx-get="/users.php"
hx-trigger="load"
hx-select="#userpages"
hx-swap="outerHTML"
/>
<noscript>looks like you're blocking javascript,
<a href="/users.php">click here</a>
to see all the userpages.</noscript>
</div>
{% endblock content %}