[libraries/qxmpp] docs: docs: Rename landing page to qxmpp-index.html to avoid clobbering api.kde.org's index.html
Linus Jahn <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 3112eca6d7c91e70ebe1a04ea6982e3a860eb865 by Linus Jahn.
Committed on 21/07/2026 at 11:14.
Pushed by lnj into branch 'master'.
docs: Rename landing page to qxmpp-index.html to avoid clobbering api.kde.org's index.html
On api.kde.org, DOC_DESTDIR/html is shared across every KDE project,
and index.html there is the site-wide front page generated by
kde-qdoc-common. QXmpp's own landing page was also named index.html,
so whichever project's generate_docs ran last silently overwrote the
other's index.html -- this previously replaced api.kde.org's front
page with QXmpp's landing page.
Rename QXmpp's landing page to qxmpp-index.html, matching the
<module>-index.html convention used by other KDE Frameworks. For
standalone builds (KDE_DOCS unset, so DOC_DESTDIR/html belongs to
QXmpp alone) still drop a plain redirect index.html -> qxmpp-index.html
for convenience.
M +28 -0 docs/CMakeLists.txt
M +1 -1 docs/index.qdoc
https://invent.kde.org/libraries/qxmpp/-/commit/3112eca6d7c91e70ebe1a04ea6982e3a860eb865
diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
index 22fb248f..1e85e0a0 100644
--- a/docs/CMakeLists.txt
+++ b/docs/CMakeLists.txt
@@ -30,8 +30,10 @@ endif()
# itself and doesn't accept extra environment variables.
if(DEFINED ENV{KDE_DOCS})
set(_KDE_DOCS "$ENV{KDE_DOCS}")
+ set(_QXMPP_STANDALONE_DOCS_BUILD FALSE)
else()
ecm_query_qt(_KDE_DOCS QT_INSTALL_DOCS)
+ set(_QXMPP_STANDALONE_DOCS_BUILD TRUE)
endif()
find_package(Qt6 REQUIRED COMPONENTS Tools)
@@ -82,6 +84,32 @@ add_custom_command(
VERBATIM
)
+# QXmpp's landing page is qxmpp-index.html, not index.html: on api.kde.org,
+# DOC_DESTDIR/html is shared across every KDE project, and index.html there
+# belongs to the site-wide front page (kde-qdoc-common/index.qdoc) — writing
+# our own index.html would silently clobber it depending on build order.
+# For a standalone build (KDE_DOCS unset) DOC_DESTDIR/html is ours alone, so
+# drop a plain redirect there for convenience.
+if(_QXMPP_STANDALONE_DOCS_BUILD)
+ set(_qxmpp_index_redirect "${CMAKE_CURRENT_BINARY_DIR}/index.html")
+ file(WRITE "${_qxmpp_index_redirect}"
+"<!DOCTYPE html>
+<html><head><meta charset=\"utf-8\">
+<meta http-equiv=\"refresh\" content=\"0; url=qxmpp-index.html\">
+<title>QXmpp Documentation</title>
+</head><body>
+<p>Redirecting to <a href=\"qxmpp-index.html\">QXmpp Documentation</a>...</p>
+</body></html>
+")
+ add_custom_command(
+ TARGET generate_docs_${QXMPP_TARGET}
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy "${_qxmpp_index_redirect}" "${DOC_DESTDIR}/html/index.html"
+ COMMENT "Adding index.html redirect to qxmpp-index.html for standalone build"
+ VERBATIM
+ )
+endif()
+
if(BUILD_DOCUMENTATION)
install(FILES ${DOAP_FILES} DESTINATION ${CMAKE_INSTALL_DOCDIR}/qxmpp)
endif()
diff --git a/docs/index.qdoc b/docs/index.qdoc
index b288976e..a60bf479 100644
--- a/docs/index.qdoc
+++ b/docs/index.qdoc
@@ -4,7 +4,7 @@
// SPDX-License-Identifier: CC0-1.0
/*!
-\page index.html
+\page qxmpp-index.html
\title QXmpp
\section1 Introduction