Added footer page
This commit is contained in:
parent
8df7870753
commit
9e03804a64
@ -19,7 +19,7 @@ class DefaultController extends AbstractController
|
||||
'header' => $return['header'],
|
||||
'content' => $return['content'],
|
||||
'title' => $return['title'],
|
||||
'nineties' => (isset($_COOKIE['nineties']))
|
||||
'footer' => $return['footer'],
|
||||
], $response);
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ class DefaultController extends AbstractController
|
||||
'header' => $return['header'],
|
||||
'content' => $return['content'],
|
||||
'title' => $return['title'],
|
||||
'nineties' => (isset($_COOKIE['nineties']))
|
||||
'footer' => $return['footer'],
|
||||
], $response);
|
||||
}
|
||||
}
|
||||
|
@ -27,6 +27,14 @@ class Page
|
||||
throw new NotFoundHttpException('Some required files were not found');
|
||||
}
|
||||
|
||||
if(file_exists($kernel->getCacheDir() . '/pages/_footer.md')) {
|
||||
$return['footer'] = $parsedown->text(file_get_contents($kernel->getCacheDir() . '/pages/_footer.md'));
|
||||
} elseif(file_exists($kernel->getCacheDir() . '/pages/_footer.html')) {
|
||||
$return['footer'] = file_get_contents($kernel->getCacheDir() . '/pages/_footer.html');
|
||||
} else {
|
||||
throw new NotFoundHttpException('Some required files were not found');
|
||||
}
|
||||
|
||||
if(file_exists($kernel->getCacheDir() . '/pages/' . $page . '.md')) {
|
||||
$return['content'] = $parsedown->text(file_get_contents($kernel->getCacheDir() . '/pages/' . $page . '.md'));
|
||||
} elseif(file_exists($kernel->getCacheDir() . '/pages/' . $page . '.html')) {
|
||||
@ -35,6 +43,8 @@ class Page
|
||||
throw new NotFoundHttpException('Some required files were not found');
|
||||
}
|
||||
|
||||
|
||||
|
||||
$titles = json_decode(file_get_contents($kernel->getCacheDir() . '/pages/titles.json'), true);
|
||||
$return['title'] = $titles[$page] ?? '';
|
||||
$return['status'] = '200';
|
||||
|
@ -15,9 +15,7 @@
|
||||
{% block content %}{% endblock %}
|
||||
{% block extrahtml %}{% endblock %}
|
||||
<footer class="footer">
|
||||
<div class="container">
|
||||
<span class="text-muted">Design inspired by Dall-E 2</span>
|
||||
</div>
|
||||
{% block footer %}{% endblock %}
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -25,3 +25,8 @@
|
||||
{% block scripts %}
|
||||
{{ encore_entry_script_tags('page') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block footer %}
|
||||
{{ footer | raw }}
|
||||
{% endblock %}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user