-
Notifications
You must be signed in to change notification settings - Fork 26
Filename rewrite
Ng Guoyou edited this page May 27, 2019
·
11 revisions
// Fix Twitter media extensions
// https://pbs.twimg.com/media/D7daES-XoAAPyoA?format=jpg&name=large > D7daES-XoAAPyoA.jpg
sourceurl: pbs.twimg.com/media/(.*)\?.*format=(.*)&.*
capture: sourceurl
into: :$1:.:$2:
// Remove :large from Twitter images
filename: (.*)(:|_)large
sourceurl: pbs.twimg.com
capture: filename
into: :$1:
// Add ISO date to filenames
filename: .*
into: :isodate:_:filename:
// Matches images with no dot extension in filename
filename: ^[^\.]+[^\.]{0,5}$
mediatype: image
into: :filename:.jpg
// Matches videos with no dot extension in filename
filename: ^[^\.]+[^\.]{0,5}$
mediatype: video
into: :filename:.mp4
// Add .html extension to pages
context: page
into: :filename:.html