Jelajahi Sumber

Add favicon

Marcelo Fornet 5 tahun lalu
induk
melakukan
374ac3508e
12 mengubah file dengan 57 tambahan dan 1 penghapusan
  1. 7 0
      layout/_base.html
  2. TEMPAT SAMPAH
      root/android-chrome-192x192.png
  3. TEMPAT SAMPAH
      root/android-chrome-512x512.png
  4. TEMPAT SAMPAH
      root/apple-touch-icon.png
  5. 9 0
      root/browserconfig.xml
  6. TEMPAT SAMPAH
      root/favicon-16x16.png
  7. TEMPAT SAMPAH
      root/favicon-32x32.png
  8. TEMPAT SAMPAH
      root/favicon.ico
  9. TEMPAT SAMPAH
      root/mstile-150x150.png
  10. 15 0
      root/safari-pinned-tab.svg
  11. 19 0
      root/site.webmanifest
  12. 7 1
      sitegen.py

+ 7 - 0
layout/_base.html

@@ -6,6 +6,13 @@
 	<meta http-equiv="X-UA-Compatible" content="ie=edge">
 	<title>Alucho Portfolio</title>
 	<link rel="stylesheet" href="{{ 'css/main.css' | static }}">
+	<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
+	<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
+	<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
+	<link rel="manifest" href="/site.webmanifest">
+	<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
+	<meta name="msapplication-TileColor" content="#da532c">
+	<meta name="theme-color" content="#ffffff">
 	<script src="{{ 'js/eye.js' | static }}"></script>
 </head>
 <body>

TEMPAT SAMPAH
root/android-chrome-192x192.png


TEMPAT SAMPAH
root/android-chrome-512x512.png


TEMPAT SAMPAH
root/apple-touch-icon.png


+ 9 - 0
root/browserconfig.xml

@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<browserconfig>
+    <msapplication>
+        <tile>
+            <square150x150logo src="/mstile-150x150.png"/>
+            <TileColor>#da532c</TileColor>
+        </tile>
+    </msapplication>
+</browserconfig>

TEMPAT SAMPAH
root/favicon-16x16.png


TEMPAT SAMPAH
root/favicon-32x32.png


TEMPAT SAMPAH
root/favicon.ico


TEMPAT SAMPAH
root/mstile-150x150.png


+ 15 - 0
root/safari-pinned-tab.svg

@@ -0,0 +1,15 @@
+<?xml version="1.0" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
+ "http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
+<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
+ width="1376.000000pt" height="1376.000000pt" viewBox="0 0 1376.000000 1376.000000"
+ preserveAspectRatio="xMidYMid meet">
+<metadata>
+Created by potrace 1.11, written by Peter Selinger 2001-2013
+</metadata>
+<g transform="translate(0.000000,1376.000000) scale(0.100000,-0.100000)"
+fill="#000000" stroke="none">
+<path d="M10 6880 l0 -2610 6875 0 6875 0 0 2610 0 2610 -6875 0 -6875 0 0
+-2610z"/>
+</g>
+</svg>

+ 19 - 0
root/site.webmanifest

@@ -0,0 +1,19 @@
+{
+    "name": "",
+    "short_name": "",
+    "icons": [
+        {
+            "src": "/android-chrome-192x192.png",
+            "sizes": "192x192",
+            "type": "image/png"
+        },
+        {
+            "src": "/android-chrome-512x512.png",
+            "sizes": "512x512",
+            "type": "image/png"
+        }
+    ],
+    "theme_color": "#ffffff",
+    "background_color": "#ffffff",
+    "display": "standalone"
+}

+ 7 - 1
sitegen.py

@@ -54,6 +54,7 @@ def lang(ctx, value):
             print(f"Not translated phrase: `{value}`")
             return value
 
+
 @contextfilter
 def lang_url(ctx, value):
     name, _ = splitext(ctx.name)
@@ -105,6 +106,7 @@ def compile(env, path, target):
             with open(dst, 'w') as f:
                 f.write(output)
 
+
 def run(args):
     # Load layout
     file_loader = FileSystemLoader(args.source)
@@ -121,7 +123,10 @@ def run(args):
     if exists(args.target):
         rmtree(args.target)
 
-    makedirs(args.target)
+    if exists('root'):
+        copytree('root', args.target)
+    else:
+        makedirs(args.target)
 
     compile(env, path, args.target)
 
@@ -131,6 +136,7 @@ def run(args):
         env.globals['lang'] = other_lang
         compile(env, path, args.target)
 
+
 if __name__ == '__main__':
     parser = argparse.ArgumentParser("Site generator")