-
Notifications
You must be signed in to change notification settings - Fork 27
Filename rewrite
rudolphos edited this page Dec 14, 2024
·
12 revisions
// Fix X (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 X (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