Skip to content

Commit c0a1f6e

Browse files
committed
Updated metatags.php
1 parent 3855633 commit c0a1f6e

File tree

6 files changed

+12
-4
lines changed

6 files changed

+12
-4
lines changed

config.php

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
// Gets included before every PHP file and can be used to define custom constants or functions.
55
// All variables of the framework are already available here e.g.:
66

7+
define('DOMAIN', implode(".", array_slice(explode(".", $_SERVER['SERVER_NAME']), -2, 2)));
8+
79
define('NAME', 'LupCode'); // can be removed, just for example
810

911
?>

scripts/metatags.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@
2222
<meta http-equiv="content-language" content="<?php echo LANGUAGE_CODE; ?>">
2323
<?php
2424

25+
echo '<link rel="canonical" href="https://'.DOMAIN.PROJECT_ROOT.LANGUAGE_CODE.'/'.REQUEST.'" />';
26+
2527
foreach(SUPPORTED_LANGUAGES as $lang)
26-
echo '<link rel="alternate" href="https://'.$_SERVER['SERVER_NAME'].PROJECT_ROOT.$lang.'/'.REQUEST.'" hreflang="'.$lang.'" />';
28+
echo '<link rel="alternate" href="https://'.DOMAIN.PROJECT_ROOT.$lang.'/'.REQUEST.'" hreflang="'.$lang.'" />';
2729

30+
foreach(scandir(STATICS.'css/fonts/') as $fontFile){
31+
if($fontFile[0] === '.') continue; // ignore files starting with '.'
32+
echo '<link rel="preload" as="font" href="'.CSS.'fonts/'.$fontFile.'">';
33+
}
2834
?>

static/css/fonts/.gitkeep

Whitespace-only changes.

views/error/index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
noCache();
55

66
?><!DOCTYPE html>
7-
<html>
7+
<html lang="<?php echo LANGUAGE_CODE; ?>">
88
<head>
99
<title>Example error page</title>
1010
<?php include(SCRIPTS.'metatags.php'); ?>

views/language-editor/index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function languageEditorUnchanged(){
125125
if(form) form.reset();
126126
}
127127
</script>
128-
<html>
128+
<html lang="<?php echo LANGUAGE_CODE; ?>">
129129
<head>
130130
<title>Language Editor - PHP Framework by LupCode</title>
131131
<?php include(SCRIPTS.'metatags.php'); ?>

views/start/index.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
noCache();
55

66
?><!DOCTYPE html>
7-
<html>
7+
<html lang="<?php echo LANGUAGE_CODE; ?>">
88
<head>
99
<title><?php echo TEXT['pageTitleStart']; ?></title>
1010
<?php include(SCRIPTS.'metatags.php'); ?>

0 commit comments

Comments
 (0)