Minor changes
This commit is contained in:
parent
fbebb6d627
commit
144431b125
11 changed files with 24 additions and 33 deletions
|
@ -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.
|
Run `composer install` to install the associated functions.
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
"erusev/parsedown": "^1.7",
|
"erusev/parsedown": "^1.7",
|
||||||
"particle/validator": "^2.3",
|
"particle/validator": "^2.3",
|
||||||
"matthiasmullie/minify": "^1.3",
|
"matthiasmullie/minify": "^1.3",
|
||||||
"whichbrowser/parser": "^2.1",
|
|
||||||
"pragmarx/google2fa": "^8.0",
|
"pragmarx/google2fa": "^8.0",
|
||||||
"paragonie/halite": "^5",
|
"paragonie/halite": "^5",
|
||||||
"phpmailer/phpmailer": "^6.8"
|
"phpmailer/phpmailer": "^6.8"
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
}
|
}
|
||||||
$content .= '</div>';
|
$content .= '</div>';
|
||||||
|
|
||||||
|
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,20 +4,12 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo '<section id="">';
|
echo '<section id="">';
|
||||||
echo '';
|
echo '';
|
||||||
echo '</section>';
|
echo '</section>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
require_once 'site-footer.php';
|
require_once 'site-footer.php';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
'metadata' => [
|
'metadata' => [
|
||||||
'language' => 'en',
|
'language' => 'en',
|
||||||
'locale' => 'en_GB',
|
'locale' => 'en_GB',
|
||||||
'description' => ''
|
'description' => null
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
'metadata' => [
|
'metadata' => [
|
||||||
'language' => 'se',
|
'language' => 'se',
|
||||||
'locale' => 'sv_SE',
|
'locale' => 'sv_SE',
|
||||||
'description' => ''
|
'description' => null
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -4,20 +4,16 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$get_error = safetag($_GET['err']);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
echo '<section id="errors">';
|
||||||
echo '<section id="">';
|
echo $get_error;
|
||||||
echo '';
|
|
||||||
echo '</section>';
|
echo '</section>';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
require_once 'site-footer.php';
|
require_once 'site-footer.php';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -11,17 +11,20 @@
|
||||||
$_SERVER['HTTP_HOST'],
|
$_SERVER['HTTP_HOST'],
|
||||||
trim($_SERVER['REQUEST_URI'], '/\\')
|
trim($_SERVER['REQUEST_URI'], '/\\')
|
||||||
);
|
);
|
||||||
|
$site_url_cdn = null;
|
||||||
$site_favicon = 'data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAF0lEQVRIx2NgGAWjYBSMglEwCkbBSAcACBAAAeaR9cIAAAAASUVORK5CYII=';
|
$site_favicon = 'data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAF0lEQVRIx2NgGAWjYBSMglEwCkbBSAcACBAAAeaR9cIAAAAASUVORK5CYII=';
|
||||||
|
|
||||||
$metadata_image = null;
|
$metadata_image = null;
|
||||||
|
|
||||||
$minified = false;
|
$minified = false;
|
||||||
$debugging = true;
|
$debugging = true;
|
||||||
|
|
||||||
$config_folder = 'template';
|
$config_folder = 'template';
|
||||||
$config_root = '/'.(($_SERVER['HTTP_HOST'] == 'localhost' OR strpos($_SERVER['HTTP_HOST'], '192.168') !== false) ? 'srv/http' : 'var/www');
|
$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_email_noreply = 'no-reply@'.$site_domain;
|
||||||
$config_encoding = 'ISO-8859-1';
|
$config_encoding = 'ISO-8859-1';
|
||||||
$config_timezone = 'Europe/Stockholm';
|
$config_timezone = 'Europe/Stockholm';
|
||||||
|
$config_sitelang = 'sv';
|
||||||
|
|
||||||
$database_host = null;
|
$database_host = null;
|
||||||
$database_name = null;
|
$database_name = null;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
echo '</main>';
|
echo '</main>';
|
||||||
echo '</section>';
|
echo '</section>';
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require_once 'site-settings.php';
|
require_once 'site-settings.php';
|
||||||
|
|
||||||
echo '<!DOCTYPE html>';
|
echo '<!DOCTYPE html>';
|
||||||
echo '<html lang="sv">';
|
echo '<html lang="'.$config_sitelang.'">';
|
||||||
|
|
||||||
echo '<head>';
|
echo '<head>';
|
||||||
echo '<title>';
|
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 '<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($robots) == 0 ? null : '<meta name="robots" content="'.implode(',', $robots).'">');
|
||||||
echo (count($google) == 0 ? null : '<meta name="robots" content="'.implode(',', $google).'">');
|
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="cache-control" content="cache">';
|
||||||
echo '<meta http-equiv="expires" content="'.(60*60*24).'">';
|
echo '<meta http-equiv="expires" content="'.(60*60*24).'">';
|
||||||
|
|
||||||
echo '<meta property="og:locale" content="">';
|
echo '<meta property="og:locale" content="'.$lang['metadata']['locale'].'">';
|
||||||
echo '<meta property="og:locale:alternative" content="">';
|
|
||||||
echo '<meta property="og:title" content="'.$site_title.'">';
|
echo '<meta property="og:title" content="'.$site_title.'">';
|
||||||
echo '<meta property="og:site_name" content="'.$site_title.'">';
|
echo '<meta property="og:site_name" content="'.$site_title.'">';
|
||||||
echo '<meta property="og:type" content="website">';
|
echo '<meta property="og:type" content="website">';
|
||||||
echo '<meta property="og:url" content="'.$site_url_current.'">';
|
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)) {
|
if(!empty($metadata_image)) {
|
||||||
echo '<meta property="og:image" content="'.$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="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:url" content="'.$site_url_current.'">';
|
||||||
echo '<meta property="twitter:title" content="'.$site_title.'">';
|
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 (empty($metadata_image) ? null : '<meta property="twitter:image" content="'.$metadata_image.'">');
|
||||||
|
|
||||||
echo '<link rel="canonical" href="'.$site_url_current.'">';
|
echo '<link rel="canonical" href="'.$site_url_current.'">';
|
||||||
|
@ -50,9 +49,9 @@
|
||||||
echo '<link type="image/x-icon" rel="icon" href="'.$site_favicon.'">';
|
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 (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 '<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', '', $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 (!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('css/portable'.($minified == true ? '.min.css' : '.css?'.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 '</head>';
|
||||||
|
|
||||||
echo '<body';
|
echo '<body';
|
||||||
|
|
|
@ -19,16 +19,19 @@
|
||||||
$robots = ['nofollow','nosnippet','noarchive','noimageindex'];
|
$robots = ['nofollow','nosnippet','noarchive','noimageindex'];
|
||||||
|
|
||||||
$dir_files = $config_root.'/files/'.$config_folder;
|
$dir_files = $config_root.'/files/'.$config_folder;
|
||||||
|
$dir_css = 'css';
|
||||||
$dir_functions = 'functions';
|
$dir_functions = 'functions';
|
||||||
$dir_images = 'images';
|
$dir_images = 'images';
|
||||||
|
$dir_js = 'js';
|
||||||
$dir_languages = 'languages';
|
$dir_languages = 'languages';
|
||||||
|
|
||||||
if(file_exists('vendor(autoload.php')) {
|
if(file_exists('vendor/autoload.php')) {
|
||||||
require_once 'vendor/autoload.php';
|
require_once 'vendor/autoload.php';
|
||||||
$Parsedown = new Parsedown();
|
$Parsedown = new Parsedown();
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once 'site-functions.php';
|
require_once 'site-functions.php';
|
||||||
|
require_once 'languages/'.(isset($_GET['lang']) ? safetag($_GET['lang']) : 'se').'.php';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue