Skip to content

Commit 1a44190

Browse files
committed
Blueprints should set static and template folders.
1 parent 2c11733 commit 1a44190

4 files changed

Lines changed: 10 additions & 6 deletions

File tree

src/reader/_app/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@
4141
# https://github.com/lemon24/reader/tree/3.21/src/reader/_app/v2
4242

4343

44-
blueprint = Blueprint('reader', __name__)
44+
blueprint = Blueprint(
45+
'reader', __name__, static_folder='static', template_folder='templates'
46+
)
4547

4648

4749
@blueprint.errorhandler(FeedNotFoundError)

src/reader/_app/legacy/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@
4545
from .api_thing import APIThing
4646

4747

48-
blueprint = Blueprint('reader', __name__)
48+
blueprint = Blueprint(
49+
'reader', __name__, static_folder='static', template_folder='templates'
50+
)
4951

5052

5153
@blueprint.app_template_filter()

src/reader/_app/legacy/templates/layout.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<!doctype html>
22

33
<meta name="viewport" content="width=device-width" />
4-
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
4+
<link rel="stylesheet" href="{{ url_for('reader.static', filename='style.css') }}">
55

6-
<script src="{{ url_for('static', filename='controls.js') }}"></script>
6+
<script src="{{ url_for('reader.static', filename='controls.js') }}"></script>
77
<script>
88

99
window.onload = function () {

src/reader/_app/templates/layout.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
1010
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
1111

12-
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
12+
<link rel="stylesheet" href="{{ url_for('reader.static', filename='style.css') }}">
1313

1414
<!-- styles flash if this is at the end and not in head -->
15-
<script src="{{ url_for('static', filename='theme.js') }}"></script>
15+
<script src="{{ url_for('reader.static', filename='theme.js') }}"></script>
1616

1717
<script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.8/dist/htmx.min.js" integrity="sha384-/TgkGk7p307TH7EXJDuUlgG3Ce1UVolAOFopFekQkkXihi5u/6OCvVKyz1W+idaz" crossorigin="anonymous"></script>
1818
<script src="https://cdn.jsdelivr.net/npm/htmx-ext-response-targets@2.0.4" integrity="sha384-T41oglUPvXLGBVyRdZsVRxNWnOOqCynaPubjUVjxhsjFTKrFJGEMm3/0KGmNQ+Pg" crossorigin="anonymous"></script>

0 commit comments

Comments
 (0)