Browse Source

Adding Adult Tag

Stephan Fuchs 10 months ago
parent
commit
0683238a6b
2 changed files with 10 additions and 1 deletions
  1. 1 1
      sugarcube_compile.bat
  2. 9 0
      sugarcube_postCompile.py

+ 1 - 1
sugarcube_compile.bat

@@ -13,7 +13,7 @@ if %PROCESSOR_ARCHITECTURE% == AMD64 (
 	CALL "%~dp0sugarcube\devTools\tweeGo\tweego_win86.exe" -o "%~dp0glife.html" "%~dp0sugarcube\src"
 )
 
-
+Python -X utf8 sugarcube_postCompile.py
 
 popd
 @echo Completed: %date% %time%

+ 9 - 0
sugarcube_postCompile.py

@@ -0,0 +1,9 @@
+#!/usr/bin/env python3
+
+import fileinput
+
+for line in fileinput.input("glife.html", inplace=True, encoding="utf-8"):
+    #print('{} {}'.format(fileinput.filelineno(), line), end='')
+    print(line, end='')
+    if line.strip() == '<head>':
+        print('<meta name="rating" content="adult" />', end='')