deploy-to-neocities icon indicating copy to clipboard operation
deploy-to-neocities copied to clipboard

Add options for feed update customization

Open webcatzz opened this issue 1 year ago • 8 comments

The Neocities feed shows site updates using screenshots of the last four pages that were edited. Would it be possible to add an input to select which pages are deployed last? I like pushing my site with git but I lose the ability to customize how the update appears in the feed.

Thanks for the good work :-)

webcatzz avatar Jan 03 '24 11:01 webcatzz

Is that available in the API? Open to adding it if so.

bcomnes avatar Jan 03 '24 21:01 bcomnes

Not in the official API...

But in async-neocities you could filter out certain files from filesToUpload in much the same way protected files are already filtered out from filesToDelete:

// in neocitiesLocalDiff()
// given "delayedFiles: [list, of, paths]" in opts

const delayedFiles = new Set(opts.delayedFiles)

const filesToAdd = difference(difference(localFiles, ncFiles), delayedFiles)
const filesToDelete = difference(difference(ncFiles, localFiles), protectedFiles)

And then, in the deploy-to-neocities script, client.upload() them once all other files are uploaded. The only real trouble would be getting the list of paths to delay in the first place.

webcatzz avatar Jan 04 '24 09:01 webcatzz

So the important files are the ones that upload last?

What about being able to provide an array of strings that can be used in a sort predicate that are used to ensure they upload in that final order? Non-matching strings are just ignored. It would a static configuration most likely.

bcomnes avatar Jan 04 '24 16:01 bcomnes

That would also work! The feed update shows screenshots of whatever the last four HTML files to be edited for the first time in the last 24 hours were, with the very last file's screenshot larger than the rest

webcatzz avatar Jan 05 '24 14:01 webcatzz

Ok, open to contributions for this over in https://github.com/bcomnes/async-neocities. I do have an active project to update that lib to esm and add a CLI to enable a local-first deploy workflow that seamlessly carries over into CI, so I'll consider adding it when I am in there next, but no guarantees.

bcomnes avatar Jan 05 '24 17:01 bcomnes

Issue: https://github.com/bcomnes/async-neocities/issues/80

bcomnes avatar Jan 05 '24 17:01 bcomnes