ebt-vue
Version:
Vue/Vuetify component library for EBT-Site
77 lines (56 loc) • 2.8 kB
Markdown
---
title: EBT-Vue v1.9 (segment links)
description: Reference sutta segments with EBT-Site segment links
img: ben-white-vtCBruWoNqo-unsplash.png
alt: Generic picture of linked hands
---
EBT-Vue v1.9 introduces:
* _segment links_ are URLs that take the user to a specific segment of a sutta.
### Segment links
We often wish to reference a specific segment of a sutta
using SuttaCentral sutta/segment identifiers.
A segment link is an EBT-Site URL that leads to a highlighted sutta segment.
For example:
> [https://ebt-site.github.io/ebt-vue/suttas#mn1/en/sujato:2.2](https://ebt-site.github.io/ebt-vue/suttas#mn1/en/sujato:2.2)
Segment links rely on _URL fragments_.
A URL fragment is the part of a URL that starts with `#`
(e.g., `#mn1/en/sujato:2.2`).
The URL fragment of a segment link provides the following information:
* sutta identifier (e.g., "mn1", "an1.1-10")
* language (e.g., "en", "de")
* translator (e.g., "sujato", "sabbamitta", "ms")
* segment number (e.g., "2.2")
The translator can be omitted:
> [https://ebt-site.github.io/ebt-vue/suttas#mn1/en:2.2](https://ebt-site.github.io/ebt-vue/suttas#mn1/en:2.2)
The language can also be omitted.
Links without language and translator are actually quite useful--they let
the viewer automatically see the referenced segment in the native language.
The default language is determined from the language setting.
> [https://ebt-site.github.io/ebt-vue/suttas#mn1:2.2](https://ebt-site.github.io/ebt-vue/suttas#mn1:2.2)
### Relative vs. absolute links
The most general form of a link is the _absolute link_,
which includes the website name.
Absolute links are ideal for links posted to external forums such as
[Discuss & Discover](https://discourse.suttacentral.net/).
An absolute link will take the user to a specific website, sutta and segment:
> [https://ebt-site.github.io/ebt-vue/suttas#mn1:2.2](https://ebt-site.github.io/ebt-vue/suttas#mn1:2.2)
_Relative links_ are the best practice for sutta references within an EBT-Site.
Absolute links are long and brittle.
If the link is part of an EBT-Site wiki page,
just use _relative links_ for sutta references.
Relative links are compact
and will take the user to the current website, sutta and segment.
Relative links will work even when copied for use in wiki pages
of any other EBT-Site:
> [/suttas#mn1:2.2](/suttas#mn1:2.2)
Clicking the above link will show:
<img src="mn1_2.2.png" class="ebt-image"/>
### Search
The URL fragment also is used for _search_.
Following the sutta/segment identifier is an optional _query_
that starts with a "?search=".
URL fragments with a search pattern are generated automatically
when:
* clicking "Inspire Me"
* clicking on an example link
> [/suttas#mn1:2.2?search=root+of+suffering](/suttas#mn1:2.2?search=root+of+suffering)