DietPi-Docs icon indicating copy to clipboard operation
DietPi-Docs copied to clipboard

Use includes our own translation rules for shared code blocks

Open MichaIng opened this issue 4 years ago • 0 comments

E.g. the expandable dietpi-software block on all software pages could be an include file, so changes only need to be done once there. There are other shared blocks, like file server and VPN recommendations on certain software categories. I'll try the general concept out for the mentioned expandable block, and we can keep it in mind and use includes whenever we realise that we double code.

This might help as well with #345 to have a single tab for each type of image, with doubled content, but when using includes the code to maintain would not be doubled. Still, too many options/tabs with too long names might be not good already for the reason that it's not directly clear for novice users which one to select. We discussed that already and found a good middle way, IMO.


Another thing is that it should be possible to define own rules/syntax for the Markdown => HTML translator. I didn't have a closer look into it, but e.g. a [youtube]<videoID>[/youtube] would be awesome to have translated automatically with lazy loading, width, height, feature policy and such. Looks more like BB code, however 😄. Like includes but for dynamic content. Similarly it should be possible to have loading="lazy" applied to images automatically, so that we don't need to add it to the Markdown code, by altering those rules.

MichaIng avatar Mar 15 '21 13:03 MichaIng