Skip to content

Conversation

@ADTC
Copy link
Contributor

@ADTC ADTC commented Apr 11, 2021

I didn't want both the changes of @EricFromCanada and myself to go to waste, so I'm opening this PR here including everything from #1403 and EricFromCanada#1

If you decide to merge this, you can close the others as obsolete. Thank you ❤️

Note: To preview this, please visit: https://adtc.github.io/liquid/

EricFromCanada and others added 30 commits March 24, 2021 12:08
In all the example input boxes, there is one empty line each before and after the code. This removes the empty lines.

In "Whitespace control" page, a new section explains how you can use the liquid tag and echo tag to more elegantly avoid whitespace starting from Liquid 5.0.0

A note has also been added to disclaim that the example output boxes may not have the exact whitespace output expected from the corresponding example input.
…section

In all the example input boxes, there is one empty line each before and after the code. This removes the empty lines.

In addition, many pages in the Filter section have several Input/Output boxes unnecessarily. Wherever possible, they were consolidated into one set of boxes only.

Some documentation have also been clarified further and expanded where lacking.
In all the example input boxes, there is one empty line each before and after the code. This removes the empty lines.

It's worth mentioning in the liquid tag documentation that all tags opened inside a liquid tag must be closed inside the same liquid tag, otherwise there will be a syntax error thrown by the compiler.

Some documentation have also been clarified further and expanded where lacking.
A bit of magic* splits the filters into categories using a new "category" key in the filter markdown files. All the files stay where they are, and all the URLs stay exactly the same!

* The trick is in the various array filters!

Note: All filters must have categories. The "aaa" category is a special category that will put those filters at the top under "Filters".
I think these are better taken out of the String Filters category (which is already lengthy) because they don't belong there. In String category, all filters change the final output of the string. But escape belongs with url_encode because they don't change the final output of string (only its encoding).

As for split, this actually better belongs in the Array Filters category because it splits a string into an array. Those looking for this filter are more likely to be thinking about array manipulation rather than string manipulation.
Scrollbar now scrolls over to the actual link and positions it at the center of sidebar. This is less jarring that scrolling to the section header at the top. The logo is also moved into the scrollable sidebar but made sticky through CSS.

Tested working on both desktop and mobile.
The {% endraw %} tag must be on its own line when using {%- raw -%} otherwise the code block will not get rendered as expected.
It looked like the filter subheadings like Array Filters were new separate sections in the menu, when it should be a subsection under Filters. This fixes it by changing the boldness and adding an indicative arrow next to the header so that it looks different.
Also apply some DRY principles and minification to the Javascript

The filter type links use Javascript to scroll the menu to the filter section. On mobile it will also open the menu. Pretty cool, huh?
It seems in mobile browsers, the padding is not enough to show the menu properly. The auto-hiding location bar of the browser pushes the menu down when visible.

It looks better with double padding on both desktop and mobile.
The note is already in "render with" so just making sure it's also in "render for".
For Introduction, because the sidebar menu also contain the same anchors, they create a conflict for the anchor links in the first paragraph. The solution is to manually render the headings with a modified anchor name. (Objects header was included for consistency and future-proofing.)

For Template, because of the presence of the version badge, the anchor name has the stripped version number added to it. Hence the anchor links need to reflect that.
@ADTC
Copy link
Contributor Author

ADTC commented Apr 23, 2021

Closing this PR due to new changes being force-pushed into #1403. I will rebase my changes and open a new PR once that one is merged.

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.

2 participants