Skip to content

labd/wagtailyoast

 
 

Repository files navigation

Wagtailyoast

Yoastseo + Wagtail = 🚀

Features

  • SEO analysis and recommendations powered by YoastSEO
  • Real-time content analysis in Wagtail admin
  • Keyword optimization suggestions
  • Readability analysis
  • Meta description and title optimization
  • Customizable YoastPanel for Wagtail pages

Compatibility

  • Django 5.0+
  • Wagtail 7.0+
  • YoastSEO 1.80.0

Installation

Using pip

pip install wagtailyoast

Django Configuration

Add the package to your INSTALLED_APPS:

# settings.py

INSTALLED_APPS = [
    # ...
    'wagtailyoast',
    # ...
]

Settings

Configure the following settings in your settings.py:

# Locale used for Yoast analysis (default: 'en_US')
WY_LOCALE = 'en_US'

# Make sure you have STATIC_URL configured
STATIC_URL = '/static/'

Usage

Add YoastPanel to your Page models:

from wagtail.admin.edit_handlers import TabbedInterface, ObjectList
from wagtailyoast.edit_handlers import YoastPanel

class TestPage(Page):
    # ... your page fields ...
    keywords = models.CharField(default='', blank=True, max_length=100)

    edit_handler = TabbedInterface([
        ObjectList(Page.content_panels, heading='Content'),
        ObjectList(Page.promote_panels, heading='Promotion'),
        ObjectList(Page.settings_panels, heading='Settings'),
        YoastPanel(
            keywords='keywords',
            title='seo_title',
            search_description='search_description',
            slug='slug'
        ),
    ])

YoastPanel Parameters

  • keywords: Default keywords of the page
  • title: 'Search Engine Friendly' title that appears at the top of the browser window
  • search_description: 'Search Engine Friendly' description for search results
  • slug: URL slug of the page

Development

To develop on this package:

  1. Clone the repository:
git clone git@github.com:Aleksi44/wagtailyoast.git
cd wagtailyoast
  1. Install dependencies:
pip install -r requirements.txt
  1. Set up the database and run migrations:
python manage.py migrate
python manage.py init
  1. Start the Django development server:
python manage.py runserver 0.0.0.0:4243
  1. In a separate terminal, start the Webpack development server:
yarn install
yarn start

Local Development Integration

To use this package for development in another Wagtail project, install it as an editable package:

Using pip

pip install -e path/to/wagtailyoast

Using pdm

pdm add -e path/to/wagtailyoast

Using uv

uv add --editable path/to/wagtailyoast

This allows you to make changes to the wagtailyoast package and see them immediately reflected in your Wagtail project without needing to reinstall the package.

About

Wagtail + Yoast

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 58.6%
  • JavaScript 34.2%
  • HTML 5.3%
  • Makefile 1.1%
  • SCSS 0.8%