Skip to content

Commit

Permalink
feat(seo): improved title and meta descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Jul 8, 2024
1 parent a9edab8 commit af74c8c
Show file tree
Hide file tree
Showing 62 changed files with 184 additions and 170 deletions.
5 changes: 3 additions & 2 deletions phpmyfaq/add.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@
// Twig template variables
$templateVars = [
... $templateVars,
'title' => sprintf('%s - %s', Translation::get('msgNewContentHeader'), $faqConfig->getTitle()),
'title' => sprintf('%s - %s', Translation::get('msgAddContent'), $faqConfig->getTitle()),
'metaDescription' => sprintf('%s | %s', Translation::get('msgNewContentHeader'), $faqConfig->getTitle()),
'msgNewContentHeader' => Translation::get('msgNewContentHeader'),
'msgNewContentAddon' => Translation::get('msgNewContentAddon'),
'lang' => $Language->getLanguage(),
Expand All @@ -120,7 +121,7 @@
'msgNewContentSubmit' => Translation::get('msgNewContentSubmit'),
'enableWysiwygEditor' => $faqConfig->get('main.enableWysiwygEditorFrontend'),
'currentTimestamp' => $request->server->get('REQUEST_TIME'),
'msgSeperateKeywordsWithCommas' => Translation::get('msgSeperateKeywordsWithCommas'),
'msgSeparateKeywordsWithCommas' => Translation::get('msgSeparateKeywordsWithCommas'),
'noCategories' => empty($categories),
'msgFormDisabledDueToMissingCategories' => Translation::get('msgFormDisabledDueToMissingCategories'),
'displayFullForm' => $displayFullForm,
Expand Down
2 changes: 1 addition & 1 deletion phpmyfaq/admin/faqs.editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@
'ad_entry_tags' => Translation::get('ad_entry_tags'),
'ad_entry_keywords' => Translation::get('ad_entry_keywords'),
'ad_entry_author' => Translation::get('ad_entry_author'),
'ad_entry_email' => Translation::get('ad_entry_email'),
'msgEmail' => Translation::get('msgEmail'),
'msgSeoCenter' => Translation::get('seoCenter'),
'msgSerp' => Translation::get('msgSerp'),
'msgSerpTitle' => Translation::get('msgSerpTitle'),
Expand Down
2 changes: 1 addition & 1 deletion phpmyfaq/admin/import.csv.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
'answer' => Translation::get('ad_entry_content'),
'keywords' => Translation::get('ad_entry_keywords'),
'author' => Translation::get('ad_entry_author'),
'email' => Translation::get('ad_entry_email'),
'email' => Translation::get('msgEmail'),
'languageCode' => Translation::get('msgLanguageCode'),
'seperateWithCommas' => Translation::get('msgSeperateWithCommas'),
'tags' => Translation::get('ad_entry_tags'),
Expand Down
4 changes: 2 additions & 2 deletions phpmyfaq/admin/user.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@
'ad_user_active' => Translation::get('ad_user_active'),
'ad_user_blocked' => Translation::get('ad_user_blocked'),
'ad_user_protected' => Translation::get('ad_user_protected'),
'ad_user_realname' => Translation::get('ad_user_realname'),
'ad_entry_email' => Translation::get('ad_entry_email'),
'msgRealname' => Translation::get('msgRealname'),
'msgEmail' => Translation::get('msgEmail'),
'ad_user_is_superadmin' => Translation::get('ad_user_is_superadmin'),
'ad_user_overwrite_passwd' => Translation::get('ad_user_overwrite_passwd'),
'ad_user_overwrite_twofactor' => Translation::get('ad_user_overwrite_twofactor'),
Expand Down
3 changes: 2 additions & 1 deletion phpmyfaq/ask.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@

$templateVars = [
... $templateVars,
'title' => sprintf('%s - %s', Translation::get('msgNewContentHeader'), $faqConfig->getTitle()),
'title' => sprintf('%s - %s', Translation::get('msgQuestion'), $faqConfig->getTitle()),
'metaDescription' => sprintf(Translation::get('msgQuestionMetaDesc'), $faqConfig->getTitle()),
'msgMatchingQuestions' => Translation::get('msgMatchingQuestions'),
'msgFinishSubmission' => Translation::get('msgFinishSubmission'),
'lang' => $Language->getLanguage(),
Expand Down
2 changes: 1 addition & 1 deletion phpmyfaq/assets/templates/admin/content/faq.editor.twig
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@

<!-- E-Mail -->
<div class="row mb-2">
<label class="col-lg-2 col-form-label" for="email">{{ ad_entry_email }}</label>
<label class="col-lg-2 col-form-label" for="email">{{ msgEmail }}</label>
<div class="col-lg-10">
<input type="email" name="email" id="email" value="{{ faqData['email']|raw }}" class="form-control">
</div>
Expand Down
8 changes: 4 additions & 4 deletions phpmyfaq/assets/templates/admin/user/users.twig
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@

<div class="row mb-2">
<label class="col-lg-4 col-form-label" for="display_name">
{{ ad_user_realname }}
{{ msgRealname }}
</label>
<div class="col-lg-8">
<input type="text" id="display_name" name="display_name" value=""
Expand All @@ -91,7 +91,7 @@

<div class="row mb-2">
<label class="col-lg-4 col-form-label" for="email">
{{ ad_entry_email }}
{{ msgEmail }}
</label>
<div class="col-lg-8">
<input type="email" id="email" name="email" value="" class="form-control" required
Expand Down Expand Up @@ -383,7 +383,7 @@

<div class="row mb-2">
<label class="col-lg-4 col-form-label"
for="add_user_realname">{{ ad_user_realname }}</label>
for="add_user_realname">{{ msgRealname }}</label>
<div class="col-lg-8">
<input type="text" name="add_user_realname" id="add_user_realname" required tabindex="2"
class="form-control">
Expand All @@ -392,7 +392,7 @@

<div class="row mb-2">
<label class="col-lg-4 col-form-label" for="add_user_email">
{{ ad_entry_email }}
{{ msgEmail }}
</label>
<div class="col-lg-8">
<input type="email" name="user_email" id="add_user_email" required tabindex="3"
Expand Down
2 changes: 1 addition & 1 deletion phpmyfaq/assets/templates/default/add.twig
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
</label>
<div class="col-sm-9">
<input type="text" class="form-control" name="keywords" id="keywords" {{ id8_required }}>
<small class="text-muted">{{ msgSeperateKeywordsWithCommas }}</small>
<small class="text-muted">{{ msgSeparateKeywordsWithCommas }}</small>
</div>
</div>
{% endif %}
Expand Down
5 changes: 1 addition & 4 deletions phpmyfaq/assets/templates/default/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@
<meta content="{{ metaRobots }}" name="robots">
<meta content="7 days" name="revisit-after">

{% if isDebugEnabled %}
<link href="{{ baseHref }}assets/dist/debugMode.css" rel="stylesheet">
{% endif %}
{% if isDebugEnabled %}<link href="{{ baseHref }}assets/dist/debugMode.css" rel="stylesheet">{% endif %}

<link href="{{ baseHref }}assets/dist/styles.css" rel="stylesheet">
<style>
{{ customCss }}
</style>

<link href="{{ baseHref }}assets/images/favicon.ico" rel="shortcut icon">
<link href="{{ currentPageUrl }}" rel="canonical">
</head>
Expand Down
14 changes: 7 additions & 7 deletions phpmyfaq/assets/templates/default/register.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

{% block content %}
<section class="col-12">
<h1>{{ pageHeader }}</h1>
<p>{{ msgRegistrationCredentials }} {{ msgRegistrationNote }}</p>
<h1>{{ 'msgRegistration' | translate }}</h1>
<p>{{ 'msgRegistrationCredentials' | translate }} {{ 'msgRegistrationNote' | translate }}</p>

<div class="row mb-2">
<div class="col">
Expand All @@ -18,21 +18,21 @@
<input type="hidden" name="lang" id="lang" value="{{ lang }}">

<div class="row mb-2">
<label class="col-3 form-control-label" for="realname">{{ realname }}</label>
<label class="col-3 form-control-label" for="realname">{{ 'msgRealname' | translate }}</label>
<div class="col-9">
<input type="text" name="realname" id="realname" required class="form-control">
</div>
</div>

<div class="row mb-2">
<label class="col-3 form-control-label" for="name">{{ loginname }}</label>
<label class="col-3 form-control-label" for="name">{{ 'msgUsername' | translate }}</label>
<div class="col-9">
<input type="text" name="name" id="name" required class="form-control">
</div>
</div>

<div class="row mb-2">
<label class="col-3 form-control-label" for="email">{{ email }}</label>
<label class="col-3 form-control-label" for="email">{{ 'msgEmail' | translate }}</label>
<div class="col-9">
<input type="email" name="email" id="email" required class="form-control">
</div>
Expand All @@ -42,7 +42,7 @@
<div class="offset-3 col-sm-9">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="isVisible" name="isVisible">
<label class="form-check-label" for="isVisible"> {{ is_visible }} </label>
<label class="form-check-label" for="isVisible"> {{ 'msgUserDataVisible' | translate }} </label>
</div>
</div>
</div>
Expand All @@ -52,7 +52,7 @@
<div class="row mb-2">
<div class="col-12 text-end">
<button class="btn btn-primary" type="submit" id="pmf-submit-register" data-pmf-form="save-registration">
{{ submitRegister }}
{{ 'submitRegister' | translate }}
</button>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion phpmyfaq/assets/templates/default/request-removal.twig
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
{{ csrf | raw }}

<div class="row mb-2">
<label class="col-sm-3 form-control-label" for="name">{{ ad_user_loginname }}</label>
<label class="col-sm-3 form-control-label" for="name">{{ msgUsername }}</label>
<div class="col-sm-9">
<input
type="text"
Expand Down
4 changes: 2 additions & 2 deletions phpmyfaq/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -533,13 +533,13 @@
'faqloginaction' => $action,
'login' => Translation::get('ad_auth_ok'),
'username' => Translation::get('ad_auth_user'),
'realname' => Translation::get('ad_user_realname'),
'realname' => Translation::get('msgRealname'),
'password' => Translation::get('ad_auth_passwd'),
'rememberMe' => Translation::get('rememberMe'),
'submitRegister' => Translation::get('submitRegister'),
'headerChangePassword' => Translation::get('ad_passwd_cop'),
'msgUsername' => Translation::get('ad_auth_user'),
'msgEmail' => Translation::get('ad_entry_email'),
'msgEmail' => Translation::get('msgEmail'),
'msgSubmit' => Translation::get('msgNewContentSubmit'),
'loginPageMessage' => Translation::get('loginPageMessage'),
'msgAdvancedSearch' => Translation::get('msgAdvancedSearch'),
Expand Down
1 change: 1 addition & 0 deletions phpmyfaq/open-questions.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
$templateVars = [
... $templateVars,
'title' => sprintf('%s - %s', Translation::get('msgOpenQuestions'), $faqConfig->getTitle()),
'metaDescription' => sprintf(Translation::get('msgOpenQuestionsMetaDesc'), $faqConfig->getTitle()),
'pageHeader' => Translation::get('msgOpenQuestions'),
'msgQuestionText' => Translation::get('msgQuestionText'),
'msgDate_User' => Translation::get('msgDate_User'),
Expand Down
2 changes: 1 addition & 1 deletion phpmyfaq/password.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
'pageHeader' => Translation::get('lostPassword'),
'lang' => $faqConfig->getLanguage()->getLanguage(),
'msgUsername' => Translation::get('ad_auth_user'),
'msgEmail' => Translation::get('ad_entry_email'),
'msgEmail' => Translation::get('msgEmail'),
'msgSubmit' => Translation::get('msgNewContentSubmit'),
];

Expand Down
17 changes: 6 additions & 11 deletions phpmyfaq/register.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,13 @@
$templateVars = [
... $templateVars,
'title' => sprintf('%s - %s', Translation::get('msgRegistration'), $faqConfig->getTitle()),
'pageHeader' => Translation::get('msgRegistration'),
'msgRegistration' => Translation::get('msgRegistration'),
'msgRegistrationCredentials' => Translation::get('msgRegistrationCredentials'),
'msgRegistrationNote' => Translation::get('msgRegistrationNote'),
'lang' => $faqLangCode,
'loginname' => Translation::get('ad_user_loginname'),
'realname' => Translation::get('ad_user_realname'),
'email' => Translation::get('ad_entry_email'),
'is_visible' => Translation::get('ad_user_data_is_visible'),
'submitRegister' => Translation::get('submitRegister'),
'captchaFieldset' =>
$captchaHelper->renderCaptcha($captcha, 'register', Translation::get('msgCaptcha'), $user->isLoggedIn()),
'captchaFieldset' => $captchaHelper->renderCaptcha(
$captcha,
'register',
Translation::get('msgCaptcha'),
$user->isLoggedIn()
),
];

return $templateVars;
2 changes: 1 addition & 1 deletion phpmyfaq/request-removal.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
'privacyURL' => Strings::htmlentities($faqConfig->get('main.privacyURL')),
'msgNewContentName' => Translation::get('msgNewContentName'),
'msgNewContentMail' => Translation::get('msgNewContentMail'),
'ad_user_loginname' => Translation::get('ad_user_loginname'),
'msgUsername' => Translation::get('msgUsername'),
'csrf' => Token::getInstance()->getTokenInput('request-removal'),
'lang' => $Language->getLanguage(),
'userId' => $user->getUserId(),
Expand Down
17 changes: 15 additions & 2 deletions phpmyfaq/show.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/

use phpMyFAQ\Category;
use phpMyFAQ\Configuration;
use phpMyFAQ\Filter;
use phpMyFAQ\Helper\CategoryHelper;
use phpMyFAQ\Language\Plurals;
Expand All @@ -32,6 +33,9 @@
}

$request = Request::createFromGlobals();

$faqConfig = Configuration::getConfigurationInstance();

$selectedCategoryId = Filter::filterVar($request->query->get('cat'), FILTER_VALIDATE_INT);
$subCategoryContent = '';

Expand Down Expand Up @@ -104,10 +108,11 @@
$categoryImage = $faqConfig->getDefaultUrl() . 'content/user/images/' . $categoryData->getImage();
}

$categoryHeader = Translation::get('msgEntriesIn') . Strings::htmlentities($categoryData->getName());

// Twig template variables
$templateVars = [
... $templateVars,
'categoryHeader' => Translation::get('msgEntriesIn') . Strings::htmlentities($categoryData->getName()),
'categoryFaqsHeader' => $categoryData->getName(),
'categoryDescription' => Strings::htmlspecialchars($categoryData->getDescription() ?? ''),
'categorySubsHeader' => Translation::get('msgSubCategories'),
Expand All @@ -124,10 +129,11 @@
->setConfiguration($faqConfig)
->setCategory($category);

$categoryHeader = Translation::get('msgFullCategories');

// Twig template variables
$templateVars = [
... $templateVars,
'categoryHeader' => Translation::get('msgFullCategories'),
'categoryFaqsHeader' => Translation::get('msgShowAllCategories'),
'categoryDescription' => Translation::get('msgCategoryDescription'),
'categorySubsHeader' => Translation::get('msgSubCategories'),
Expand All @@ -137,4 +143,11 @@
];
}

$templateVars = [
... $templateVars,
'title' => sprintf('%s - %s', $categoryHeader, $faqConfig->getTitle()),
'metaDescription' => sprintf(Translation::get('msgCategoryMetaDesc'), $faqConfig->getTitle()),
'categoryHeader' => $categoryHeader,
];

return $templateVars;
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public function requestUserRemoval(Request $request): JsonResponse
) {
$question = sprintf(
"%s %s<br>%s %s<br>%s %s<br><br>%s",
Translation::get('ad_user_loginname'),
Translation::get('msgUsername'),
$loginName,
Translation::get('msgNewContentName'),
$author,
Expand Down
6 changes: 3 additions & 3 deletions phpmyfaq/translations/language_ar.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,10 +426,10 @@
$PMF_LANG['permission::21'] = 'حذف أسئلة مفتوحة';
$PMF_LANG['msgAttachedFiles'] = 'الملف المرفق:';
$PMF_LANG['ad_user_action'] = 'عمليات';
$PMF_LANG['ad_entry_email'] = 'البريد الإلكتروني:';
$PMF_LANG['msgEmail'] = 'البريد الإلكتروني:';
$PMF_LANG['ad_entry_allowComments'] = 'إتاحة التعليق';
$PMF_LANG['msgWriteNoComment'] = 'لا يمكنك التعليق على هذا السؤال';
$PMF_LANG['ad_user_realname'] = 'الإسم الحقيقي';
$PMF_LANG['msgRealname'] = 'الإسم الحقيقي';
$PMF_LANG['ad_export_generate_pdf'] = 'صنع ملف PDF ';
$PMF_LANG['ad_export_full_faq'] = 'PDF أسئلتك على شكل ملف من نوع ';
$PMF_LANG['err_bannedIP'] = ' الخاص بك تم إيقافه رقم الأى بي';
Expand Down Expand Up @@ -754,7 +754,7 @@
$PMF_LANG['msgNewTranslationSubmit'] = 'ارسال';
$PMF_LANG['msgTranslate'] = 'ترجم هذا المدخل';
$PMF_LANG['msgTranslateSubmit'] = 'أبدأ الترجمة';
$PMF_LANG['ad_user_loginname'] = 'اسم المستخدم :';
$PMF_LANG['msgUsername'] = 'اسم المستخدم :';
$PMF_LANG['errorRegistration'] = 'هذه الخانة الزامية';
$PMF_LANG['submitRegister'] = 'سجل';
$PMF_LANG['msgUserData'] = 'معلومات المستخدم مطلوبة لاتمام عملية التسجيل';
Expand Down
4 changes: 2 additions & 2 deletions phpmyfaq/translations/language_bn.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,10 +527,10 @@

// Added v1.3.3 - 27.05.2003 - Thorsten
$PMF_LANG["ad_user_action"] = "action";
$PMF_LANG["ad_entry_email"] = "Email address";
$PMF_LANG["msgEmail"] = "Email address";
$PMF_LANG["ad_entry_allowComments"] = "Allow comments";
$PMF_LANG["msgWriteNoComment"] = "আপনি এখানে মতামত দিতে পারবেন না";
$PMF_LANG["ad_user_realname"] = "real name";
$PMF_LANG["msgRealname"] = "real name";
$PMF_LANG["ad_export_generate_pdf"] = "generate PDF file";
$PMF_LANG["ad_export_full_faq"] = "Your FAQ as a PDF file: ";
$PMF_LANG["err_bannedIP"] = "আপনার IP নিষিদ্ধ করা হয়েছে।";
Expand Down
4 changes: 2 additions & 2 deletions phpmyfaq/translations/language_bs.php
Original file line number Diff line number Diff line change
Expand Up @@ -531,10 +531,10 @@

// Added v1.3.3 - 27.05.2003 - Thorsten
$PMF_LANG["ad_user_action"] = "akcija";
$PMF_LANG["ad_entry_email"] = "e-mail adresa";
$PMF_LANG["msgEmail"] = "e-mail adresa";
$PMF_LANG["ad_entry_allowComments"] = "dopusti komentarisanje";
$PMF_LANG["msgWriteNoComment"] = "Ne mo&#382;ete staviti komentar za ovaj unos";
$PMF_LANG["ad_user_realname"] = "Pravo ime";
$PMF_LANG["msgRealname"] = "Pravo ime";
$PMF_LANG["ad_export_generate_pdf"] = "kreiraj PDF fajl";
$PMF_LANG["ad_export_full_faq"] = "Va&#353; FAQ kao PDF fajl: ";
$PMF_LANG["err_bannedIP"] = "Va&#353;a IP adresa je blokirana.";
Expand Down
6 changes: 3 additions & 3 deletions phpmyfaq/translations/language_cs.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,10 @@
$PMF_LANG['permission::delquestion'] = 'smazat nezodpovězené dotazy';
$PMF_LANG['msgAttachedFiles'] = 'připojené soubory:';
$PMF_LANG['ad_user_action'] = 'akce';
$PMF_LANG['ad_entry_email'] = 'e-mail adresa:';
$PMF_LANG['msgEmail'] = 'e-mail adresa:';
$PMF_LANG['ad_entry_allowComments'] = 'Povolit vkládání komentářů k tomuto záznamu:';
$PMF_LANG['msgWriteNoComment'] = 'K tomuto záznamu nemůžete připojit komentář.';
$PMF_LANG['ad_user_realname'] = 'skutečné jméno:';
$PMF_LANG['msgRealname'] = 'skutečné jméno:';
$PMF_LANG['ad_export_generate_pdf'] = 'Vytvořit PDF';
$PMF_LANG['ad_export_full_faq'] = 'Dotazy jako PDF soubor: ';
$PMF_LANG['err_bannedIP'] = 'Vaše IP adresa byla přidána do "nepovolených adres".';
Expand Down Expand Up @@ -668,7 +668,7 @@
$PMF_LANG['msgOnlineVersionCheck'] = 'Online ověření verze';
$PMF_LANG['ad_system_info'] = 'Systémové informace';
$PMF_LANG['msgRegisterUser'] = 'Registrovat';
$PMF_LANG['ad_user_loginname'] = 'Uživatelské jméno:';
$PMF_LANG['msgUsername'] = 'Uživatelské jméno:';
$PMF_LANG['errorRegistration'] = 'Toto pole je povinné!';
$PMF_LANG['submitRegister'] = 'Registrovat';
$PMF_LANG['msgUserData'] = 'Informace o uživateli jsou pro registraci povinné';
Expand Down
Loading

0 comments on commit af74c8c

Please sign in to comment.