Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add optional 'description' field for meta description content 📓 #34

Merged
merged 2 commits into from
Nov 1, 2024

Conversation

darcywong00
Copy link
Contributor

@darcywong00 darcywong00 commented Oct 28, 2024

In preparation for keymanapp/keyman.com#383 of adding metadata description content headers for improving SEO.

This adds an optional page description field via PHP or HTML.

When a PHP file includes a description:

head([
  'title' => 'Features | Keyman for Windows ' . $stable_version,
  'description' => 'Keyman for Windows Features',
  ...
]);

or when a Markdown file includes a description:

---
title: ....
description: ...
---

this will allow us to write HTML header info

<meta name="description" content="....">

@darcywong00 darcywong00 added this to the A18S14 milestone Oct 28, 2024
@darcywong00
Copy link
Contributor Author

An upcoming keyman.com PR will have the other portion of this

@darcywong00 darcywong00 changed the title feat: Add optional 'description' field for meta description content feat: Add optional 'description' field for meta description content 📓 Oct 28, 2024
@@ -16,6 +16,10 @@ function ShowMenu() {
return $this->showMenu;
}

function PageDescription() {
return $this->pagedescription;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know PHP but it seems this could be uninitalised as ln 92 is has an IF. This inturn will effects https://github.com/keymanapp/keyman.com/blob/1e9c090f14b795eb8aeb21704aec348d2f361b13/_includes/includes/md/mdhost.php#L17

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point. I've updated to return an empty string if pagedescription undefined.

@mcdurdin mcdurdin merged commit d06b95a into chore/v0.11 Nov 1, 2024
1 check passed
@mcdurdin mcdurdin deleted the feat/page-description branch November 1, 2024 04:11
mcdurdin added a commit that referenced this pull request Nov 1, 2024
* chore: support flag file _control/debug (#38)

This will allow, for example, .htaccess directives based on the
existence of the _control/debug file, so we know if we have built in
debug mode or not, for example:

<IfFile /var/www/html/_control/debug>
 ... add extra logging
</IfFile>

_control/debug should be added to .gitignore on all sites

* fix: Account for TIER_TEST on CI runs (#35)

* feat: Add optional 'description' field for meta description content 📓 (#34)

* feat: Add optional 'description' field for meta description content

* fix: Handle when pagedescription undefined

---------

Co-authored-by: Darcy Wong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants