diff --git a/docs/administration/customizing-gitea.md b/docs/administration/customizing-gitea.md index ad89062e..7eb07930 100644 --- a/docs/administration/customizing-gitea.md +++ b/docs/administration/customizing-gitea.md @@ -165,50 +165,110 @@ Alice <-- Bob: Another authentication Response The script will detect tags with `class="language-plantuml"`, but you can change this by providing a second argument to `parsePlantumlCodeBlocks`. -### Example: STL Preview +### Example: CAD Files Preview -You can display STL file directly in Gitea by adding: +You can implement your own CAD file viewer inside your Gitea instance. -```html - ``` -to the file `templates/custom/footer.tmpl` -You also need to download the content of the library [Madeleine.js](https://github.com/beige90/Madeleine.js) and place it under `$GITEA_CUSTOM/public/assets/` folder. +Add public files + +Now we need to download latest version of O3DV. Go to "$GITEA_CUSTOM/public/assets/". +Create folder using (and cd into it): + +```mkdir o3dv +cd o3dv +``` + +Copy latest release zip link from [`GitHub`](https://github.com/kovacsv/Online3DViewer/releases) (v0.15.0 as of now). +Here use e.g. wget to download the file: +```wget https://github.com/kovacsv/Online3DViewer/releases/download/0.15.0/o3dv.zip +``` + +Use e.g. unzip to unzip the archive: +```unzip o3dv.zip +``` + + +Folder permissions + +Now the last thing. Change permissions on the "footer.tmpl": +```chown git:git $GITEA_CUSTOM/templates/custom/footer.tmpl +chmod 770 $GITEA_CUSTOM/templates/custom/footer.tmpl +``` + +And on the public folder: +```chown -R git:git $GITEA_CUSTOM/public +``` + +Now we have everything ready! Restart you gitea instance to apply these changes and you can test it in your browser. You should end-up with a folder structure similar to: @@ -218,48 +278,15 @@ $GITEA_CUSTOM/templates `-- footer.tmpl $GITEA_CUSTOM/public/assets/ --- Madeleine.js - |-- LICENSE - |-- README.md - |-- css - | |-- pygment_trac.css - | `-- stylesheet.css - |-- examples - | |-- ajax.html - | |-- index.html - | `-- upload.html - |-- images - | |-- bg_hr.png - | |-- blacktocat.png - | |-- icon_download.png - | `-- sprite_download.png - |-- models - | |-- dino2.stl - | |-- ducati.stl - | |-- gallardo.stl - | |-- lamp.stl - | |-- octocat.stl - | |-- skull.stl - | `-- treefrog.stl - `-- src - |-- Madeleine.js - |-- css - | `-- Madeleine.css - |-- icons - | |-- logo.png - | |-- madeleine.eot - | |-- madeleine.svg - | |-- madeleine.ttf - | `-- madeleine.woff - `-- lib - |-- MadeleineConverter.js - |-- MadeleineLoader.js - |-- detector.js - |-- stats.js - `-- three.min.js +-- o3dv + |-- o3dv_0.15.0.zip + |-- o3dv.license.md + |-- o3dv.min.js + |-- envmaps + \... ``` -Then restart Gitea and open a STL file on your Gitea instance. +Now we have everything ready! Restart you gitea instance to apply these changes and you can test it in your browser. ## Customizing Gitea mails