Skip to content

Commit

Permalink
Fix mounting the "/" to mkdocs site folder
Browse files Browse the repository at this point in the history
  • Loading branch information
unclecode committed Jun 22, 2024
1 parent d6182be commit b9bf8ac
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
# Mount the pages directory as a static directory
app.mount("/pages", StaticFiles(directory=__location__ + "/pages"), name="pages")
app.mount("/mkdocs", StaticFiles(directory="site", html=True), name="mkdocs")
app.mount("/", StaticFiles(directory="site", html=True), name="mkdocs")
site_templates = Jinja2Templates(directory=__location__ + "/site")
templates = Jinja2Templates(directory=__location__ + "/pages")
# chromedriver_autoinstaller.install() # Ensure chromedriver is installed
@lru_cache()
Expand All @@ -62,10 +64,6 @@ class CrawlRequest(BaseModel):
verbose: Optional[bool] = True


@app.get("/", response_class=HTMLResponse)
async def read_index(request: Request):
# redirect to site/index.html
return templates.TemplateResponse("index.html", {"request": request})

@app.get("/old", response_class=HTMLResponse)
async def read_index(request: Request):
Expand Down

0 comments on commit b9bf8ac

Please sign in to comment.