Added gemini support on the users page
This commit is contained in:
parent
00f46f3085
commit
88f108c878
|
@ -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;
|
||||||
|
|
|
@ -5,8 +5,18 @@
|
||||||
<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}) {
|
||||||
|
<li>
|
||||||
|
~<%= $user->{username} %>
|
||||||
|
% if ($user->{has_web_page}) {
|
||||||
|
<a href="https://unix.dog/~<%=$user->{username}%>/">web</a>
|
||||||
|
% }
|
||||||
|
% if ($user->{has_gem_page}) {
|
||||||
|
<a href="gemini://unix.dog/~<%=$user->{username}%>/">gemini</a>
|
||||||
|
%}
|
||||||
|
</li>
|
||||||
% if ($user->{has_page}) {
|
% if ($user->{has_page}) {
|
||||||
<li><a
|
<li>
|
||||||
|
<a
|
||||||
href="https://unix.dog/~<%=$user->{username}%>/">~<%=$user->{username} %></a></li>
|
href="https://unix.dog/~<%=$user->{username}%>/">~<%=$user->{username} %></a></li>
|
||||||
% } else {
|
% } else {
|
||||||
<li>~<%= $user->{username} %></li>
|
<li>~<%= $user->{username} %></li>
|
||||||
|
|
Loading…
Reference in New Issue