bobdenotter / seo

Bolt SEO extension
https://bobdenotter.github.io/seo/
MIT License
48 stars 34 forks source link

Choose the metatags.twig template location #21

Closed zomars closed 8 years ago

zomars commented 8 years ago

It would be nice if I could select where to the save metatags template, instead of the theme's default root. Generally I save it into a /partials sub-folder.

Thanks for this extension it's super useful.

jasperjorna commented 8 years ago

Since I'm using the extension with Bolt 3.* the _metatags.twig is no longer being picked up from the theme folder. Should it be inside a specific folder structure in the theme folder?

zomars commented 8 years ago

I've just noticed this also.

GwendolenLynch commented 8 years ago

This is due to the template being loaded in the Twig namespace of @bolt, which the theme path is very deliberately not included in.

I am presuming this is to prevent them being overridden.

jasperjorna commented 8 years ago

@bobdenotter can you clear up what the intention is? The instructions in the README don't seem to apply anymore: https://github.com/bobdenotter/seo#configure-the-meta-tags-output

reuhno commented 8 years ago

@bobdenotter Hi, the same for me.. Overwriting _metatags.twig still possible ?

flrvt commented 8 years ago

I'm seeing the same behaviour on Bolt 3.0.7 with the dev-master of this extension.

I am pretty sure this is not intentional. @GawainLynch could you elaborate more about the Twig namespace? How can this be fixed? Perhaps I can work on a PR.

GwendolenLynch commented 8 years ago

The behaviour isn't Bolt itself so much as the configurable options.

Basically here you could add:

# templates:
#     meta: @bolt/_metatags.twig

Note that they are probably best left commented out by default, but the example keeping the system default so that if accidentally uncommented it won't break things.

Then here:

protected function getDefaultConfig()
{
    return [
        'templates' => [
            'meta' => '@bolt/_metatags.twig',
        ]
    ];
}

Then here

        $html = $this->app['render']->render($this->config['templates'['meta'], $vars);