INN / umbrella-sfpublicpress

San Francisco Public Press
https://sfpublicpress.org/
GNU General Public License v2.0
1 stars 4 forks source link

Bulk tag --> category conversions, final round #124

Closed MirandaEcho closed 4 years ago

MirandaEcho commented 4 years ago
MirandaEcho commented 4 years ago

first one is done, and that's all I have left in me for today.

benlk commented 4 years ago

Shall I go ahead with this?

MirandaEcho commented 4 years ago

Yes please, thanks @benlk

benlk commented 4 years ago

What we can't do:

What we can do:

benlk commented 4 years ago

However, some "Uncategorized" posts have other categories assigned.

benlk commented 4 years ago

Borrowing from #95:

var count = 0;
tag = "Uncategorized";
for (const a of document.querySelectorAll(".column-categories")) {
    if ( 0 === a.textContent.localeCompare(tag)) {
        console.log([a.textContent, tag])
        a.closest('tr').querySelector('.check-column input[type=checkbox]').checked = true;
        count++;
    }
}
console.log( 'tags needing merge on this page: ' + count );

This has been done in bulk: all posts that were formerly categorized as "Uncategorized" alone are now categorized as "Uncategorized" and "News"

benlk commented 4 years ago

The default category has been set to "News" and the "Uncategorized" category is deleted.