For my Jekyll site, on each page I am generating BibTeX code, to make it easier to cite. Currently, my template looks like this:
<code>
% BibTeX Code
% Copy and paste the following code into your .bib file to cite this article:
@online{
title="{{ page.title | escape }}",
author="{{ page.author | escape }}",
organization="{{ site.title | escape }}",
date="{{ page.date | date: "%Y-%m-%d" }}",
urldate="{{ site.time | date: "%Y-%m-%d" }}",
url="<!-- website domain name here -->{{page.url}}"
}
</code>
There's just one problem: for those of you who know BibTeX, I'm missing an entry name. Right after where in my code it says @online{, I need an entry name which is used to refer to entries in a BibTeX database. Now, there are certain limitations on this, for instance it can't contain spaces. In fact, the name of the HTML file that Jekyll generates would be perfect. However, it's unclear to me how to get just this name. The liquid template {{page.url}} will generate something like /2017/02/22/my-page.html, but all I want is just my-page.