# Knah Tsaeb personal website ## Presentation This is the source code of my personal website. Feel free to use and adapt it. ## Features - Libre - Light (software and generated site) - Fast - Half static (first print is build, other are static) - No database - Flat file - Markdown - Can include external RSS/ATOM feed or API json response - Simple - Can adapt - Easy install - Easy backup ## Installation ### Docker TODO ### Classic way - Requires `php` (8 or higher) and `php-xml` extension. - Place all the files in a directory on your server. - Run `composer install`. - Configure your web server to serve `/public/` directory. - Use cron job `*/5 * * * * php -f /var/www/ThisApp/bin/cron.php` that's check for new content or update feed all 5 mins. - That's all. ## Usage All files are store in `/datas/` folder. You are two distinct folder : - `/pages/` for page - `/posts/` for post Thanks captain obvious. You can edit directly file via SSH and a CLI editor like VIM or Nano. Alternatively, you can edit file locally and upload with FTP to your web server. Pages folder is not hierarchical just create file in `/page/My page.md`. Posts folder use chronological ordering like `/posts/YYYY/MM/DD - Post title.md`. If you want, is totaly optional, in your post you can add lead. Example : ```markdown --- My super lead text ! --- Rest of your post. ``` ## Options / configs You can create `/datas/config.json` for define your option. ```json { "siteName": "My super page", "author": "Me !!!", "useCache": true, "postPerPage": 12, "numberOfLastItem": 5, "debug": true, "fetching": {}, "navLinks": {} } ``` | Option | Type | Default | Description | | --- | --- | --- | --- | | siteName | string | My super page| Site name | | author | string | Me !!! | Your name | | useCache | bool | true | Enable or disable cache | | postPerPage | int | 12 | Number of posts in /posts page | | numberOfLastItem | int | 5 | Number of items feed | | debug | bool | false | Enable or disable some action for debugin | | fetching | array | null | List of feed or API (Key = serviceName, value = url)| | navLinks | array | null | List of nav entry (Key = linkName, value = url)| ### Notes If you change/update config, all cache are cleaning. ## Ideas Original Idea by [SebSauvage](https://sebsauvage.net/wiki/doku.php?id=minigal_nano#gerer_votre_gallerie_avec_nextcloud) in french. If you have NextCloud installed on your server, you can use it to manage your markdown file. It's very convenient for uploading your markdown file, renaming them, moving them, and organizing them into folders. In the NextCloud settings: Settings > Administration > External Storage: | Option | Description | | --- | --- | | Folder Name | The name of the folder as it will appear in NextCloud. | | External Storage | Choose Local | | Authentication | None | | Configuration | Enter the path of your `/datas` folder | Don't forget to disable encrypt for this folder. More info about external storage in [Nextcloud admin documentation](https://docs.nextcloud.com/server/stable/admin_manual/configuration_files/external_storage_configuration_gui.html). The same idea can be use with another sync tool of course. ## License and ressources This software is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE v3 (https://gnu.org/licenses/agpl-3.0.txt). Icons : - moon and sun icon svgrepo.com (CCO license) - external link icon humbleicons.com (MIT license) CSS : - [Reset CSS piccalil.li](https://piccalil.li/blog/a-more-modern-css-reset/) (CC BY license) Dependencies : - [league/commonmark](https://commonmark.thephpleague.com/) (BSD-3 license) - [guzzlehttp/guzzle](https://github.com/guzzle/guzzle) (MIT license) - [cocur/slugify](https://github.com/cocur/slugify) (MIT license)