mirror of
https://git.coop/cotech/website.git
synced 2025-06-26 16:40:52 +00:00
Add script to migrate clients from wordpress mirror
This script iterates over all of the coops to pull their clients from the individual co-op pages, normalises the filenames of the images and creates an entry under `_clients`.
This commit is contained in:
@ -67,7 +67,12 @@ class Coop
|
||||
|
||||
def clients
|
||||
doc.css('div.client-thumb-container').map do |node|
|
||||
node.xpath('h5').text&.parameterize
|
||||
style = node.xpath('div/@style')
|
||||
{
|
||||
title: node.xpath('h5').text,
|
||||
slug: node.xpath('h5').text&.parameterize,
|
||||
logo: style.text.match(/background-image: url\((.*)\)/)[1]
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user