ipfs / dir-index-html

Directory listing HTML for go-ipfs gateways
MIT License
38 stars 55 forks source link

feat: Build script #40

Closed jessicaschilling closed 4 years ago

jessicaschilling commented 4 years ago

In this PR

Important!

Closes https://github.com/ipfs/dir-index-html/issues/6, BUT note that this will require updating go-ipfs itself to look for the new file names. (@ribasushi and/or @lidel, is this something you're willing to address in a separate PR?)

(we kept the same filename, no changes to go-ipfs needed)

jessicaschilling commented 4 years ago

@lidel and @ribasushi, could you please weigh in? If you're OK with this approach, we may want to consider using a release based on this in https://github.com/ipfs/go-ipfs/pull/7536, for efficiency. Thank you!

ribasushi commented 4 years ago

@jessicaschilling I think this is great! One procedural nit: do we care how heavy the page is? If we do, perhaps we can use a real minifier in place of the basic tr -d \"\t\n\r\" ? One of these perhaps https://goalsmashers.github.io/css-minification-benchmark/

Note - if we do not care much about the pagesize and/or the source is already "pretty tight" - this comment should probably be disregarded.

A few stylistic nits remain, but if you decide to use a smarter minifier they are moot anyway.

jessicaschilling commented 4 years ago

@ribasushi Yep, the idea here was to keep the whole thing as lightweight as possible. We aren't using any other modules, so adding one just for this purpose didn't seem like the ideal way to go. If you've got ideas for selectively removing spaces in sed etc while preserving what's needed in css, that'd be great.

jessicaschilling commented 4 years ago

Thanks, @ribasushi -- over to you, @lidel, for any thoughts 😊

jessicaschilling commented 4 years ago

@lidel Sounds like a good plan. Updated to remove dist directory and amend build script and test to look at the top-level dir instead. Back to you for the GitHub action finesse 😊 Thanks!