浏览代码

Styled article pages; more careful dir creation

Stan Jansen 3 年之前
父节点
当前提交
4d25a74d43
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      kindlerss.py

+ 6 - 1
kindlerss.py

@@ -13,7 +13,7 @@ DIR = args.output
 
 if not os.path.exists(DIR):
     os.makedirs(DIR)
-os.makedirs(os.path.join(DIR, "articles"))
+os.makedirs(os.path.join(DIR, "articles"), exist_ok=True)
 
 FILE = open(os.path.join(DIR, "index.html"), "w")
 
@@ -45,6 +45,11 @@ for item in channel.iterfind("item"):
         print("<head>", file=file)
         print("<meta charset=\"UTF-8\">", file=file)
         print("<title>RSS Feed</title>", file=file)
+        print("<style>", file=FILE)
+        print("* { font-family: sans-serif; line-height: 1.6em;}", file=FILE)
+        print("a:link { color: black }", file=FILE)
+        print("a:visited { color: #888 }", file=FILE)
+        print("</style>", file=FILE)
         print("</head>", file=file)
         print("<bady>", file=file)
         print(contents, file=file)