Skip to content

feat: preserve formatting on independent wikis #18

@kiyarose

Description

@kiyarose

Problem

Currently, when Flean redirects to an independent wiki, it does not preserve formatting and simply sends users to the main page of the target wiki. However, the Indie Wiki Buddy sources file includes detailed mappings for both origin and destination URLs, including content and main page paths, which would allow us to properly redirect to the corresponding page—preserving the intent and specificity of the original request.

Example (from sources file):

{
  "id": "en-100orangejuice",
  "origins_label": "100% Orange Juice Fandom Wikis",
  "origins": [
    {
      "origin": "100% Orange Juice Fandom Wiki",
      "origin_base_url": "100orangejuice.fandom.com",
      "origin_content_path": "/wiki/",
      "origin_main_page": "100%_Orange_Juice_Wiki"
    },
    {
      "origin": "100% Orange Juice Fandom Wiki (Archive)",
      "origin_base_url": "onehundredpercentorangejuice-archive.fandom.com",
      "origin_content_path": "/wiki/",
      "origin_main_page": "100%_Orange_Juice_Wiki"
    }
  ],
  "destination": "100% Orange Juice Wiki",
  "destination_base_url": "orangejuice.wiki",
  "destination_platform": "mediawiki",
  "destination_icon": "100orangejuicewiki.png",
  "destination_main_page": "100%_Orange_Juice_Wiki",
  "destination_search_path": "/w/index.php",
  "destination_content_path": "/wiki/"
}

Proposal

  • Enhance the redirection logic so that when redirecting to an independent wiki, the code:
    • Looks up the destination path and formatting information from the Indie Wiki Buddy sources file.
    • Attempts to map the full original URL (including the original content page or subpage) to its corresponding path at the destination.
  • This would allow users to be directly sent to the correct wiki article, not just the main page.

Acceptance Criteria

  • When the redirect matches an independent wiki that contains rich path info in the source data, the code uses that to build a destination URL that points to the correctly formatted page.
  • If the mapping cannot resolve to a specific page, default fallback to existing behavior (main page).

Rationale

This improves user experience by landing users directly on the relevant article in independent wikis, rather than forcing them to navigate from the main page. The source data is already available and supports this logic improvement.

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

Status

Archived

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions