2
  • <%- config.url %> will return domain name.
  • <%- url_for(page.path) %> will return remaining URL after domain name but not the query param?

Can anyone help me to read query param ?

For example : http://localhost:4000/create.html?step=1

  • <%- config.url %> --> http://localhost:4000
  • <%- url_for(page.path) %> --> create.html
  • <%- what is the helper to read this %> --> step=1

1 Answer 1

1

Hexo helpers will be executed at build time, so there is no way they can be aware of the query parameter on the client side.

For your need, you'll have to use JavaScript on the client side: window.location.search will give you ?step=1.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.