1
0
Fork 0

Minor changes

This commit is contained in:
Airikr 2024-04-28 14:31:08 +02:00
parent fbebb6d627
commit 144431b125
11 changed files with 24 additions and 33 deletions

View file

@ -1,3 +1,3 @@
The standard set-up for all my website projects. If you have found something that could be improved, please do not hesitate to contact me.
The standard set-up for all my website projects. If you have found something that could be improved, please do not hesitate to contact me at hi [at] airikr [dot] me.
Run `composer install` to install the associated functions.

View file

@ -3,7 +3,6 @@
"erusev/parsedown": "^1.7",
"particle/validator": "^2.3",
"matthiasmullie/minify": "^1.3",
"whichbrowser/parser": "^2.1",
"pragmarx/google2fa": "^8.0",
"paragonie/halite": "^5",
"phpmailer/phpmailer": "^6.8"

View file

@ -18,8 +18,7 @@
}
$content .= '</div>';
return $content;
}
?>
?>

View file

@ -4,20 +4,12 @@
echo '<section id="">';
echo '';
echo '</section>';
require_once 'site-footer.php';
?>

View file

@ -4,7 +4,7 @@
'metadata' => [
'language' => 'en',
'locale' => 'en_GB',
'description' => ''
'description' => null
]
];

View file

@ -4,7 +4,7 @@
'metadata' => [
'language' => 'se',
'locale' => 'sv_SE',
'description' => ''
'description' => null
]
];

View file

@ -4,20 +4,16 @@
$get_error = safetag($_GET['err']);
echo '<section id="">';
echo '';
echo '<section id="errors">';
echo $get_error;
echo '</section>';
require_once 'site-footer.php';
?>

View file

@ -11,17 +11,20 @@
$_SERVER['HTTP_HOST'],
trim($_SERVER['REQUEST_URI'], '/\\')
);
$site_url_cdn = null;
$site_favicon = 'data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAF0lEQVRIx2NgGAWjYBSMglEwCkbBSAcACBAAAeaR9cIAAAAASUVORK5CYII=';
$metadata_image = null;
$minified = false;
$debugging = true;
$config_folder = 'template';
$config_root = '/'.(($_SERVER['HTTP_HOST'] == 'localhost' OR strpos($_SERVER['HTTP_HOST'], '192.168') !== false) ? 'srv/http' : 'var/www');
$config_email_noreply = 'no-reply@'.$site_domain;
$config_encoding = 'ISO-8859-1';
$config_timezone = 'Europe/Stockholm';
$config_sitelang = 'sv';
$database_host = null;
$database_name = null;

View file

@ -1,6 +1,6 @@
<?php
echo '</main>';
echo '</main>';
echo '</section>';

View file

@ -3,7 +3,7 @@
require_once 'site-settings.php';
echo '<!DOCTYPE html>';
echo '<html lang="sv">';
echo '<html lang="'.$config_sitelang.'">';
echo '<head>';
echo '<title>';
@ -16,18 +16,17 @@
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes, maximum-scale=3">';
echo (count($robots) == 0 ? null : '<meta name="robots" content="'.implode(',', $robots).'">');
echo (count($google) == 0 ? null : '<meta name="robots" content="'.implode(',', $google).'">');
echo '<meta name="description" content="">';
echo '<meta name="description" content="'.$lang['metadata']['description'].'">';
echo '<meta http-equiv="cache-control" content="cache">';
echo '<meta http-equiv="expires" content="'.(60*60*24).'">';
echo '<meta property="og:locale" content="">';
echo '<meta property="og:locale:alternative" content="">';
echo '<meta property="og:locale" content="'.$lang['metadata']['locale'].'">';
echo '<meta property="og:title" content="'.$site_title.'">';
echo '<meta property="og:site_name" content="'.$site_title.'">';
echo '<meta property="og:type" content="website">';
echo '<meta property="og:url" content="'.$site_url_current.'">';
echo '<meta property="og:description" content="">';
echo '<meta property="og:description" content="'.$lang['metadata']['description'].'">';
if(!empty($metadata_image)) {
echo '<meta property="og:image" content="'.$metadata_image.'">';
@ -37,10 +36,10 @@
echo '<meta property="og:image:type" content="image/jpeg">';
}
echo '<meta property="twitter:card" content="summary_large_image"></meta>';
echo '<meta property="twitter:card" content="summary_large_image">';
echo '<meta property="twitter:url" content="'.$site_url_current.'">';
echo '<meta property="twitter:title" content="'.$site_title.'">';
echo '<meta property="twitter:description" content="">';
echo '<meta property="twitter:description" content="'.$lang['metadata']['description'].'">';
echo (empty($metadata_image) ? null : '<meta property="twitter:image" content="'.$metadata_image.'">');
echo '<link rel="canonical" href="'.$site_url_current.'">';
@ -50,9 +49,9 @@
echo '<link type="image/x-icon" rel="icon" href="'.$site_favicon.'">';
echo (empty($site_url_cdn) ? null : '<link rel="dns-prefetch" href="'.$site_url_cdn.'" crossorigin="">');
echo '<link type="text/css" rel="stylesheet preload" as="style" href="'.url('css/desktop'.($minified == true ? '.min.css' : '.css?'.time())).'">';
echo (!file_exists('css/pages/'.str_replace('.php', '', $filename).'.css') ? null : '<link type="text/css" rel="stylesheet preload" as="style" href="'.url('css/pages'.($minified == true ? '/minified' : '').'/'.str_replace('.php', '', $filename) . ($minified == true ? '.min.css' : '.css?'.time())).'">');
echo '<link type="text/css" rel="stylesheet preload" as="style" href="'.url('css/portable'.($minified == true ? '.min.css' : '.css?'.time())).'">';
echo '<link type="text/css" rel="stylesheet preload" as="style" href="'.url((file_exists('css/desktop.min.css') ? 'css/desktop.min.css' : 'css/desktop.css?'.time())).'">';
echo (!file_exists('css/pages/'.str_replace('.php', '.css', $filename)) ? null : '<link type="text/css" rel="stylesheet preload" as="style" href="'.url((file_exists('css/pages/minified/'.str_replace('.php', '.css', $filename)) ? 'css/pages/minified/'.str_replace('.php', '.css', $filename) : 'css/pages/'.str_replace('.php', '.css', $filename).'?'.time())).'">');
echo '<link type="text/css" rel="stylesheet preload" as="style" href="'.url((file_exists('css/portable.min.css') ? 'css/portable.min.css' : 'css/portable.css?'.time())).'">';
echo '</head>';
echo '<body';

View file

@ -19,16 +19,19 @@
$robots = ['nofollow','nosnippet','noarchive','noimageindex'];
$dir_files = $config_root.'/files/'.$config_folder;
$dir_css = 'css';
$dir_functions = 'functions';
$dir_images = 'images';
$dir_js = 'js';
$dir_languages = 'languages';
if(file_exists('vendor(autoload.php')) {
if(file_exists('vendor/autoload.php')) {
require_once 'vendor/autoload.php';
$Parsedown = new Parsedown();
}
require_once 'site-functions.php';
require_once 'languages/'.(isset($_GET['lang']) ? safetag($_GET['lang']) : 'se').'.php';