حسنًا، اعتقد @hellekin أن هذا يستحق موضوعًا خاصًا به. لست متأكدًا تمامًا من أنه جاهز لذلك، لكن ها هو. سألقي نظرة على الأمور في بداية الأسبوع القادم وسأحاول التأكد من أنه يبدو شيئًا يمكن للآخرين استخدامه حقًا. ![]()
كما قال:
حسنًا، اعتقد @hellekin أن هذا يستحق موضوعًا خاصًا به. لست متأكدًا تمامًا من أنه جاهز لذلك، لكن ها هو. سألقي نظرة على الأمور في بداية الأسبوع القادم وسأحاول التأكد من أنه يبدو شيئًا يمكن للآخرين استخدامه حقًا. ![]()
كما قال:
@pfaffman I tried to use the following setup:
home_url_override to TransHack ·Xist·nce…
location = /TransHack_·Xist·nce… {
default_type text/html;
alias /srv/www/zoethical.org/thx/home.html;
}
Calling the file directly works, but calling https://thx.zoethical.org breaks. As I noticed a check on permalinks, I tried to add a permalink for /. But it did not work either. Might this be an issue with cache?
FYI, here is the content of the home.html file:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title> TransHack ·Xist·nce… </title>
<link rel="stylesheet" href="/thx.css">
</head>
<body class="thx home">
<header>
<h1>THX</h1>
</header>
<section id="agora">
<h2><a href="https://thx.zoethical.org/c/agora/1">Agora</a></h2>
<d-topics-list discourse-url="https://thx.zoethical.org" per-page="5" category="1"></d-topics-list>
</section>
<section id="fonderie-de-fiction">
<h2><a href="https://thx.zoethical.org/c/fonderie-de-fiction/7">Fonderie de fiction</a></h2>
<d-topics-list discourse-url="https://thx.zoethical.org" per-page="5" category="7"></d-topics-list>
</section>
<script src="https://thx.zoethical.org/javascripts/embed-topics.js"></script>
</body>
</html>
Edit: I guess it might be due to the fact the instance requires login (SSO), then there’s a dysfunction in this case. I might be willing to make more tests including opening the instance a bit more. After rendering the site public, I still get " Oops! That page doesn’t exist or is private." when hitting the homepage. Any idea why?
Is the home page you’re setting on your discourse site? I think you want to put just the url starting with the /.
Oh, so the file should be the default – usually index.html?
Indeed it works! The component expects the URL to be an index file, right?
I simply had to rename my home.html to index.html and change the Nginx configuration to:
# more config...
root /srv/www/zoethical.org/thx;
index index.html; # <- this is important
location = /TransHack_·Xist·nce… {
default_type text/html;
alias /srv/www/zoethical.org/thx/index.html; # <- and matches
}
location / {
# nginx magic to try the local file before proxying...
try_files $uri $uri/ $uri.html @discourse;
}
location @discourse {
# normal discourse proxy
}
If you’re using a static page on the same site as the Discourse instance, make sure your Web server reads the static file(s) – e.g., related CSS – before proxying the requests to the Discourse. Tadaa!
Thank you @pfaffman!
في الواقع، لا يزال هناك خطأ: على الرغم من أن استدعاء عنوان URL https://thx.zoethical.org يعمل من الخارج، إلا أن النقر على الشعار داخل Discourse لا يؤدي إلى إعادة توجيه الصفحة المُعدّلة. لاحظت وجود فحص للروابط الدائمة (permalink)، لذا جربت عدة خيارات، وجميعها فشلت:
https://thx.zoethical.org إلى /index.htmlhttps://thx.zoethical.org إلى /TransHack_·Xist·nce…/index.html إلى /TransHack_·Xist·nce…/TransHack_·Xist·nce… في إعدادات الواجهة الأماميةcustom_url وتوجيهه إلى عنوان URL خارجيأعتقد أن المشكلة ناتجة عن أن السكربت لا يحاول إعادة تحميل التطبيق بالكامل عند النقر على الشعار، بل يتوقع أن يكون الرابط الداخلي مرفقًا بالمسار العلوي.
أتوقع أنه عندما يشير إما homepage_url_override أو رابط دائم (مثل custom_url) إلى عنوان URL مطلق، يتم إعادة تحميل الصفحة بالكامل.