Use .File.ContentBaseName instead of .TranslationBaseName. If you create a page bundle instead of a regular page, .TranslationBaseName will return “Index” instead of the name of the containing folder.
It looks like you will need to create a directory in static/ or assets/ every time you create a new page. Why not use page bundles instead, and store the image adjacent to the markdown? Less work, easier to maintain, etc.
Question: why do you need to specify the name and identifier in the menu entry?
it is not a bundle i use, the name and identifier are used for a sidemap structure by the toha theme.i just need to create one folder for each category i use.
I understand that. I was offering a potentially simpler alternative.
I understand that. When a menu entry is defined on a page, the name property is not required unless you want to use something other than the page title. The identifier property is only required if there are duplicate name values within the same menu.
In any event, to obtain the values you want, use one or more of the file variables in conjunction with one or more of these functions: