nanogen
nanogen copied to clipboard
Pass current relative URL into layouts
This allows access to the relative URL for the currently rendering page. Combined with site
data, this could be used to generate a canonical URL meta tag:
<meta name="canonical" content="<%= site.domain + path %>">
Example Outputs
Clean URLs | Source | path value |
---|---|---|
true | index.md | / |
true | articles/first-post.md | articles/first-post/ |
false | articles/first-post.md | articles/first-post.html |