1. Purpose
Suppose, using the Pelican static site generator, I write an article (to be exact, page ; in Pelican, this is not exactly what the article , but still the term статья rather than the страница seems to me more appropriate) in Markdown. The article file is located along the path /pages/myfolder/myarticle.md . It is necessary that after compiling Markdown in HTML, the paths along which the files are located — in this case myfolder — would not be myfolder , and the output would look like this: myfolder/myarticle.html .
2. Desired behavior
The structure of my content folder, where I write articles in Markdown:
└───pages ├───Life-hacks │ Neobyknovennaya.md │ Sasha-Idealna.md │ └───Sublime Text Sasha-Bozhestvenna.md The structure of my output folder, where articles written in Markdown are compiled.
└───pages ├───Life-hacks │ Neobyknovennaya.html │ Sasha-Idealna.html │ └───Sublime Text Sasha-Bozhestvenna.html 3. Actual behavior
Now the output folder looks like this:
├───pages │ Neobyknovennaya.html │ Sasha-Bozhestvenna.html │ Sasha-Idealna.html Folders Life-hacks and Sublime Text disappeared during assembly.
4. my settings
Part of my publishconf.py file:
USE_FOLDER_AS_CATEGORY = True PAGE_URL = '{slug}.html' PAGE_SAVE_AS = PAGE_URL CATEGORY_URL = '{slug}/index.html' CATEGORY_SAVE_AS = CATEGORY_URL 5. Steps to play
I installed the pelican and markdown packages via pip → I launch the terminal, being in the root folder of the test site, → I enter the pelican content command → I get the actual behavior, not the desired behavior.
6. Did not help
- In the URL Settings section of the Pelican documentation, where it describes how the site URL will look like, I did not find any variable that includes path names.
- Googled the answer to a similar question , but the configuration proposed by the author of the answer did not help. I get the same behavior.
- I looked through the list of sites made on Pelican , but I couldn’t find one with the folder structure I needed.
7. Do not offer
- Please do not give unargumented comments of the form
юзай $другой генератор сайтов$. - Yes, I know that you can put tags and categories on articles in Pelican, but it is necessary that the folder names are also contained in the URL.
8. Software and hardware environment
Operating system:
Windows 10 Enterprise LTSB 64-bit EN
Python:
3.6.0
Pelican:
3.7.1
articlesin contrast topages, are related to the date. I'm not going to use the date in the URL, sort by date, write news articles on the site - Sasha Chernykh