mirror of
https://github.com/danpros/htmly.git
synced 2026-04-22 05:26:22 +05:30
Add welcome message
Add welcome message if no published post instead 404 error.
This commit is contained in:
parent
a2e96a7b51
commit
13a0696eda
2 changed files with 14 additions and 1 deletions
|
|
@ -26,7 +26,8 @@ get('/index', function () {
|
|||
|
||||
if(empty($posts) || $page < 1){
|
||||
// a non-existing page
|
||||
not_found();
|
||||
welcome_page();
|
||||
die;
|
||||
}
|
||||
|
||||
$tl = config('blog.tagline');
|
||||
|
|
|
|||
|
|
@ -1076,4 +1076,16 @@ function generate_opml(){
|
|||
// Turn an array of posts into a JSON
|
||||
function generate_json($posts){
|
||||
return json_encode($posts);
|
||||
}
|
||||
|
||||
function welcome_page() {
|
||||
echo <<<EOF
|
||||
<div style="font-size:20px;text-align:center;padding:50px 20px;">
|
||||
<h1>Welcome to your new HTMLy-powered blog.</h1>
|
||||
<p>The next thing you will need to do is creating the first account. Please create <strong><em>YourUsername.ini</em></strong> inside <strong><em>admin/users</em></strong> folder and write down your password there:</p>
|
||||
<pre><code>password = YourPassword</code></pre>
|
||||
<p>Login to your blog admin panel at <strong><em>www.example.com/admin</em></strong> to creating your first post.</p>
|
||||
<p>This welcome message will disappear after your first post published.</p>
|
||||
</div>
|
||||
EOF;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue