This repository was archived by the owner on Jun 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 11from pathlib import Path
2+ import os
23
34# /Users/bmiller/Runestone/RunestoneServer/books/csawesome/published/csawesome/MixedFreeResponse/RandomStringChooserParsonsB.html
45# becomes /ns/books/published/
@@ -7,15 +8,17 @@ def path_to_url(p):
78 return "https://runestone.academy/ns/books/published" + parts [- 1 ]
89
910
10- with open ("sitemap.xml" , "w" ) as sm :
11+ home = os .environ ["HOME" ]
12+
13+ with open (Path (home , "Runestone/RunestoneServer/static" , "sitemap.xml" ), "w" ) as sm :
1114 sm .write (
12- """
13- <?xml version="1.0" encoding="utf-8"?>
15+ """<?xml version="1.0" encoding="utf-8"?>
1416<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
1517 <url><loc>https://runestone.academy</loc></url>
18+ <url><loc>https://runestone.academy/runestone/books/index</loc></url>
1619"""
1720 )
18- p = Path ("/Users/bmiller/ Runestone/RunestoneServer /books" )
21+ p = Path (home , " Runestone/books" )
1922 for i in p .rglob ("*.html" ):
2023 if "build" in str (i ) or "knowl" in str (i ):
2124 continue
You can’t perform that action at this time.
0 commit comments