GNU/Weeb Mailing List <[email protected]>
 help / color / mirror / Atom feed
From: Memet Zx <[email protected]>
To: GNU/Weeb Mailing List <[email protected]>
Cc: Ammar Faizi <[email protected]>, Memet Zx <[email protected]>
Subject: [PATCH: Website v2 1/2] head.php: Fix issue with css/js head section
Date: Sat, 15 Apr 2023 21:48:04 +0700	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

When visiting a web page that ends with a forward slash `/`,
the associated CSS and JS files may fail to load properly.
This issue can be resolved by adding the `BASE_URL` to the links used to
call the CSS and JS files.
By doing so, the browser will be able to locate and load the required
resources, ensuring that the web page displays correctly.

Signed-off-by: Memet Zx <[email protected]>
---
 src/components/head.php | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/components/head.php b/src/components/head.php
index 4a5c238..f443eaa 100644
--- a/src/components/head.php
+++ b/src/components/head.php
@@ -1,10 +1,10 @@
 <head>
-<meta charset="utf-8">
-<meta name="viewport" content="width=device-width, initial-scale=1.0">
-<title><?= e($opt["title"] ?? "") ?> - <?= e(APP_TITLE); ?></title>
-<?php require __DIR__."/meta.php"; ?>
-<!-- styles -->
-<link rel="stylesheet" href="assets/css/style.css">
-<!-- script -->
-<script async type="module" src="assets/js/turbo.js"></script>
+    <meta charset="utf-8">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title><?= e($opt["title"] ?? "") ?> - <?= e(APP_TITLE); ?></title>
+    <?php require __DIR__ . "/meta.php"; ?>
+    <!-- styles -->
+    <link rel="stylesheet" href="<?= e(BASEURL); ?>/assets/css/style.css">
+    <!-- script -->
+    <script async type="module" src="<?= e(BASEURL); ?>/assets/js/turbo.js"></script>
 </head>
-- 
Memet Zx


  reply	other threads:[~2023-04-15 14:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-15 14:48 [PATCH: Website v2 0/2] Fix the formating Memet Zx
2023-04-15 14:48 ` Memet Zx [this message]
2023-04-15 14:48 ` [PATCH: Website v2 2/2] README.md: Initialize the information Memet Zx
2023-04-15 14:50 ` [PATCH: Website v2 0/2] Fix the formating Ammar Faizi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox