Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add options for feed update customization #167

Open
webcatzz opened this issue Jan 3, 2024 · 6 comments
Open

Add options for feed update customization #167

webcatzz opened this issue Jan 3, 2024 · 6 comments

Comments

@webcatzz
Copy link

webcatzz commented Jan 3, 2024

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 :-)

@bcomnes
Copy link
Owner

bcomnes commented Jan 3, 2024

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

@webcatzz
Copy link
Author

webcatzz commented Jan 4, 2024

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.

@bcomnes
Copy link
Owner

bcomnes commented Jan 4, 2024

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.

@webcatzz
Copy link
Author

webcatzz commented Jan 5, 2024

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

@bcomnes
Copy link
Owner

bcomnes commented Jan 5, 2024

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
Copy link
Owner

bcomnes commented Jan 5, 2024

Issue: bcomnes/async-neocities#80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants