Skip to content

Commit a9c90a9

Browse files
authored
Merge pull request #508 from phpDocumentor/bugfix/variable_version
[BUGFIX] Ensure variables version and project always contain the info…
2 parents eddf528 + 76445fc commit a9c90a9

File tree

3 files changed

+29
-0
lines changed

3 files changed

+29
-0
lines changed

packages/guides/src/Nodes/ProjectNode.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ public function getVersion(): string|null
5555

5656
public function setVersion(string $version): void
5757
{
58+
$this->addVariable('version', new PlainTextInlineNode($version));
59+
$this->addVariable('release', new PlainTextInlineNode($version));
5860
$this->version = $version;
5961
}
6062

@@ -65,6 +67,7 @@ public function getTitle(): string|null
6567

6668
public function setTitle(string $title): void
6769
{
70+
$this->addVariable('project', new PlainTextInlineNode($title));
6871
$this->title = $title;
6972
}
7073

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>Some Document - My Project</title>
5+
6+
</head>
7+
<body>
8+
<div class="section" id="some-document">
9+
<h1>Some Document</h1>
10+
11+
<p>Project My Project
12+
in version 3.14
13+
</p>
14+
</div>
15+
16+
</body>
17+
</html>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
:project:
2+
My Project
3+
:version:
4+
3.14
5+
6+
Some Document
7+
=============
8+
9+
Project |project| in version |version|

0 commit comments

Comments
 (0)