Skip to content

Conversation

@batopa
Copy link
Member

@batopa batopa commented Jan 21, 2019

This PR add the ability to generate hreflang meta tag for i18n pages.

To use it in view:

echo $this->I18n->metaHreflang();

For example the generated HTML for an URL as https://example.com/en/help will be

<link href="http://localhost/en/help" rel="alternate" hreflang="en"/>
<link href="http://localhost/it/help" rel="alternate" hreflang="it"/>

for I18n.languages configuration

Configure::write('I18n', [
    // other I18n stuff
    // ....
    'languages' => [
        'en' => 'English',
        'it' => 'Italiano',
    ],
    // other I18n stuff
    // ....
]);

@batopa batopa added the enhancement New feature or request label Jan 21, 2019
@batopa batopa requested a review from didoda January 21, 2019 14:55
@codecov-io
Copy link

codecov-io commented Jan 21, 2019

Codecov Report

Merging #18 into master will increase coverage by 6.12%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #18      +/-   ##
============================================
+ Coverage     39.11%   45.23%   +6.12%     
- Complexity      101      106       +5     
============================================
  Files             5        5              
  Lines           317      336      +19     
============================================
+ Hits            124      152      +28     
+ Misses          193      184       -9
Impacted Files Coverage Δ Complexity Δ
src/View/Helper/I18nHelper.php 97.33% <100%> (+16.97%) 33 <6> (+5) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 756ca56...b059147. Read the comment docs.

@stefanorosanelli stefanorosanelli merged commit b4e4e76 into master Jan 22, 2019
@stefanorosanelli stefanorosanelli deleted the feat/hreflang-meta branch January 22, 2019 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants