Skip to content
This repository has been archived by the owner on Mar 22, 2022. It is now read-only.

Preprocessing: ensure dir-index and dir-index-uncat are in sync #6

Closed
rht opened this issue Sep 4, 2015 · 13 comments · Fixed by #40
Closed

Preprocessing: ensure dir-index and dir-index-uncat are in sync #6

rht opened this issue Sep 4, 2015 · 13 comments · Fixed by #40
Assignees
Labels
dif/expert Extensive knowledge (implications, ramifications) required effort/days Estimated to take multiple days, but less than a week help wanted Seeking public contribution on this issue kind/maintenance Work required to avoid breaking changes or harm to project's status quo need/maintainers-input Needs input from the current maintainer(s) P1 High: Likely tackled by core team if no one steps up status/ready Ready to be worked

Comments

@rht
Copy link
Contributor

rht commented Sep 4, 2015

Preprocessing: Automate the css bundling and injection into dir-index-uncat.html with gulp-inject / gulp-usemin / gulp-useref

@hsanjuan hsanjuan added help wanted Seeking public contribution on this issue need/maintainers-input Needs input from the current maintainer(s) labels Mar 20, 2020
@jessicaschilling
Copy link
Contributor

I believe this one's no longer relevant with more recent changes to this repo.

@Stebalien
Copy link
Member

Is this automated now?

@jessicaschilling
Copy link
Contributor

My mistake, reopening -- that said, what's the reason maintaining two separate .css files and linking to them from dir-index-uncat.html instead of in <style> directly in the html? (Total css file size did go down considerably in recent revisions.)

@Stebalien
Copy link
Member

I think so we can minimize them in the HTML file? We could also, maybe, just embed the CSS then minimize the HTML files themselves on build.

@Stebalien
Copy link
Member

It was probably mostly that the bootstrap code was too much.

@jessicaschilling
Copy link
Contributor

There was a lot of Bootstrap code in there before. I'd vote to just embed the minified CSS for those two files in <style>. The remaining HTML is something like 50 lines.

@Stebalien
Copy link
Member

Stebalien commented May 21, 2020 via email

@jessicaschilling
Copy link
Contributor

I'm not sure how to do that in a Go context, but sounds good ...

@lidel lidel added the P0 Critical: Tackled by core team ASAP label Jul 24, 2020
@lidel lidel changed the title Preprocessing: Automate the css bundling and injection into dir-index-uncat.html Preprocessing: ensure dir-index and dir-index-uncat are in sync Jul 24, 2020
@lidel
Copy link
Member

lidel commented Jul 24, 2020

I think the key here is to remove the need for manual updating of two files

Namely, remove the need for this step from https://github.com/ipfs/dir-index-html#updating:

  1. Make changes to both dir-index.html and dir-index-uncat.html.

Instead, there should be npm run build script and clear distinction between

  • src/ (sources edited in PRs) and
  • dist/ (final artifacts used by go-ipfs)

@lidel lidel added dif/expert Extensive knowledge (implications, ramifications) required effort/days Estimated to take multiple days, but less than a week kind/maintenance Work required to avoid breaking changes or harm to project's status quo P1 High: Likely tackled by core team if no one steps up status/ready Ready to be worked and removed P0 Critical: Tackled by core team ASAP labels Jul 24, 2020
@ribasushi
Copy link
Contributor

ribasushi commented Jul 24, 2020

@lidel the core question is "why DO we carry 2 files".
Here is their difference colordiff -uw dir-index.html dir-index-uncat.html | less -SR:

image

Both the inline style and the linked to styles are the same minified .css. It seems... pointless.

@lidel
Copy link
Member

lidel commented Jul 24, 2020

I guess (based on partial feedback and git history) in 2015 there were two versions (human-readable source of truth and minified+inlined version for production), but over time only the minified version was updated with changes, making entire setup broken/obsolete.

Cleaning things up and introducing build script that creates dist/dir-index.html with inlined and minified CSS from human-readable src/dir-index.html is how I would fix this. That way only src/dir-index.html needs to be changed.

@jessicaschilling
Copy link
Contributor

I can probably do this. Will have a play around 😊

@jessicaschilling
Copy link
Contributor

#40 addresses this, but please note it'll also 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?)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dif/expert Extensive knowledge (implications, ramifications) required effort/days Estimated to take multiple days, but less than a week help wanted Seeking public contribution on this issue kind/maintenance Work required to avoid breaking changes or harm to project's status quo need/maintainers-input Needs input from the current maintainer(s) P1 High: Likely tackled by core team if no one steps up status/ready Ready to be worked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants