Compare commits

...

3 Commits

Author SHA1 Message Date
Citlali del Rey 13bb1817ab
Merge branch 'kind_foxie-main' 2023-11-06 12:49:28 -08:00
George Fox 95606efc83 Fixed an error with `<li>` duplication. 2023-11-06 23:05:52 +03:00
George Fox 88f108c878 Added gemini support on the users page 2023-11-06 22:59:03 +03:00
2 changed files with 15 additions and 9 deletions

View File

@ -69,11 +69,14 @@ sub user_pages ($self) {
for (@sorted) { for (@sorted) {
my $uid = $_->get_value('uid'); my $uid = $_->get_value('uid');
my $dir = "/home/$uid/public/www"; my $web_dir = "/home/$uid/public/www";
my $has_page = is_dir_used($dir); my $gem_dir = "/home/$uid/public/gemini";
my $has_web_page = is_dir_used($web_dir);
my $has_gem_page = is_dir_used($gem_dir);
push @{$users}, { push @{$users}, {
username => $uid, username => $uid,
has_page => $has_page, has_web_page => $has_web_page,
has_gem_page => $has_gem_page,
}; };
} }
return $users; return $users;

View File

@ -5,12 +5,15 @@
<p>Here's a list of all UNIX.dog users and their webpages:</p> <p>Here's a list of all UNIX.dog users and their webpages:</p>
<ul> <ul>
% foreach my $user (@{$users}) { % foreach my $user (@{$users}) {
% if ($user->{has_page}) { <li>
<li><a ~<%= $user->{username} %>
href="https://unix.dog/~<%=$user->{username}%>/">~<%=$user->{username} %></a></li> % if ($user->{has_web_page}) {
% } else { <a href="https://unix.dog/~<%=$user->{username}%>/">web</a>
<li>~<%= $user->{username} %></li> % }
% } % if ($user->{has_gem_page}) {
<a href="gemini://unix.dog/~<%=$user->{username}%>/">gemini</a>
%}
</li>
% } % }
</ul> </ul>
</article> </article>