|
||
---|---|---|
app | ||
bin | ||
cache | ||
datas | ||
public | ||
template/default | ||
.gitignore | ||
composer.json | ||
composer.lock | ||
LICENSE | ||
README.md |
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) andphp-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 :
---
My super lead text !
---
Rest of your post.
Options / configs
You can create /datas/config.json
for define your option.
{
"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 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.
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 :
- svgrepo.com (CCO license)
- humbleicons.com (MIT license)
CSS :
- Reset CSS piccalil.li (CC BY license)
Dependencies :
- league/commonmark (BSD-3 license)
- guzzlehttp/guzzle (MIT license)
- cocur/slugify (MIT license)