Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add srcset and sizes in content with a filter #177

Merged
merged 1 commit into from
Sep 23, 2015
Merged

Commits on Sep 23, 2015

  1. Filter content to add srcset and sizes

    This changes our approach from one where `srcset` and `sizes` are written to the
    image markup in post content to one where the responsive attributes are added on the
    front end when the page is being rendered. There is a small performance hit but the
    benefit is worth the tradeoff for what is gained. What exactly do we gain? Glad you
    asked:
    
    * Automatically extend support to images in posts published before we responsive image
    support was available.
    * Removes the need to update the markup in TinyMCE when the image size is changed.
    * Keeps `sizes` attributes, which should probably be adjusted based on the needs of the
    theme, from being stored in the database.
    * Is non-destructive if a site needs to change available image sizes and regenerate
    thumbnails.
    
    Changes:
    
    * Removes the old JS code for handling markup changes in TinyMCE
    * Adds `tevkori_filter_content_images()` as a display filter.
    * Adds `_tevkori_filter_content_images_callback()` to process filtered images.
    * Adds tests
    joemcgill committed Sep 23, 2015
    Configuration menu
    Copy the full SHA
    84bc9ee View commit details
    Browse the repository at this point in the history