Adding some new features written in JavaScript and html, after done this part I found I can’t find where in code editor my page corresponds. So given the url (which can get the html source code), can I find where is the Liquid code?
You can use {{ shop.url }} as listed on this variable cheat sheet and in the Shopify developer reference.
Returns the full URL of a shop. http://johns-apparel.com
<a href="{{ shop.url }}">Homepage</a>
You also have the option of using the secure version {{ shop.secure_url }}
Returns the full URL of a shop prepended by the https protocol. https://johns-apparel.com
<a href="{{ shop.secure_url }}">Homepage</a>
I also found in a quick test that it will also return the preview URL when previewing an unpublished page e.g. k29ijan0ye0r5g7k-51325174.shopifypreview.com
I figured it out, for those curious: Just link to "/". So, a link to the homepage of your site should appear as follows in your header.liquid file:
<a href="/">Link</a>
page.url is the URL of the current page, without the host (e.g. /index.html), as documented in Page Variables. So, in this case:
{% if page.url == "/index.html" %}
something
{% else %}
other thing
{% endif %}
(However, I don't think you need this any more, your other problem is probably solved. :) )
You could use {{ canonical_url }}