Closed jessicaschilling closed 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!
@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.
@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.
Thanks, @ribasushi -- over to you, @lidel, for any thoughts 😊
@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!
In this PR
src
directoryAdds newdist
directorybuild
script inpackage.json
to do the following:dist
directorydist/dir-index.html
that includes a minified, inlined version of external CSS files fromsrc
directory (and removes their corresponding<link>
s to stylesheets)test
directory at the builtdist/dir-index.html
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)