# Routing

In the following, we assume that your already have a web page where you want to embed the talque plugin. The serving url of you website is typically of the form

* With html extension: `https://example.com/path/to/page.html`
* No extension: `https://example.com/path/to/page`
* Directory-style with trailing slash: `https://example.com/path/to/page/`

There are three ways the talque javascript plugin can integrate itself into the url structure of your website, namely

#### Path (HTML5) routing

This is the most advanced option. Here, urls are of the most natural form

```
https://example.com/path/to/page/talk-slug/gettysburg_address
```

The downside is that it requires special configuration from your web server so that all routes matching the regular expression `https://example.com/path/to/page/[.*]` are serving the same web page.

#### Hash routing

Here, urls use the hash mark (a.k.a. pound sign) `#` to separate your website and the talque-internal identifier of the content. That is, urls can be of the forms&#x20;

```
https://example.com/path/to/page.html#talk-slug/gettysburg_address
https://example.com/path/to/page#talk-slug/gettysburg_address
https://example.com/path/to/page/#talk-slug/gettysburg_address
```

This works for any serving url and does not require any cooperation from your web server, but presents issues for link sharing and search engine indexing of your content.

#### Query parameter routing

In the final option the talque-internal identifiers are query parameters, that is, a question mark `?` is added after your website url. That is, urls can be of the forms

```
https://example.com/path/to/page.html?talk-slug=gettysburg_address
https://example.com/path/to/page?talk-slug=gettysburg_address
https://example.com/path/to/page/?talk-slug=gettysburg_address
```

Your web server might interfere with the query parameters, but typically will just ignore them on content pages. In general, this does not require any specific web server configuration. Usually, we recommend this style of urls as it is both easy to set up and works well for link sharing and search engine indexing. This is also the default.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://talque.gitbook.io/public/javascript-plugin/routing.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
