DIAGNijmegen / website-content

This repository stores all the content for the diag websites.
MIT License
5 stars 74 forks source link

Copy only those default pages that are actually used #438

Closed nlessmann closed 2 years ago

nlessmann commented 2 years ago

I've implemented Mart's idea of reading the pelicanconf.py file to find out which pages are actually used. These are now also copied in parse_content.py while copy_content.sh only copies those defaults that are always needed.

Closes #418

martvanrijthoven commented 2 years ago

Looks good Thanks!

There is a small problem with getting the URL and using that as the filename for the default markdown file for the publication page. In the pelican setting this does not correspond to the filename because the url also contains the current year. E.g., diag pelican config

We can maybe split the url on '/' and take the first value which should solve this small problem.

nlessmann commented 2 years ago

Thanks, I've added that!

nlessmann commented 2 years ago

Several websites also have copies of some of these default pages in their content folders. So I think we need to check them one-by-one and remove those that are not needed there. But the RTC website for example does need members.md but does not have it in the navigation.

martvanrijthoven commented 2 years ago

Several websites also have copies of some of these default pages in their content folders. So I think we need to check them one-by-one and remove those that are not needed there. But the RTC website for example does need members.md but does not have it in the navigation.

Yes I forgot about that. Websites can override the default pages if they put a md file in the website folder with the same name of the default page, please see the docs. Before the shutil copy we should check if the page already exists. If it exists we should not copy it to the website folder (this was implemented with the --no-clobber in the copy_content.sh).