-
- Downloads
port over base HTML layout from PHP to FastAPI+Jinja2
+ Mounted static files (at web/html) to /static.
+ Added AURWEB_VERSION to aurweb.config (this is used around HTML
to refer back to aurweb's release on git.archlinux.org), so we
need it easily accessible in the Python codebase.
+ Implemented basic Jinja2 partials to put together whole aurweb
pages. This may be missing some things currently and is a WIP
until this set is ready to be merged.
+ Added config [options] aurwebdir = YOUR_AUR_ROOT; this configuration
option should specify the root directory of the aurweb project.
It is used by various parts of the FastAPI codebase to target
project directories.
Added routes via aurweb.routers.html:
* POST /language: Set your session language.
* GET /favicon.ico: Redirect to /static/images/favicon.ico.
* Some browsers always look for $ROOT/favicon.ico to get an icon
for the page being loaded, regardless of a specified "shortcut
icon" given in a <link> directive.
* GET /: Home page; WIP.
* Updated aurweb.routers.html.language passes query parameters to
its next redirection.
When calling aurweb.templates.render_template, the context passed should
be formed via the aurweb.templates.make_context. See
aurweb.routers.html.index for an example of this.
Signed-off-by:
Kevin Morris <kevr@0cost.org>
Showing
- .coveragerc 1 addition, 0 deletions.coveragerc
- INSTALL 3 additions, 1 deletionINSTALL
- aurweb/asgi.py 22 additions, 1 deletionaurweb/asgi.py
- aurweb/config.py 5 additions, 0 deletionsaurweb/config.py
- aurweb/routers/html.py 50 additions, 0 deletionsaurweb/routers/html.py
- aurweb/templates.py 57 additions, 0 deletionsaurweb/templates.py
- conf/config.dev 1 addition, 0 deletionsconf/config.dev
- templates/index.html 4 additions, 0 deletionstemplates/index.html
- templates/partials/archdev-navbar.html 8 additions, 0 deletionstemplates/partials/archdev-navbar.html
- templates/partials/body.html 10 additions, 0 deletionstemplates/partials/body.html
- templates/partials/footer.html 5 additions, 0 deletionstemplates/partials/footer.html
- templates/partials/head.html 16 additions, 0 deletionstemplates/partials/head.html
- templates/partials/layout.html 10 additions, 0 deletionstemplates/partials/layout.html
- templates/partials/meta.html 1 addition, 0 deletionstemplates/partials/meta.html
- templates/partials/navbar.html 19 additions, 0 deletionstemplates/partials/navbar.html
- templates/partials/set_lang.html 28 additions, 0 deletionstemplates/partials/set_lang.html
- templates/partials/typeahead.html 30 additions, 0 deletionstemplates/partials/typeahead.html
- test/test_routes.py 69 additions, 0 deletionstest/test_routes.py
aurweb/routers/html.py
0 → 100644
aurweb/templates.py
0 → 100644
templates/index.html
0 → 100644
templates/partials/archdev-navbar.html
0 → 100644
templates/partials/body.html
0 → 100644
templates/partials/footer.html
0 → 100644
templates/partials/head.html
0 → 100644
templates/partials/layout.html
0 → 100644
templates/partials/meta.html
0 → 100644
templates/partials/navbar.html
0 → 100644
templates/partials/set_lang.html
0 → 100644
templates/partials/typeahead.html
0 → 100644
test/test_routes.py
0 → 100644
Please register or sign in to comment