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

GSoD2020 Current book contents relocated into the new structure #478

Merged
merged 30 commits into from
Oct 20, 2020

Conversation

danielluehr
Copy link
Contributor

The commits in this PR correspond to the relocation of the current contents into the new structure's chapters and sections.

Changes done:

  • All original content has been incorporated into the new structure
  • Relative urls for assets were fixed and replaced by absolute links. They should probably be replaced by {% link %} tags
  • Some problems were detected in the js of some interactions. Part of it was corrected, but they require further reviewing.

WARNING: _include/kmap.html had to be fixed
since js was not being run on-load. In general,
the include file seems wrong (it is a "full"
page instead of just the pieces which are to
be included).
WARNING: State Table Generator not running.
Copy link
Member

@Shivansh2407 Shivansh2407 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working Well @danielluehr 🎉 .

  1. There are some links redirecting to learn.circuitverse.org, these will be changed later on section by section right?
  2. We can open an issue regarding the alignment of the list in the application1.html and other minor changes.
    @satu0king Please review this.

@satu0king
Copy link
Member

satu0king commented Oct 18, 2020

Relative urls for assets were fixed and replaced by absolute links. They should probably be replaced by {% link %} tags

@danielluehr why was this needed? We should be preferring relative links. Can you point out to specific files/lines where you changed this.

@danielluehr
Copy link
Contributor Author

Working Well @danielluehr tada .

1. There are some links redirecting to learn.circuitverse.org, these will be changed later on section by section right?

2. We can open an issue regarding the alignment of the list in the application1.html and other minor changes.
   @satu0king Please review this.

About 1, that is correct, the links will be updated later. They should have been internal links and not "full" urls. The correct way would be:

  • [My page](/path/to/page.html)
  • [Link to a page]({% link news/index.html %}) (the newest way, it used to be [Link]({{ site.baseurl }}{% link path/to/file.md %}))

That way, the links will be independent of the base url.

https://jekyllrb.com/docs/liquid/tags/#links

@danielluehr
Copy link
Contributor Author

Relative urls for assets were fixed and replaced by absolute links. They should probably be replaced by {% link %} tags

@danielluehr why was this needed? We should be preferring relative links. Can you point out to specific files/lines where you changed this.

Everywhere.

Since all assets (js, images and css) are located in the same directory tree /assets/ it doesn't make sense to have relative urls "upstream" the docs directory tree and into the assets directory tree. It could be ok for objects "downstream" the docs directory tree but, to my understanding, jekyll doesn't recommend that. I guess (I'm not sure, though) it would not copy the assets to the _site build directory.

Besides that, having relative url to assets makes it very difficult to track where they are if the content is located at a different level in the docs/ tree. JTD+jejyll can handle up to three levels in the documentation. If absolute url to assets are used, the same code (md or js) will work in any level. However, if relative urls are used the code has to be modified to match the current depth in the docs directory tree:

  • docs/page.md: "../assets/images/somefile.png"
  • docs/level1/page.md: "../../assets/images/somefile.png"
  • docs/level1/level2/page.md: "../../../assets/images/somefile.png"

with absolute urls to assets it would be just: "/assets/images/somefile.png" no matter the position of page.md

The only reason I have found to have relative urls pointing to assets would be to "preview" the page in github. However, the site is written to be parsed by jekyll to generate the static site. I don't think the "preview in github" without building it justify its usage.

The same is true for links to pages, see: https://jekyllrb.com/docs/liquid/tags/#links

Please let me know if there is an additional reason which should be considered and would justify going back to relative urls for assets.

@satu0king
Copy link
Member

Relative urls for assets were fixed and replaced by absolute links. They should probably be replaced by {% link %} tags

@danielluehr why was this needed? We should be preferring relative links. Can you point out to specific files/lines where you changed this.

Everywhere.

Since all assets (js, images and css) are located in the same directory tree /assets/ it doesn't make sense to have relative urls "upstream" the docs directory tree and into the assets directory tree. It could be ok for objects "downstream" the docs directory tree but, to my understanding, jekyll doesn't recommend that. I guess (I'm not sure, though) it would not copy the assets to the _site build directory.

Besides that, having relative url to assets makes it very difficult to track where they are if the content is located at a different level in the docs/ tree. JTD+jejyll can handle up to three levels in the documentation. If absolute url to assets are used, the same code (md or js) will work in any level. However, if relative urls are used the code has to be modified to match the current depth in the docs directory tree:

  • docs/page.md: "../assets/images/somefile.png"
  • docs/level1/page.md: "../../assets/images/somefile.png"
  • docs/level1/level2/page.md: "../../../assets/images/somefile.png"

with absolute urls to assets it would be just: "/assets/images/somefile.png" no matter the position of page.md

The only reason I have found to have relative urls pointing to assets would be to "preview" the page in github. However, the site is written to be parsed by jekyll to generate the static site. I don't think the "preview in github" without building it justify its usage.

The same is true for links to pages, see: https://jekyllrb.com/docs/liquid/tags/#links

Please let me know if there is an additional reason which should be considered and would justify going back to relative urls for assets.

Ah, thanks for the clarification. You are right, it is better to have absolute URLs.

@satu0king satu0king merged commit 1615486 into CircuitVerse:GSoD2020 Oct 20, 2020
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

Successfully merging this pull request may close these issues.

None yet

3 participants