web: quick-start install cmd -> /download/install.sh + fix docs crumb title

- index.md (快速开始) one-line install now uses
  https://pmm.parlz.com/download/install.sh (matches the download folder).
- docs/index.php: read the crumb title from the raw markdown's first '# ' line
  (was reading the rendered body, which had already converted '#' to <h1>, so it
  fell back to the slug e.g. 'index').
这个提交包含在:
JGZYES
2026-09-05 13:03:06 +08:00
父节点 c821a4e14c
当前提交 451cd9319e
修改 2 个文件,包含 4 行新增4 行删除
+3 -3
查看文件
@@ -63,15 +63,15 @@ function render_tree(string $dir, string $rel): string {
} }
$body = ''; $body = '';
$title = $page;
$f = $mdDir . '/' . $page . '.md'; $f = $mdDir . '/' . $page . '.md';
if (is_file($f)) { if (is_file($f)) {
$raw = (string)file_get_contents($f); $raw = (string)file_get_contents($f);
$raw = str_replace("\r", "", $raw); $raw = str_replace("\r", "", $raw);
/* title = first '# ' line of the raw markdown (not the rendered body) */
if (preg_match('/^#\s+(.+)$/m', $raw, $m)) $title = trim($m[1]);
$body = md($raw); $body = md($raw);
} }
// crumb title = file's first heading or slug
$title = $page;
if ($body !== '' && preg_match('/^#\s+(.+)$/m', str_replace('<', '', $body), $m)) $title = trim(strip_tags($m[1]));
if (isset($_GET['ajax'])) { /* partial response for AJAX nav (no layout) */ if (isset($_GET['ajax'])) { /* partial response for AJAX nav (no layout) */
echo '<div class="docs-crumb">文档 / ' . htmlspecialchars($title) . '</div>'; echo '<div class="docs-crumb">文档 / ' . htmlspecialchars($title) . '</div>';
+1 -1
查看文件
@@ -7,7 +7,7 @@
## 一分钟装好 ## 一分钟装好
```bash ```bash
curl -sSL https://pmm.parlz.com/install.sh | bash curl -sSL https://pmm.parlz.com/download/install.sh | bash
``` ```
装好后: 装好后: