personal-website/README.md

72 lines
3.1 KiB
Markdown
Raw Normal View History

2024-05-07 21:55:37 +02:00
# My personal website
2024-04-27 22:22:13 +02:00
The goal of this website is to serve as my personal dumping grounds for some
small web projects, a blog, maybe a booru gallery. Idk yet.
## Deploy guide
If you want to use my website as some sort of a template for your own,
feel free to do so!
I would appreciate if you give me some form of a credit in the footer of your
page, especially if you are going to just re-skin my page for
your own blog site, but I do not require it.
Anyways, let's get to the *how*.
- My page is written in PHP, I run it on an apache server, but it probably
should run on nginx as well, I am not sure though, as I have never tested it.
- I am not going to walk you through LAMP setup,
as that can be found elsewhere.
- In the root of the project you will find a database.sql file, you should be
able to use it to deploy my database schema. I use mariadb,
but if you use mysql it should work as well.
- The database is documented through comments viewable in phpmyadmin,
if you have trouble displaying them in your database manager, let me know
and I might get to writing some basic setup instructions here.
2024-05-07 18:05:21 +02:00
- Please create the file `docs/common/config.php` which will store database
2024-07-21 00:39:09 +02:00
credentials that will then be used in `docs/common/header.php`
2024-05-07 18:05:21 +02:00
to connect to the db and set the global variable `$conn` to the PDO
2024-04-27 22:22:13 +02:00
connection object, you can use that in your own functions, if you add any.
2024-05-07 18:05:21 +02:00
- The file should define the following constants:
- SQL_HOSTNAME
- SQL_USERNAME
- SQL_PASSWORD
- SQL_DATABASE
- Changes to php.ini should include:
- Enabling the pdo_mysql extension
- Setting the file_uploads on and setting max upload (and post) size,
if you are going to make use of that function. Please note that it is
meant for admin use only and normal users shouldn't have access to it
as it is unprotected.
2024-07-21 00:39:09 +02:00
- Also make sure that the directory /assets/uploads/ exists and php has write
permissions there - if you are going to use that file upload
functionality, that is.
2024-07-21 00:39:09 +02:00
- Php should also have write permissions in the docs/www/blog directory,
so it can update the atom feed.
2024-04-27 22:22:13 +02:00
- If you have problems connecting to the database, you can try
printing the PDO exception being caught there in the function
`attempt_sql_connect()`, but be careful not to leave it in production, as
it reveals some information you might want to keep from users.
- The basic skeleton for any document should be:
```php
<?php
2024-05-10 17:20:25 +02:00
$COMMONS = $_SERVER['DOCUMENT_ROOT'] . "/../common";
include_once($COMMONS."/header.php");
// Display the header with desired title.
display_header(<PAGETITLE>);
2024-04-27 22:22:13 +02:00
?>
<!--
Your main content here, try to wrap it in <article> tags for nice padding
-->
2024-05-10 17:20:25 +02:00
<?php
2024-07-22 23:19:48 +02:00
include_once($COMMONS."/footer.php");
2024-05-10 17:20:25 +02:00
?>
2024-04-27 22:22:13 +02:00
```
- Do check out the already existing css rules before adding your own, the rule
for what you are trying to create might already exist. I might add a more
comprehensive guide/documentation for the styles once I find myself getting
lost in them, but I don't find it necessary yet so I will not bother.
If you do, feel free to send me a pull request.
- Hmm, what else may I be missing? Not sure now, if you miss something lmk.
So I guess have fun!