GithubHelp home page GithubHelp logo

romanzipp / laravel-seo Goto Github PK

View Code? Open in Web Editor NEW
327.0 4.0 21.0 1.01 MB

SEO package made for maximum customization and flexibility

Home Page: https://romanzipp.github.io/Laravel-SEO/

License: MIT License

PHP 99.77% Shell 0.23%
laravel php php7 seo showcase php8

laravel-seo's Introduction

Laravel SEO

Latest Stable Version Total Downloads License GitHub Build Status

A SEO package made for maximum customization and flexibility.

Documentation

The full package documentation can be found on romanzipp.github.io/Laravel-SEO

Testing

./vendor/bin/phpunit

License

The MIT License (MIT). Please see License File for more information.

laravel-seo's People

Contributors

olssonm avatar romanzipp avatar spekulatius avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

laravel-seo's Issues

Duplicate tags

Describe the bug
Not sure if this qualifies as a bug.
Some tags are rendered twice while others are overridden.

To Reproduce
Steps to reproduce the behavior:

  1. Create AddSeoDefaults middleware
  2. Add seo()->title(config('app.name')); to AddSeoDefaults as fallback title
  3. In your controller or elsewhere add seo()->title('Something else');
  4. Title is as expected "Something else"
  5. Add seo()->meta('robots', 'index, follow') to AddSeoDefaults as fallback tag
  6. In your controller or elsewhere add seo()->meta('robots', 'noindex, nofollow')
  7. <meta name="robots" content="index, follow"> AND <meta name="robots" content="noindex, nofollow"> are rendered.

Expected behavior
All tags should only be rendered once and be rendered as they are called the last in the stack.

Use with jigsaw: "A facade root has not been set."

Hello @romanzipp,

I'm trying to get the package working with jigsaw. I've updated this starter and wanted to add Laravel SEO to it. I wonder if it's possible, below are steps to reproduce the issue:

To Reproduce
Steps to reproduce the behavior:

  1. Go to clone starter repo: git clone https://github.com/spekulatius/jigsaw-clean-blog
  2. composer install && yarn
  3. Add Laravel SEO: composer require romanzipp/laravel-seo
  4. Add PHP block to master.blade.php: @php $seo = \romanzipp\Seo\Facades\Seo::make(); @endphp
  5. Run yarn dev
  6. See error

I'm not sure if it's possible to make the package work with jigsaw, it might be desirable tho.

Thanks,
Peter

URL query parameters get escaped

To Reproduce

seo()->twitter('player', 'http://example.com/something?video=123&clip=456')

Expected behavior

<meta name="twitter:player" content="http://example.com/something?video=123&clip=456" />

Actual behavior

<meta name="twitter:player" content="http://example.com/something?video=123&amp;clip=456" />

Input as a nested array structure?

Hello @romanzipp

Your SEO package looks great, well thought out! Thank you for maintaining it!

I'm consider to use it in a package I'm building. I was wondering if there is a simple way to pass a nested array structure to process into header tags. I'm thinking of something like this:

$data = [
    'title' => 'abc',
    'description' => 'bla bla...',

    'twitter' => [
        'card' => 'summary',
        'creator' => '@romanzipp'
    ]
];

// Rendering and returning the result
seo()->render($data);

Is this possible?

Cheers,
Peter

PHP8 support

Hi,
would it be support for php8?
On composer update i get the following:
"romanzipp/laravel-seo[2.1.0, ..., 2.1.5] require php ^7.1 -> your php version (8.0.0) does not satisfy that requirement"

Further Shorthand Setters

Hey @romanzipp

I was wondering what you think about these for further shorthand setters:

  • canonical for the canonical URL
  • image for the meta and social sharing images
  • keywords for the keywords meta-tag and potentially the <meta property="article:tag" content="keyword" />

Generally, do you think it makes sense to have the meta-tags for article: similar to og/twitter?

Happy to help out!

Cheers,
Peter

Canonical Link

Describe the bug

Hello @romanzipp

I've used the shorthand for the canonical link and it added a meta-tag instead of the expected link-tag. I googled and couldn't find any information on a meta tag - only the typical <link ... >. Could this be a mistake? If so I'm happy to look into and provide a fix.

Cheers,
Peter

Add an option to render HTML5 tags

Is possible to set an option to render HTML5 tags instead XHTML?

Example:

<meta name="description" content="Laravel" />

to

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

Laravel Octane and tag duplication

Describe the bug
When using the plugin with Laravel Octane tags are duplicated. First off the title tag gets duplicated then anything added to the AddSeoDefaults middleware. I followed your tutorial(https://romanzipp.github.io/Laravel-SEO/example-app.html) on setting everything up including Providers and Middleware .

To Reproduce
Steps to reproduce the behavior:

  1. Install the plugin and set everything as defined here: https://romanzipp.github.io/Laravel-SEO/example-app.html
  2. Install Laravel Octane (https://github.com/laravel/octane)
  3. Run app and see problems

Expected behavior
The tags should not be duplicated.

Screenshots
https://i.postimg.cc/WbZhkY6j/Screenshot-2022-09-21-at-13-12-26.png

Additional context
I think this happens because Octane keeps requests in memory so somehow the plugin should reset the added metadata.

Struct attribute value '0' won't get rendered

Describe the bug
Struct attribute value '0' won't get rendered

To Reproduce

seo()->addMany([
    Meta::make()->attr('http-equiv', 'Cache-Control')->content('no-cache, no-store, must-revalidate'),
    Meta::make()->attr('http-equiv', 'Pragma')->content('no-cache'),
    Meta::make()->attr('http-equiv', 'Expires')->content('0'),
]);
<meta http-equiv="Expires" content />

Expected behavior

<meta http-equiv="Expires" content="0" />

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.