Skip to content

replace relative paths "/wiki/" with $wgScriptPath #46

Description

@simontaurus
  • Option1: $wgArticlePath for direct page links. May or may not contain query params, e.g. /wiki/ vs /w/index.php?title=
  • Option2: $wgScript to build a query like $wgScript + ?title=<title>
  • Option3: $wgScriptPath for $wgScriptPath + /index.php or /api.php + query string

js mw.config see https://www.mediawiki.org/wiki/Manual:Interface/JavaScript#mw.config or directly use mw.util.getUrl( 'MediaWiki:Foo.css', { action:'raw' } (see https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.util)

Also needs replacement in schemas:

{
    "@context": [
        "/wiki/Category:Item?action=raw&slot=jsonschema"
    ],
    "allOf": [
        {
            "$ref": "/wiki/Category:Item?action=raw&slot=jsonschema"
        }
    ]
}

to

{
    "@context": [
        "./Category:Item?action=raw&slot=jsonschema"
    ],
    "allOf": [
        {
            "$ref": "./Category:Item?action=raw&slot=jsonschema"
        }
    ]
}

(requires pretty urls, "./" is required because ":" is not allowed in the first path segment)
or

{
    "@context": [
        "./index.php?title=Category:Item&action=raw&slot=jsonschema"
    ],
    "allOf": [
        {
            "$ref": "./index.php?title=Category:Item&action=raw&slot=jsonschema"
        }
    ]
}

see also: https://stackoverflow.com/questions/24028561/relative-path-in-html

ToDo:
replace all "/w/api..." with mw.config.get("wgScriptPath") + "/api..."

replace all "/wiki/title" with mw.util.getUrl("title")

  • fix extension MwJson
  • fix extension OpenSemanticLab
  • fix extension InteractiveSemanticGraph
  • fix editor extensions
  • fix OpenSemanticWorld-Schemas (minor, already handled by bundler in MwJson)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions