Check-in [afc0986fac]
Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | submitter+sitemap added |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
afc0986fac00e3f56874dca93a2a3dd3 |
| User & Date: | mario 2021-10-20 05:57:23 |
Context
|
2021-10-20
| ||
| 05:58 | Add doc/trunk|tip/pages.md preparation check-in: 5f6f721040 user: mario tags: trunk | |
| 05:57 | submitter+sitemap added check-in: afc0986fac user: mario tags: trunk | |
| 05:56 | Support for real doc/trunk/file.txt browsing check-in: 9c6bfdeb8a user: mario tags: trunk | |
Changes
Changes to extroot/project.json.
1 2 3 4 5 6 7 8 | #!/usr/bin/php-cgi -dcgi.force_redirect=0 <?php # encoding: utf-8 # api: cgi # type: output # category: api # title: project.json # description: freshcode-style project.json w/ changelog | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #!/usr/bin/php-cgi -dcgi.force_redirect=0 <?php # encoding: utf-8 # api: cgi # type: output # category: api # title: project.json # description: freshcode-style project.json w/ changelog # version: 0.2 # state: beta # depends: php:sqlite # config: - # access: public # # Generates a project.json containing general details # as well as a `releases` changelog + download links. |
| ︙ | ︙ | |||
65 66 67 68 69 70 71 |
if (preg_match("/\d+\.\d+/", $r["tagname"]) and $r["tagname"] != $ver) {
# if ($ver != "trunk")
$releases[] = [
"version" => preg_replace("/^.+?(?=\d+\.\d+)/", "", $ver),
"state" => state($ver, $changes),
"scope" => scope($ver, $changes),
"changes" => substr($changes, 0, 1024),
| | > > > > > > > > > > > | | | | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 |
if (preg_match("/\d+\.\d+/", $r["tagname"]) and $r["tagname"] != $ver) {
# if ($ver != "trunk")
$releases[] = [
"version" => preg_replace("/^.+?(?=\d+\.\d+)/", "", $ver),
"state" => state($ver, $changes),
"scope" => scope($ver, $changes),
"changes" => substr($changes, 0, 1024),
"download" => "$_SERVER[FOSSIL_SELF]zip?uuid=" . preg_replace("/^sym-/", "", $ver),
"published" => $date,
];
$changes = "";
$ver = $r["tagname"];
$date = $r["d"];
}
$changes .= $r["comment"] . "\n";
}
return $releases;
}
# unpack extra links
function sitemap_extra() {
preg_match_all("~^\s*([\w.-]+)\s+(\w+://\S+)~m", get_config("sitemap-extra", ""), $uu);
return array_combine($uu[1], $uu[2]);
}
# user with most events = main user
function main_user() {
return db("SELECT user, COUNT(type) AS c FROM event LEFT JOIN user ON user.uid=event.uid GROUP BY user ORDER BY c DESC;")[0]["user"];
}
#-- output
header("Content-Type: application/json; x-mime=json/vnd.freshcode.club; charset=UTF-8");
print(json_encode([
"\$feed-origin" => "$_SERVER[FOSSIL_SELF]",
"\$feed-license" => "CC-BY-SA 4.0",
"name" => preg_replace("/\.\w+$/", "", basename($_SERVER["FOSSIL_REPOSITORY"])),
"title" => get_config("project-name", ""),
"summary" => substr(get_config("project-description", NULL), 0, 50),
"description" => get_config("project-description", ""),
"homepage" => get_config("project-homepage", "$_SERVER[FOSSIL_SELF]"),
"license" => get_config("project-license", ""),
"tags" => get_config("project-tags", ""),
"image" => "$_SERVER[FOSSIL_SELF]logo",
"submitter" => main_user(),
"urls" => sitemap_extra(),
"releases" => releases(),
], JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES));
|