FreeCAD / FreeCAD-Homepage

The homepage at http://www.freecad.org
GNU Lesser General Public License v2.1
23 stars 37 forks source link

feat: Added GitHub Edit Links #128

Closed AdarshRawat1 closed 11 months ago

AdarshRawat1 commented 11 months ago

closes - #34

What this PR does -

Implemented a "Improve this page on github" link in the footer section of every webpage, directing users to their respective source files in GitHub https://github.com/FreeCAD/FreeCAD-Homepage.

This feature enables users to easily fork and edit the content of webpages on GitHub.

Screenshot - image

yorikvanhavre commented 11 months ago

Isn't there a better way to get the github url that that does not involve the array of page names? Because the risk is that when someone adds a new page, they forget to update this file...

In each page the page name is set in $currentpage so we can also do something like:

$url = 'https://github.com/FreeCAD/FreeCAD-Homepage/blob/master/$currentpage';
AdarshRawat1 commented 11 months ago

Isn't there a better way to get the github url that that does not involve the array of page names? Because the risk is that when someone adds a new page, they forget to update this file...

In each page the page name is set in $currentpage so we can also do something like:

$url = 'https://github.com/FreeCAD/FreeCAD-Homepage/blob/master/$currentpage';

Thank you @yorikvanhavre, opting for the variable $currentpage would be a better approach.

$githubEditUrl = 'https://github.com/FreeCAD/FreeCAD-Homepage/blob/master/' . $currentpage;

yorikvanhavre commented 11 months ago

That seems perfect now. Thanks!!!