Code Monkey home page Code Monkey logo

neos-seo's Introduction

Latest Stable Version Total Downloads License

Neos.Seo

A package to enable additional SEO features for Neos CMS.

It includes for example:

  • Meta tags
  • Sitemap
  • Social tags
  • Structured data

Check the documentation for all features and usage.

Installation and usage

  1. Run the following command f.e. in your site package:

    composer require --no-update "neos/seo:^4.1"
  2. Update your dependencies by running the following command in your project root folder:

    composer update
  3. Read the documentation

Contributions

When creating a PR and you change is valid for version 2.1 too, please set this branch also as your PR target.

If you are unsure or change a newer feature, use master as target.

Doing upmerges

To do an upmerge from 2.1 to 3.x run the following command

git checkout master && git fetch && git reset --hard origin/master && git merge --no-ff --no-commit origin/2.1 --strategy-option=ours

License

See License.

neos-seo's People

Contributors

aertmann avatar ahaeslich avatar benjamin-k avatar bwaidelich avatar crydotsnake avatar daniellienert avatar dfeyer avatar dimaip avatar dlubitz avatar gerdemann avatar gerhard-boden avatar htuscher avatar jobee avatar jonnitto avatar kdambekalns avatar kitsunet avatar markusguenther avatar markuspfeifenberger avatar mficzel avatar mgoldbeck avatar mhsdesign avatar mstruebing avatar neos-bot avatar neos-project avatar nikdro avatar rafaelka avatar robertlemke avatar sebobo avatar skurfuerst avatar t3easy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neos-seo's Issues

Use job queue for generating sitemaps

This should allow the generation of the sitemaps in a separate process in a specified time to prevent performance issues when search engines (or others) request it.

Set meta robots noindex if node is of type Neos.Seo:NoindexMixin

This is a (multiple allowed):

  • bug
  • enhancement
  • feature-discussion (RFC)

What you did

added Neos.Seo:NoindexMixin as supertype to a document nodetype to prevent those documents from indexing

Expected Behavior

  • not listed in the XML sitemap
  • meta robots noindex,follow

Actual Behavior

  • not listed in the XML sitemap
  • meta robots index,follow

This should probably fix it, what do you think?

prototype(Neos.Seo:MetaRobotsTag) < prototype(Neos.Fusion:Tag) {
    tagName = 'meta'
    attributes {
        name = 'robots'
        content = ${(q(node).property('metaRobotsNoindex') || q(node).is('[instanceof Neos.Seo:NoindexMixin]') ? 'noindex' : 'index') + ',' + (q(node).property('metaRobotsNofollow') ? 'nofollow' : 'follow')}
    }
}

Translation Tag Missing

This is a:

  • bug

  • Version: 3.0.0

  • Platform/Target and Browser Versions: Chrome 73 on OSX

What you did

Upgraded to Neos 4.3 and Neos.SEO 3

Expected Behavior

See a placeholder text

Actual Behavior

Placeholder displays:
Neos.Seo:NodeTypes.TitleTagMixin:properties.titleOverride.textAreaEditor.placeholder

I think there's a language Tag Missing.

@jonnitto

@Sebobo Mach bitte ein issue auf Neos SEO, und mention Jon

Render Opengraph & twitter card data if only specific fields are set

Currently OG and Twittercard tags are only rendered when the respective type is set.

This create additional effort for editors who just want to override the image or a specific text.
For example use a longer description text for twitter.
In this case they have to fill in all fields and select a type to get all required fields according to the standard described on http://ogp.me/.

Therefore I suggest to render the OG/Twitter tags as soon as any of those fields is set in the backend.
The other required fields (title, type, image, url) can be automatically built if not set.
For the Twitter tags no defaults are necessary as the fallback is OG https://developer.twitter.com/en/docs/tweets/optimize-with-cards/overview/markup.

As discussed with @mgoldbeck this behavior might be breaking and therefore will be targeted for Neos.Seo 3.0.

Proposal for the defaults:

  • title: inherit from TitleTag prototype and change tag name + add attributes
  • type: fallback to Website
  • image: fallback to closest page with an image set else empty
  • url: already rendered by default

Wrong value for hreflang attribute in language alternate link

Jira issue originally created by user soee:

Neos uses values from language dimension configuration to generate alternate language links like:

<link rel="alternate" hreflang="en_GB" href="http://domain.com/gb"/>

but if we check it in W3C Validator it will complain about:

Bad value en*GB for attribute hreflang on element link: The language subtag en*GB is not a valid language subtag.

This is because hreflang attribute should use dash to separate language and region keys not underscore. I think we can either format it when rendering alternate links, or define valid values in language dimension configuration if it won't break Neos somehow (docs should be updated than).

Jira-URL: https://jira.neos.io/browse/NEOS-1344

Writing tools / On-page analysis

Jira issue originally created by user @mgoldbeck:

Writing tools / On-page analysis

As editor I want helpful hints while creating content:

  • proper use of headlines (only one h1, two to three h2/h3 elements)
  • use of structural markup to help readers (lists, emphasis, …)
  • keyword usage (inverse document frequency and friends)

On a bigger scale some metrics on the site structure would be nice.

Jira-URL: https://jira.neos.io/browse/NEOS-724

Add documentation for multisite installations

Some features of this package won't work well with multi site installations.

Especially everything that is configured in the Settings.yaml.

Therefore we should provide documentation how to solve this, f.e. in Fusion and setting these values in the homepage.

Allow static resources for og:image

In some projects, we use a fallback-image from Resources/Public for og:image, if no OpenGraphImage is defined in inspector.

Since 3.0 this isn't so easy with Neos.Seo:OpenGraphMetaTags. It assumes, that image is always an asset (i.e. persisted resource). It would be nice to be able to use resource://Vendor.Package/[...] URLS in the Neos.Fusion:Case for image.

Google's new snippet length

Google officially confirmed a changed length of snippets on SERPs:

Over the past week or so, many have been noticing that the snippets were longer than what’s typically been shown.
RankRanger has been tracking these as well, and according to its tools, the snippet length has grown from 160 characters to almost 230 characters on average.

Taken from: https://searchengineland.com/google-officially-increases-length-snippets-search-results-287596

Shouldn't we change the max length for metaDescription from 156 to 230 ?

BUG: Use updated syntax for Twitter card image

Twitter seems to have silently deprecated the "twitter:image:src" notation for images in Twitter cards. Instead, the documentation now reads only "twitter:image".

The old notation still seems to be working for now, though. I stumbled upon this while trying to solve a problem with images not displaying in Twitter cards.

Render OG tag for Site Name

The tag <meta property="og:site_name" /> should be rendered on the homepage and contain the name of the current site.

Render FB tag Admins

The Facebook tag <meta property="fb:admins" /> should be rendered on the homepage and contain a user defined value via Fusion using the package settings.

Integrators should be able to override this to make it editable. F.e. via a homepage.

Provide fallback for twitter:image if none is set

We take the first image that is provided in the content of the page.
Here we just reuse the logic from #97.

This should be easily configurable via Fusion to allow integrators to verify that the output makes sense.

queryParameters should not be URL-Encoded in Neos.Seo:StructuredData.Website.SearchAction

This is a (multiple allowed):

  • bug

  • Neos.Seo Version: 3.0.2

  • Neos Version: 4.3.0

What you did

Added targetNode to Neos.Seo:StructuredData.Website

prototype(Neos.Seo:StructuredData.Website) {
    potentialAction.targetNode = ${q(site).find('[instanceof Vendor.ElasticSearch:Document.Searchresults]').get(0)}
}

Problem

queryParameter search "{search_term_string}" should not be encoded to "%7Bsearch_term_string%7D". Structured Data Testing Tool returns an Error.

Expected Behavior

<script type="application/ld+json">{  
   ...
   "potentialAction":{  
	  ...
      "target":"http:\/\/domain.tld\/suche?search={search_term_string}"
   }
}</script>

Actual Behavior

<script type="application/ld+json">{  
   ...
   "potentialAction":{  
	  ...
      "target":"http:\/\/domain.tld\/suche?search=%7Bsearch_term_string%7D"
   }
}</script>

Allow to specify language and country in hreflang

The hreflang value can specify a language (in ISO 639-1 format) and optionally the region (in ISO 3166-1 Alpha 2 format).

We "support" that, if the dimension used for generating alternate language links (defaults to language) is configured to use valid pairs already (if underscores are used, we replace with dashes):

  • de: German content, independent of region
  • en-GB: English content, for GB users
  • de-ES: German content, for users in Spain

If language and country are given separately, this needs some work. The same is true if values are used that do not conform to the ISO formats required.

More flexible hreflang handling (HTTP headers / XML sitemap)

Currently only meta tags are supported, but in some cases using HTTP headers or XML sitemaps might be desired.

Providing hreflang in XML sitemaps is described in https://support.google.com/webmasters/answer/2620865, but noted in https://www.rebelytics.com/hreflang-annotations/ it doesn't need to be high priority:

Google does not crawl and process XML sitemaps as often as HTML pages and therefore has problems processing the information that is included in sitemaps on time. If you choose this option, you will probably experience lots of hreflang errors in Google Search Console and lots of pages being displayed to the wrong users in Google’s search results.

Having support for HTTP headers is more important, as the same document explains:

HTTP headers can be set for every URL, including those that do not have their own source code (like the home page that redirects users based on their location or browser languages)

Default values for twitterCardType, openGraphType and ChangePropertyValue are not set on node:reapir

If the property values twitterCardType, openGraphType and ChangePropertyValue are already set with “empty string”, the new default value “~” will not be set on node:repair. A first attempt to fix this issue I created a node migration.

up:
  comments: 'This is the migration to adjust neos seo properties (twitterCardType, openGraphType, xmlSitemapChangeFrequency) accordingly if they are pre set with "empty string"'
  migration:
    -
      filters:
        -
          type: 'NodeType'
          settings:
            nodeType: 'Neos.Neos:Document'
            withSubTypes: true
      transformations:
        -
          type: 'ChangePropertyValue'
          settings:
            property: 'twitterCardType'
            newValue: '~'
        -
          type: 'ChangePropertyValue'
          settings:
            property: 'openGraphType'
            newValue: '~'
        -
          type: 'ChangePropertyValue'
          settings:
            property: 'xmlSitemapChangeFrequency'
            newValue: '~'
down:
  comments: 'No down migration available’

If the values are not set correctly editors will see the “You still have changes…” prompt. Saving the change will set the default value accordingly and the issues disappears for the specific node.

screenshot 2018-01-29 13 44 33

Render OG Tag for locale

The tag meta property="og:locale" /> should be rendered on the homepage and contain the value of Neos.Seo:LangAttribute.
When there is no language, the tag should not be rendered.

Simplify structured data object usage

Currently it's hard to write and read complex objects made with the provided structured data objects.
This could be made much simpler by using the spread operator {...props}.

For this we need to to raise the minimal supported version to 4.2.
This could be possibly done in a way to not be breaky.

SEO doesn't output alternate tag hreflang prperty

Jira issue originally created by user rolandschuetz:

typo3/neos-seo version 1.0.10 doesn't set the alternate language links correctly, the output misses the hreflang and looks like:

<link rel="alternate" hreflang="" href="http://examples.org/en"/>

This seems to be fixed with changing Root.ts2:71 from:

localeToLanguage = ${String.replace(item.preset.values[0], '_', '-')}

to

localeToLanguage = ${String.replace(item.targetDimensions.language.value

I don't understand that part of the system well enough yet, so I would like someone else to confirm and make a pull request for this, if applicable.

Jira-URL: https://jira.neos.io/browse/NEOS-1887

hreflang is empty

All the hreflang-Tags are set incorrect.

Following snippet is rendered from Neos.Demo Site Package
Similar on my current site :/ :

<link rel="alternate" hreflang="" href="https://neos-2.3.dev/"/>
<link rel="alternate" hreflang="" href="https://neos-2.3.dev/uk"/>
<link rel="alternate" hreflang="" href="https://neos-2.3.dev/de"/>
<link rel="alternate" hreflang="" href="https://neos-2.3.dev/fr"/>
<link rel="alternate" hreflang="" href="https://neos-2.3.dev/nl"/>
<link rel="alternate" hreflang="" href="https://neos-2.3.dev/da"/>
<link rel="alternate" hreflang="" href="https://neos-2.3.dev/lv"/>

The language settings seem to be set correctly: ..../Neos.Demo/Configuration/Settings.yaml

TYPO3:
  TYPO3CR:
    contentDimensions:
      'language':
        label: 'Neos.Demo:Main:contentDimensions.language'
        icon: 'icon-language'
        default: 'en_US'
        defaultPreset: 'en_US'
        presets:
          'all': ~
          'en_US':
            label: 'English (US)'
            values: ['en_US']
            uriSegment: 'en'
          'en_UK':
            label: 'English (UK)'
            values: ['en_UK', 'en_US']
            uriSegment: 'uk'
          'de':
            label: 'German'
            values: ['de']
            uriSegment: 'de'
          'fr':
            label: 'French'
            values: ['fr']
            uriSegment: 'fr'
          'nl':
            label: 'Dutch'
            values: ['nl', 'de']
            uriSegment: 'nl'
          'da':
            label: 'Danish'
            values: ['da']
            uriSegment: 'da'
          'lv':
            label: 'Latvian'
            values: ['lv']
            uriSegment: 'lv'

Correctly use hreflang and canonical together

The use of canonical and hreflang alternates together can be misleading and confuse search engines. Generally speaking, a document pointing to itself as canonical may point to others via hreflang, but having a hreflang and pointing to another page as canonical is nonsense:

Guten Tag Google, wie geht’s? I don’t want to be indexed, please index my twin brother instead. I speak German, so please index me and here are my cousins from other countries. Please index them too.

(taken from https://www.rebelytics.com/hreflang-canonical/, very nice explanation)

Generates malformed hreflang links when parent node is hidden

Neos.Seo seems to not check whether Nodes have parents which are set to “hidden”.

It does e.g. make from this hierarchie:
Home

  • LinkNode1
    • LinkNode2 (hidden)
      • PageNode (which should be ignored)

This constellation generates this malformed hreflang Link which causes a 404:
http://domain.com/PageNode

The correct hreflang Link - when no parent is hidden would be:
http://domain.com/LinkNode/LinkNode2/PageNode

And the behaviour i expect when the parent is hidden: Ignore, do not generate hreflang Link at all.

hreflang value is missing

Since Version 2.0.7 the value in the hreflang tag is missing.
Eg: Output with Version 2.0.6

Output since Version 2.0.7

Do I have to make any changes in the configuration, or is this a bug?

On my page I have only one language.

Implement webpage structured data object

See https://schema.org/WebPage

Example:

{
  "@type": "WebPage",
  "@id": "<https://example.org/subpage/>#webpage",
  "url": "<https://example.org/subpage/>",
  "inLanguage": "<en-US>",
  "name": "<The pages title>",
  "isPartOf": {
    "@id": "<https://example.org/>#website"
  },
  "image": {
    "@type": "ImageObject",
    "@id": "<https://example.org/subpage/>#primaryimage",
    "url": "<https://example.org/path/to/image.jpg>",
    "width": <1200>,
    "height": <600>,
    "caption": "<Caption of image>"
  },
  "primaryImageOfPage": {
    "@id": "<https://example.org/subpage/>#primaryimage"
  },
  "datePublished": "<2019-04-29T12:04:11+00:00>",
  "dateModified": "<2019-04-30T03:20:41+00:00>",
  "description": "<The pages description>",
  "breadcrumb": {
    "@id": "<https://example.org/subpage/>#breadcrumb"
  }
}
  • Replace all <xyz> parts with parameters from the page.
  • All props with #xyz at the end can be added later when a structured data graph is introduced.
  • Should be rendered on all pages

Render extendable robots.txt

This way the generated sitemap urls and other hints could be generated via a route and fusion code.
Integrators could extend this further.

Support author/publisher linking

Jira issue originally created by user @mgoldbeck:

OpenGraph/Dublin Core elements to specify author and publisher should be embedded in Neos output.

Questions:

  • Just links to pages? Author nodetype?

  • For facebook really a must to use FB pages urls?

  • Restrictions for Google Plus?

  • twitter handled by twitter card "creator" element!?

    Jira-URL: https://jira.neos.io/browse/NEOS-723

Render Twitter site tag

The tag <meta name="twitter:site" /> should be rendered containing the twitter handle of the person or organization running the site.
This should be the same value as it's now configurable via settings in the path Neos.Seo.socialProfile.profiles.twitter.

Provide fallback for og:image if none is set

We take the first image that is provided in the content of the page.
This should be easily configurable via Fusion to allow integrators to verify that the output makes sense.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.