foundation / panini

A super simple flat file generator.
Other
592 stars 104 forks source link

Page path variable #232

Open archiekennedy opened 3 years ago

archiekennedy commented 3 years ago

This adds the {{path}} variable that stores the path to the current page, excluding the filename.

Example

src/pages/about.html           -> 
src/pages/subfolder/about.html -> subfolder/

Use case

Generating canonical tags, for example:

<link rel="canonical" href="https://example.com/{{path}}{{page}}.html">
archiekennedy commented 3 years ago

@DanielRuf can you review this PR? Thanks :smiley:

archiekennedy commented 3 years ago

@joeworkman can you take a look at these changes?