Skip to content

Commit b0984f3

Browse files
committed
ci(documentation): add favicons for landing page of online documentation
Signed-off-by: Pierre-Yves Lapersonne <[email protected]>
1 parent 01278b8 commit b0984f3

File tree

6 files changed

+37
-5
lines changed

6 files changed

+37
-5
lines changed

NOTICE.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ in whole or part of, in any medium, except as required for reasonable and custom
88
and reproducing the content of the NOTICE and DOCUMENTATION files.
99
Any use or displaying shall constitute an infringement under intellectual property laws of France and international conventions.
1010

11+
./docs_release/docs_assets/apple-touch-icon.png
12+
./docs_release/docs_assets/favicon-16x16.png
13+
./docs_release/docs_assets/favicon-32x32.png
14+
./docs_release/docs_assets/favicon.ico
1115

1216
./Showcase/Showcase/Resources/Assets.xcassets/AppIconDev.appiconset/[email protected]
1317
./Showcase/Showcase/Resources/Assets.xcassets/AppIconDev.appiconset/[email protected]
3.77 KB
Loading
118 Bytes
Loading
129 Bytes
Loading

docs_release/docs_assets/favicon.ico

14.7 KB
Binary file not shown.

docs_release/uploadWebDoc.sh

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ HTML_PROJECT_WIKI_URL="https://github.com/Orange-OpenSource/ouds-ios/wiki"
4747
# We suppose all the documentation will be in this dedicated branch.
4848
SERVICE_PAGES_BRANCH="gh-pages"
4949

50+
# Path where assets to copy are
51+
ASSETS_DIRECTORY="./docs_assets"
52+
5053
# Path where the documentation will be temporary
5154
DOCS_DIRECTORY="../docs"
5255

@@ -274,9 +277,16 @@ _ "👉 All index.json files processed, now time to merge them"
274277
python3 merge-json-indexes.py "$DOCS_DIRECTORY/index"
275278
_ "👍 Merge done!"
276279

277-
# Step 3 - Add CNAME file for GitHub Pages
278-
# ----------------------------------------
280+
# Step 3 - Add custom assets
281+
# --------------------------
282+
283+
# Some custom assets for the website
284+
cp "$ASSETS_DIRECTORY/apple-touch-icon.png" "$DOCS_DIRECTORY/"
285+
cp "$ASSETS_DIRECTORY/favicon-16x16.png" "$DOCS_DIRECTORY/"
286+
cp "$ASSETS_DIRECTORY/favicon-32x32.png" "$DOCS_DIRECTORY/"
287+
cp "$ASSETS_DIRECTORY/favicon.ico" "$DOCS_DIRECTORY/"
279288

289+
# CNAME for GitHub Pages etc.
280290
if [[ $use_git -eq 1 ]]; then
281291
_ "👉 Updating CNAME file"
282292
echo "$SERVICE_PAGES_DOMAIN" > "$DOCS_DIRECTORY/CNAME"
@@ -290,7 +300,19 @@ fi
290300

291301
_ "👉 Updating index.html..."
292302

293-
echo "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>$HTML_TITLE</title><style>body{font-family:Arial,sans-serif;line-height:1.6;margin:0;padding:0;background-color:#000000;color:#fff;}header{background-color:#424242;color:white;padding:20px;text-align:center;}main{padding:20px;}h1{margin:0;}ol{padding-left:20px;}li{margin:10px 0;}a{color:#06f;text-decoration:none;}a:hover{text-decoration:underline;}footer{text-align:center;padding:10px;background-color:#000000;border-top:1px solid #e0e0e0;}</style></head><body><header><h1>$HTML_H1</h1></header><main>" > $DOCS_DIRECTORY/index.html
303+
echo "<!DOCTYPE html><html lang=\"en\"><head>" > $DOCS_DIRECTORY/index.html
304+
echo "<meta charset=\"UTF-8\">" >> $DOCS_DIRECTORY/index.html
305+
echo "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">" >> $DOCS_DIRECTORY/index.html
306+
echo "<title>$HTML_TITLE</title>" >> $DOCS_DIRECTORY/index.html
307+
echo "<link rel=\"icon\" href=\"./favicon-32x32.png\" sizes=\"32x32\" type=\"image/png\">" >> $DOCS_DIRECTORY/index.html
308+
echo "<link rel=\"icon\" href=\"./favicon-16x16.png\" sizes=\"16x16\" type=\"image/png\">" >> $DOCS_DIRECTORY/index.html
309+
echo "<link rel=\"apple-touch-icon\" href=\"./apple-touch-icon.png\" sizes=\"180x180\">" >> $DOCS_DIRECTORY/index.html
310+
echo "<link rel=\"icon\" href=\"./favicon.ico\">" >> $DOCS_DIRECTORY/index.html
311+
echo "<style>body{font-family:Arial,sans-serif;line-height:1.6;margin:0;padding:0;background-color:#000000;color:#fff;}header{background-color:#424242;color:white;padding:20px;text-align:center;}main{padding:20px;}h1{margin:0;}ol{padding-left:20px;}li{margin:10px 0;}a{color:#06f;text-decoration:none;}a:hover{text-decoration:underline;}footer{text-align:center;padding:10px;background-color:#000000;border-top:1px solid #e0e0e0;}</style>" >> $DOCS_DIRECTORY/index.html
312+
echo "</head><body>" >> $DOCS_DIRECTORY/index.html
313+
echo "<header><h1>$HTML_H1</h1></header>" >> $DOCS_DIRECTORY/index.html
314+
echo "<main>" >> $DOCS_DIRECTORY/index.html
315+
294316
echo "<h2>$HTML_H2</h2>" >> $DOCS_DIRECTORY/index.html
295317
echo "<h3>Version v$lib_version</h3>" >> $DOCS_DIRECTORY/index.html
296318
echo "<h4>All targets of the Swift Package are listed below</h4>" >> $DOCS_DIRECTORY/index.html
@@ -353,8 +375,14 @@ if [[ $use_git -eq 1 ]]; then
353375
cp -r "$DOCUMENTATION_HTML_LOCATION/index/"* "$DOCS_DIRECTORY/index/"
354376
cp -r "$DOCUMENTATION_HTML_LOCATION/js/"* "$DOCS_DIRECTORY/js/"
355377

356-
cp -r "$DOCUMENTATION_HTML_LOCATION/CNAME" "$DOCS_DIRECTORY/"
357-
cp -r "$DOCUMENTATION_HTML_LOCATION/index.html" "$DOCS_DIRECTORY/"
378+
cp "$DOCUMENTATION_HTML_LOCATION/CNAME" "$DOCS_DIRECTORY/"
379+
cp "$DOCUMENTATION_HTML_LOCATION/index.html" "$DOCS_DIRECTORY/"
380+
381+
# Some custom assets for the website
382+
cp "$DOCUMENTATION_HTML_LOCATION/apple-touch-icon.png" "$DOCS_DIRECTORY/"
383+
cp "$DOCUMENTATION_HTML_LOCATION/favicon-16x16.png" "$DOCS_DIRECTORY/"
384+
cp "$DOCUMENTATION_HTML_LOCATION/favicon-32x32.png" "$DOCS_DIRECTORY/"
385+
cp "$DOCUMENTATION_HTML_LOCATION/favicon.ico" "$DOCS_DIRECTORY/"
358386

359387
_ "🔨 Adding things (~ $files_count files)"
360388
git add "$DOCS_DIRECTORY"

0 commit comments

Comments
 (0)