Big update for hyblog today: custom page management.
Custom pages can be added, updated, deleted! In /admin there is now a link to 'Manage pages' at the top.
- 'Add a page' shows a simple form with just 'Title' and 'Content' fields. Pages are saved as .md files in /pages/ – add content in markdown and HTML
- any existing pages will be listed as links to go to an 'update' page
- each page listed will have delete icon to the right
A new file, page.php, accepts a URL parameter ?p={page_name}, gets the file contents from the relevant file, and displays the page. The address in the browser history is then changed to a cleaner version using javascript - a page called 'test' will have the link http(s)://{root_url}/test/ rather than http(s)://{root_url}/page.php?p=test.
As the page addresses don't actually exist the new 404 page checks if the URI matches one of the pages and redirects to /page.php?p=test. The footer then checks /pages/ for files and display links for each in the menu tray.