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