Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit b0a3837

Browse files
committedJan 28, 2024
[FEATURE] Display Contact Info from guides.xml in Footer
resolves #316
1 parent b1f9a8e commit b0a3837

File tree

32 files changed

+90
-162
lines changed

32 files changed

+90
-162
lines changed
 

‎Documentation/guides.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
edit-on-github="TYPO3-Documentation/render-guides"
1414
edit-on-github-branch="main"
1515
interlink-shortcode="t3docsRenderGuides"
16+
project-contact="https://typo3.slack.com/archives/C0638JMJVLY"
17+
project-home="https://github.com/TYPO3-Documentation/render-guides"
18+
project-issues="https://github.com/TYPO3-Documentation/render-guides/issues"
19+
project-repository="https://github.com/TYPO3-Documentation/render-guides"
1620
typo3-core-preferred="stable"
1721
/>
1822
<!-- explicitly link to stable versions of extensions -->

‎packages/typo3-docs-theme/resources/config/typo3-docs-theme.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
declare(strict_types=1);
44

55
use Brotkrueml\TwigCodeHighlight\Extension as CodeHighlight;
6+
use phpDocumentor\Guides\Event\PostProjectNodeCreated;
67
use phpDocumentor\Guides\Event\PostRenderProcess;
78
use phpDocumentor\Guides\Event\PreParseProcess;
89
use phpDocumentor\Guides\Graphs\Renderer\PlantumlServerRenderer;
@@ -13,6 +14,7 @@
1314
use phpDocumentor\Guides\RestructuredText\Parser\Productions\DirectiveContentRule;
1415
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
1516

17+
use T3Docs\Typo3DocsTheme\EventListeners\AddThemeSettingsToProjectNode;
1618
use T3Docs\Typo3DocsTheme\EventListeners\CopyResources;
1719
use T3Docs\Typo3DocsTheme\Directives\GroupTabDirective;
1820

@@ -70,6 +72,9 @@
7072
->tag('twig.extension')
7173
->autowire()
7274

75+
->set(AddThemeSettingsToProjectNode::class)
76+
->tag('event_listener', ['event' => PostProjectNodeCreated::class])
77+
7378
->set(CopyResources::class)
7479
->tag('event_listener', ['event' => PostRenderProcess::class])
7580

‎packages/typo3-docs-theme/resources/template/structure/layoutParts/footer.html.twig

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,22 @@
33
<div class="frame frame-ruler-before frame-background-dark">
44
<div class="frame-container">
55
<div class="frame-inner">
6-
<ul class="footer-simplemenu">
7-
<li><a href="https://typo3.org/community/teams/documentation/#c9886" title="Contact"><span>Contact</span></a></li>
8-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage/issues" rel="nofollow noopener" title="Issues"><span>Issues</span></a></li>
9-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage" rel="nofollow noopener" title="Repository"><span>Repository</span></a></li>
10-
</ul>
6+
{% if env.projectNode.variables.project_home or env.projectNode.variables.project_contact or env.projectNode.variables.project_issues or env.projectNode.variables.project_repository -%}
7+
<ul class="footer-simplemenu">
8+
{% if env.projectNode.variables.project_home -%}
9+
<li><a href="{{ renderNode(env.projectNode.variables.project_home) }}" title="Home" rel="nofollow noopener"><span>Home</span></a></li>
10+
{% endif %}
11+
{% if env.projectNode.variables.project_contact -%}
12+
<li><a href="{{ renderNode(env.projectNode.variables.project_contact) }}" title="Contact" rel="nofollow noopener"><span>Contact</span></a></li>
13+
{% endif %}
14+
{% if env.projectNode.variables.project_issues -%}
15+
<li><a href="{{ renderNode(env.projectNode.variables.project_issues) }}" rel="nofollow noopener" title="Issues"><span>Issues</span></a></li>
16+
{% endif %}
17+
{% if env.projectNode.variables.project_repository -%}
18+
<li><a href="{{ renderNode(env.projectNode.variables.project_repository) }}" rel="nofollow noopener" title="Repository"><span>Repository</span></a></li>
19+
{% endif %}
20+
</ul>
21+
{%- endif %}
1122
<div class="footer-additional">
1223
<p class="text-center">Last rendered: {{ env.projectNode.lastRendered|date("M d, Y H:i") }}</p>
1324
</div>

‎packages/typo3-docs-theme/src/DependencyInjection/Typo3DocsThemeExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ public function load(array $configs, ContainerBuilder $container): void
5454
'how_to_edit' => $configs[1]['how_to_edit'] ?? 'https://docs.typo3.org/m/typo3/docs-how-to-document/main/en-us/WritingDocsOfficial/GithubMethod.html',
5555
'interlink_shortcode' => $configs[1]['interlink_shortcode'] ?? '',
5656
'copy_sources' => $configs[1]['copy_sources'] ?? 'true',
57+
'project_home' => $configs[1]['project_home'] ?? '',
58+
'project_contact' => $configs[1]['project_contact'] ?? '',
59+
'project_repository' => $configs[1]['project_repository'] ?? '',
60+
'project_issues' => $configs[1]['project_issues'] ?? '',
5761
],
5862
],
5963
);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace T3Docs\Typo3DocsTheme\EventListeners;
6+
7+
use phpDocumentor\Guides\Event\PostProjectNodeCreated;
8+
use phpDocumentor\Guides\Nodes\Inline\PlainTextInlineNode;
9+
use T3Docs\Typo3DocsTheme\Settings\Typo3DocsThemeSettings;
10+
11+
final class AddThemeSettingsToProjectNode
12+
{
13+
public function __construct(
14+
private readonly Typo3DocsThemeSettings $themeSettings,
15+
) {}
16+
17+
public function __invoke(PostProjectNodeCreated $event): void
18+
{
19+
$projectNode = $event->getProjectNode();
20+
foreach ($this->themeSettings->getAllSettings() as $key => $setting) {
21+
if (trim($setting) !== '') {
22+
$projectNode->addVariable($key, new PlainTextInlineNode($setting));
23+
}
24+
}
25+
}
26+
}

‎packages/typo3-docs-theme/src/Settings/Typo3DocsThemeSettings.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace T3Docs\Typo3DocsTheme\Settings;
44

5-
class Typo3DocsThemeSettings
5+
final class Typo3DocsThemeSettings
66
{
77
/**
88
* @param array<string, string> $settings
@@ -23,4 +23,12 @@ public function getSettings(string $key, string $default = ''): string
2323
}
2424
return $this->settings[$key];
2525
}
26+
27+
/**
28+
* @return array<string, string>
29+
*/
30+
public function getAllSettings(): array
31+
{
32+
return $this->settings;
33+
}
2634
}

‎tests/Integration/tests-full/edit-on-github/expected/index.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,7 @@ <h5 class="modal-title" id="linkReferenceModalLabel">Reference to the headline</
188188
<div class="frame frame-ruler-before frame-background-dark">
189189
<div class="frame-container">
190190
<div class="frame-inner">
191-
<ul class="footer-simplemenu">
192-
<li><a href="https://typo3.org/community/teams/documentation/#c9886" title="Contact"><span>Contact</span></a></li>
193-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage/issues" rel="nofollow noopener" title="Issues"><span>Issues</span></a></li>
194-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage" rel="nofollow noopener" title="Repository"><span>Repository</span></a></li>
195-
</ul>
196-
<div class="footer-additional">
191+
<div class="footer-additional">
197192
<p class="text-center">Last rendered: Jan 01, 2023 12:00</p>
198193
</div>
199194
<div class="footer-meta">

‎tests/Integration/tests-full/edit-on-github/expected/page1.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,7 @@ <h5 class="modal-title" id="linkReferenceModalLabel">Reference to the headline</
187187
<div class="frame frame-ruler-before frame-background-dark">
188188
<div class="frame-container">
189189
<div class="frame-inner">
190-
<ul class="footer-simplemenu">
191-
<li><a href="https://typo3.org/community/teams/documentation/#c9886" title="Contact"><span>Contact</span></a></li>
192-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage/issues" rel="nofollow noopener" title="Issues"><span>Issues</span></a></li>
193-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage" rel="nofollow noopener" title="Repository"><span>Repository</span></a></li>
194-
</ul>
195-
<div class="footer-additional">
190+
<div class="footer-additional">
196191
<p class="text-center">Last rendered: Jan 01, 2023 12:00</p>
197192
</div>
198193
<div class="footer-meta">

‎tests/Integration/tests-full/edit-on-github/expected/subpages/index.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,7 @@ <h5 class="modal-title" id="linkReferenceModalLabel">Reference to the headline</
187187
<div class="frame frame-ruler-before frame-background-dark">
188188
<div class="frame-container">
189189
<div class="frame-inner">
190-
<ul class="footer-simplemenu">
191-
<li><a href="https://typo3.org/community/teams/documentation/#c9886" title="Contact"><span>Contact</span></a></li>
192-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage/issues" rel="nofollow noopener" title="Issues"><span>Issues</span></a></li>
193-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage" rel="nofollow noopener" title="Repository"><span>Repository</span></a></li>
194-
</ul>
195-
<div class="footer-additional">
190+
<div class="footer-additional">
196191
<p class="text-center">Last rendered: Jan 01, 2023 12:00</p>
197192
</div>
198193
<div class="footer-meta">

‎tests/Integration/tests-full/index/expected/index.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,7 @@ <h5 class="modal-title" id="linkReferenceModalLabel">Reference to the headline</
166166
<div class="frame frame-ruler-before frame-background-dark">
167167
<div class="frame-container">
168168
<div class="frame-inner">
169-
<ul class="footer-simplemenu">
170-
<li><a href="https://typo3.org/community/teams/documentation/#c9886" title="Contact"><span>Contact</span></a></li>
171-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage/issues" rel="nofollow noopener" title="Issues"><span>Issues</span></a></li>
172-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage" rel="nofollow noopener" title="Repository"><span>Repository</span></a></li>
173-
</ul>
174-
<div class="footer-additional">
169+
<div class="footer-additional">
175170
<p class="text-center">Last rendered: Jan 01, 2023 12:00</p>
176171
</div>
177172
<div class="footer-meta">

‎tests/Integration/tests-full/link-wizard/expected/index.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,7 @@ <h5 class="modal-title" id="linkReferenceModalLabel">Reference to the headline</
165165
<div class="frame frame-ruler-before frame-background-dark">
166166
<div class="frame-container">
167167
<div class="frame-inner">
168-
<ul class="footer-simplemenu">
169-
<li><a href="https://typo3.org/community/teams/documentation/#c9886" title="Contact"><span>Contact</span></a></li>
170-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage/issues" rel="nofollow noopener" title="Issues"><span>Issues</span></a></li>
171-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage" rel="nofollow noopener" title="Repository"><span>Repository</span></a></li>
172-
</ul>
173-
<div class="footer-additional">
168+
<div class="footer-additional">
174169
<p class="text-center">Last rendered: Jan 01, 2023 12:00</p>
175170
</div>
176171
<div class="footer-meta">

‎tests/Integration/tests-full/menu-subpages-max-1/expected/index.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,7 @@ <h5 class="modal-title" id="linkReferenceModalLabel">Reference to the headline</
187187
<div class="frame frame-ruler-before frame-background-dark">
188188
<div class="frame-container">
189189
<div class="frame-inner">
190-
<ul class="footer-simplemenu">
191-
<li><a href="https://typo3.org/community/teams/documentation/#c9886" title="Contact"><span>Contact</span></a></li>
192-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage/issues" rel="nofollow noopener" title="Issues"><span>Issues</span></a></li>
193-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage" rel="nofollow noopener" title="Repository"><span>Repository</span></a></li>
194-
</ul>
195-
<div class="footer-additional">
190+
<div class="footer-additional">
196191
<p class="text-center">Last rendered: Jan 01, 2023 12:00</p>
197192
</div>
198193
<div class="footer-meta">

‎tests/Integration/tests-full/menu-subpages-no-titlesonly-maxdepth-1/expected/index.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,7 @@ <h5 class="modal-title" id="linkReferenceModalLabel">Reference to the headline</
199199
<div class="frame frame-ruler-before frame-background-dark">
200200
<div class="frame-container">
201201
<div class="frame-inner">
202-
<ul class="footer-simplemenu">
203-
<li><a href="https://typo3.org/community/teams/documentation/#c9886" title="Contact"><span>Contact</span></a></li>
204-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage/issues" rel="nofollow noopener" title="Issues"><span>Issues</span></a></li>
205-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage" rel="nofollow noopener" title="Repository"><span>Repository</span></a></li>
206-
</ul>
207-
<div class="footer-additional">
202+
<div class="footer-additional">
208203
<p class="text-center">Last rendered: Jan 01, 2023 12:00</p>
209204
</div>
210205
<div class="footer-meta">

‎tests/Integration/tests-full/menu-subpages-no-titlesonly-maxdepth-2/expected/index.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,12 +207,7 @@ <h5 class="modal-title" id="linkReferenceModalLabel">Reference to the headline</
207207
<div class="frame frame-ruler-before frame-background-dark">
208208
<div class="frame-container">
209209
<div class="frame-inner">
210-
<ul class="footer-simplemenu">
211-
<li><a href="https://typo3.org/community/teams/documentation/#c9886" title="Contact"><span>Contact</span></a></li>
212-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage/issues" rel="nofollow noopener" title="Issues"><span>Issues</span></a></li>
213-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage" rel="nofollow noopener" title="Repository"><span>Repository</span></a></li>
214-
</ul>
215-
<div class="footer-additional">
210+
<div class="footer-additional">
216211
<p class="text-center">Last rendered: Jan 01, 2023 12:00</p>
217212
</div>
218213
<div class="footer-meta">

‎tests/Integration/tests-full/menu-subpages/expected/index.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -199,12 +199,7 @@ <h5 class="modal-title" id="linkReferenceModalLabel">Reference to the headline</
199199
<div class="frame frame-ruler-before frame-background-dark">
200200
<div class="frame-container">
201201
<div class="frame-inner">
202-
<ul class="footer-simplemenu">
203-
<li><a href="https://typo3.org/community/teams/documentation/#c9886" title="Contact"><span>Contact</span></a></li>
204-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage/issues" rel="nofollow noopener" title="Issues"><span>Issues</span></a></li>
205-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage" rel="nofollow noopener" title="Repository"><span>Repository</span></a></li>
206-
</ul>
207-
<div class="footer-additional">
202+
<div class="footer-additional">
208203
<p class="text-center">Last rendered: Jan 01, 2023 12:00</p>
209204
</div>
210205
<div class="footer-meta">

‎tests/Integration/tests-full/meta-data/expected/index.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,7 @@ <h5 class="modal-title" id="linkReferenceModalLabel">Reference to the headline</
166166
<div class="frame frame-ruler-before frame-background-dark">
167167
<div class="frame-container">
168168
<div class="frame-inner">
169-
<ul class="footer-simplemenu">
170-
<li><a href="https://typo3.org/community/teams/documentation/#c9886" title="Contact"><span>Contact</span></a></li>
171-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage/issues" rel="nofollow noopener" title="Issues"><span>Issues</span></a></li>
172-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage" rel="nofollow noopener" title="Repository"><span>Repository</span></a></li>
173-
</ul>
174-
<div class="footer-additional">
169+
<div class="footer-additional">
175170
<p class="text-center">Last rendered: Jan 01, 2023 12:00</p>
176171
</div>
177172
<div class="footer-meta">

‎tests/Integration/tests-full/next-prev-by-toctree/expected/four.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,7 @@ <h5 class="modal-title" id="linkReferenceModalLabel">Reference to the headline</
198198
<div class="frame frame-ruler-before frame-background-dark">
199199
<div class="frame-container">
200200
<div class="frame-inner">
201-
<ul class="footer-simplemenu">
202-
<li><a href="https://typo3.org/community/teams/documentation/#c9886" title="Contact"><span>Contact</span></a></li>
203-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage/issues" rel="nofollow noopener" title="Issues"><span>Issues</span></a></li>
204-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage" rel="nofollow noopener" title="Repository"><span>Repository</span></a></li>
205-
</ul>
206-
<div class="footer-additional">
201+
<div class="footer-additional">
207202
<p class="text-center">Last rendered: Jan 01, 2023 12:00</p>
208203
</div>
209204
<div class="footer-meta">

‎tests/Integration/tests-full/next-prev-by-toctree/expected/i.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,12 +198,7 @@ <h5 class="modal-title" id="linkReferenceModalLabel">Reference to the headline</
198198
<div class="frame frame-ruler-before frame-background-dark">
199199
<div class="frame-container">
200200
<div class="frame-inner">
201-
<ul class="footer-simplemenu">
202-
<li><a href="https://typo3.org/community/teams/documentation/#c9886" title="Contact"><span>Contact</span></a></li>
203-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage/issues" rel="nofollow noopener" title="Issues"><span>Issues</span></a></li>
204-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage" rel="nofollow noopener" title="Repository"><span>Repository</span></a></li>
205-
</ul>
206-
<div class="footer-additional">
201+
<div class="footer-additional">
207202
<p class="text-center">Last rendered: Jan 01, 2023 12:00</p>
208203
</div>
209204
<div class="footer-meta">

‎tests/Integration/tests-full/next-prev-by-toctree/expected/index.html

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,12 +208,7 @@ <h5 class="modal-title" id="linkReferenceModalLabel">Reference to the headline</
208208
<div class="frame frame-ruler-before frame-background-dark">
209209
<div class="frame-container">
210210
<div class="frame-inner">
211-
<ul class="footer-simplemenu">
212-
<li><a href="https://typo3.org/community/teams/documentation/#c9886" title="Contact"><span>Contact</span></a></li>
213-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage/issues" rel="nofollow noopener" title="Issues"><span>Issues</span></a></li>
214-
<li><a href="https://github.com/TYPO3-Documentation/DocsTypo3Org-Homepage" rel="nofollow noopener" title="Repository"><span>Repository</span></a></li>
215-
</ul>
216-
<div class="footer-additional">
211+
<div class="footer-additional">
217212
<p class="text-center">Last rendered: Jan 01, 2023 12:00</p>
218213
</div>
219214
<div class="footer-meta">
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Please sign in to comment.