SFML / SFML-Website

Repository for the SFML website.
Other
22 stars 35 forks source link
css hacktoberfest html php sfml website

SFML Website

This repository contains the source code of the SFML website.

The main goal here is to provide a place to easily report or even fix issues with the website. For longer discussions however one should still use the dedicated sub-forum on the SFML forum.

Development

The website is mostly HTML with a bit of PHP sprinkled on top, and styled using LESS.

To view the website in your browser for development, you can essentially pick any web server, that can call PHP.

Pre-Requisite

Windows

It's highly recommended to use WSL2, as setting up Apache or Nginx is a lot more straight forward on a Linux subsystem.
If you don't want to do this, there are common packages such as XAMPP, WampServer, or AMPPS.

After WSL2 has been installed and you opened an Linux shell in the Windows Terminal, follow the Linux steps below.

macOS

Ensure brew is installed.

brew install php

brew install nginx
# OR
brew install httpd

Additional References:

Linux

On Linux, we'll provide commands for Debian/Ubuntu-like package managers. If you use a different distro, you'll have to look up the equivalent commands.

sudo apt install php8.1-fpm

sudo apt install nginx
# OR
sudo apt install apache2

In case php8.1-fpm doesn't exist, add the PPA:

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update

Configurations

General Notes:

Nginx

server {
        listen 80;
        listen [::]:80;

        server_name sfml.localhost;
        root /path/to/the/cloned/SFML-website/repository;

        index index.php index.html;

        location / {
                try_files $uri $uri/ /index.php$is_args$args;
        }

        location ~* \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;

                # Uncomment for Linux
                #fastcgi_pass unix:/run/php/php8.1-fpm.sock;

                # Uncomment for macOS
                #fastcgi_pass 127.0.0.1:9000;

                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }
}

Apache

<VirtualHost *:80>
        ServerName sfml.localhost

        DocumentRoot /path/to/the/cloned/SFML-website/repository
        DirectoryIndex index.php index.html
</VirtualHost>

License

See the LICENSE file.