Skip to content

Instantly share code, notes, and snippets.

@innermond
Created December 8, 2018 09:55
Show Gist options
  • Save innermond/706ddf1440bd3606214da56860d1d058 to your computer and use it in GitHub Desktop.
Save innermond/706ddf1440bd3606214da56860d1d058 to your computer and use it in GitHub Desktop.
use sed to add srcset tag to a img tag that misses it
sed -i -e 's/<img src="\[HOST\]\/img\/\([^"]*\)"/<img src="[HOST]\/img\/\1" srcset="[HOST]\/img\/\1 700w,[HOST]\/img\/400w\/\1 400w" sizes="(max-width: 480px) 100vw, 70vw"/g' <html-file>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment