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

Most build images for relative linked assest are broken for yarn build #676

Closed
nuke-web3 opened this issue Jul 3, 2023 · 8 comments · Fixed by #681
Closed

Most build images for relative linked assest are broken for yarn build #676

nuke-web3 opened this issue Jul 3, 2023 · 8 comments · Fixed by #681
Assignees
Labels
bug Something isn't working

Comments

@nuke-web3
Copy link

nuke-web3 commented Jul 3, 2023

yarn build yields a lot of issues with finding assets that are because of not locating them in a top-level assests dir.

The hosted slides and now broken, and must be fixed by one of the following:

  1. move all assets into the assets dir
  2. fix the reveal-md tooling to build these correctly - I suspect this is simply due to the path being too deep for the tool to discover the img assets... as some are found in ./build/... and others are not - our patched version is https://github.com/NukeManDan/reveal-md/tree/patch-1 for implementing such a fix. (hope it's easy to do... unclear)

This is pressing as any rendered version for student use depends on this working!

Related to #671

@nuke-web3 nuke-web3 added the bug Something isn't working label Jul 3, 2023
@nuke-web3
Copy link
Author

This is a direct result of changes in the blockchain and smart contract mods convention @JoshOrndorff 😭
Please check that the build and yarn serve then work as expected (without warnings/errors) before we close this issue out.

@JoshOrndorff
Copy link
Contributor

You mean putting the images next to the content? I was already doing that in BA, and I don't remember it being a problem then.

@nuke-web3
Copy link
Author

I struggled a lot with build vs serve for reveal-md issues. webpro/reveal-md#417 my work kinda fixed some things, but this edge case is not covered. I have not looked but perhaps its a tiny tweak to get the deeply nested img folders to be discovered and included. But I do not want to wast time on tweaking this more with my lack of js skills. Someone we can ask that is a pro?

@wirednkod
Copy link
Member

The issue is not the discovery of the inner paths rather than the wrongly given relative paths. #681 is fixing these paths.
A permanent solution would be to move all relative images to a specific directory and create an alias for instructors to easily link to the needed image - or (even better IMO) to instruct the instructors (pan intended), to use ONLY an img directory inside their sub-directories, and always link with ./img;

A nice protecting measure against broken links is to add a CI rule that will not allow merge of code if there is a link that is not found (we already did that in Documentations repo with Kian)

@JoshOrndorff
Copy link
Contributor

JoshOrndorff commented Jul 5, 2023

A nice protecting measure against broken links is to add a CI rule that will not allow merge of code if there is a link that is not found (we already did that in Documentations repo with Kian)

100000% this!

I added it way back in #368

But then it got taken out because github wouldn't let us use their ci for free for a repo that we aren't willing to let the world learn from. So it was removed in #420.

Finally, github caved and decided they would let us use their ci free even though we are hoarding our private content. So then the CI was kind of added back in #648 but this is not that useful because it doesn't check PRs. It only runs after the PR is merged when it is too late.

@JoshOrndorff
Copy link
Contributor

JoshOrndorff commented Jul 5, 2023

Since my preference to put images right beside content came into question, I'll take this opportunity to explain why I think this is a good idea. There are two main reasons.

  1. This exactly is what the reveal md example project does. Notice the location of this image file and how it is linked from the md.

  2. Maintaining a module's content is much more manageable when the content is structured this way. If I want to work on module 3, I only have to have syllabus/3-blockchain open. In the previous design, I have to also have the assets directory open. This is compounded by the facts that both directories are large (so they don't both fit in the left pane of my editor simultaneously) and they are very similarly structured (so when I see that I'm in 3-blockchain it takes more overhead to check whether that is the folder with the images, or the other folder with the exact same name that hosts the markdown).

Just my 2c.

@wirednkod
Copy link
Member

I agree with the approach having the img container in the same dir with the md file and thus under 1 structured directory. Now that the link checker is there, we can make sure that nothing breaks even before the PR is merged

@nuke-web3
Copy link
Author

related to #42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants