Skip to content

Commit

Permalink
updated urls to respect baseurl in config
Browse files Browse the repository at this point in the history
  • Loading branch information
HassanAkbar authored and ronaldtse committed Mar 20, 2024
1 parent 06dba8d commit ee867c6
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 24 deletions.
10 changes: 5 additions & 5 deletions _includes/concept-api-links.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,38 @@
{%- if json_url %}
<section class="field json">
<p class="field-name">JSON</p>
<p class="field-value"><a href="{{ json_url }}">{{ json_url }}</a></p>
<p class="field-value"><a href="{{ json_url | relative_url }}">{{ json_url | relative_url }}</a></p>
</section>
{% endif -%}

{%- assign yaml_url = page.representations.yaml.url -%}
{%- if yaml_url %}
<section class="field yaml">
<p class="field-name">YAML</p>
<p class="field-value"><a href="{{ yaml_url }}">{{ yaml_url }}</a></p>
<p class="field-value"><a href="{{ yaml_url | relative_url }}">{{ yaml_url | relative_url }}</a></p>
</section>
{% endif -%}

{%- assign json_url = page.representations.jsonld.url -%}
{%- if json_url %}
<section class="field json">
<p class="field-name">SKOS in JSON-LD</p>
<p class="field-value"><a href="{{ json_url }}">{{ json_url }}</a></p>
<p class="field-value"><a href="{{ json_url | relative_url }}">{{ json_url | relative_url }}</a></p>
</section>
{% endif -%}

{%- assign ttl_url = page.representations.turtle.url -%}
{%- if ttl_url %}
<section class="field ttl">
<p class="field-name">SKOS in RDF</p>
<p class="field-value"><a href="{{ ttl_url }}">{{ ttl_url }}</a></p>
<p class="field-value"><a href="{{ ttl_url | relative_url }}">{{ ttl_url | relative_url }}</a></p>
</section>
{% endif -%}

{%- assign tbx_url = page.representations.tbx.url -%}
{%- if tbx_url %}
<section class="field tbx">
<p class="field-name">TBX-ISO-TML</p>
<p class="field-value"><a href="{{ tbx_url }}">{{ tbx_url }}</a></p>
<p class="field-value"><a href="{{ tbx_url | relative_url }}">{{ tbx_url | relative_url }}</a></p>
</section>
{% endif -%}
16 changes: 8 additions & 8 deletions _includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@

<title>{% include title.html %}</title>

<link rel="icon" type="image/png" href="/images/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="/images/android-chrome-192x192.png" sizes="192x192" />
<link rel="icon" type="image/png" href="/images/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/png" href="/images/favicon-16x16.png" sizes="16x16" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="icon" type="image/png" href="{{ '/images/favicon-32x32.png' | relative_url }}" sizes="32x32" />
<link rel="icon" type="image/png" href="{{ '/images/android-chrome-192x192.png' | relative_url }}" sizes="192x192" />
<link rel="icon" type="image/png" href="{{ '/images/favicon-96x96.png' | relative_url }}" sizes="96x96" />
<link rel="icon" type="image/png" href="{{ '/images/favicon-16x16.png' | relative_url }}" sizes="16x16" />
<link rel="shortcut icon" href="{{ '/favicon.ico' | relative_url }}" />

<meta name="msapplication-TileColor" content="#ffffff" />
<meta name="msapplication-TileImage" content="/images/mstile-144x144.png" />
<meta name="msapplication-config" content="/browserconfig.xml" />
<meta name="msapplication-TileImage" content="{{ '/images/mstile-144x144.png' | relative_url }}" />
<meta name="msapplication-config" content="{{ '/browserconfig.xml' | relative_url }}" />
<meta name="theme-color" content="#ffffff" />

<link rel="canonical" href="{{ page.url | replace: 'index.html', '' | relative_url }}" />
Expand All @@ -26,7 +26,7 @@
{% if extra_stylesheets %}
{% for ss in extra_stylesheets %}
<link rel="stylesheet"
href="{{ ss.href }}"
href="{{ ss.href | relative_url }}"
{% if ss.integrity %}integrity="{{ ss.integrity }}"{% endif %}
{% if ss.crossorigin %}crossorigin="{{ ss.crossorigin }}"{% endif %}>
{% endfor %}
Expand Down
2 changes: 1 addition & 1 deletion _layouts/custom-home.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

<section class="browse-concepts">
<h2 class="section-title">Concepts</h2>
<a href="/concepts/" class="browse-concepts">Browse concepts</a>
<a href="{{ '/concepts/' | relative_url }}" class="browse-concepts">Browse concepts</a>
</section>

{{ content }}
Expand Down
4 changes: 2 additions & 2 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<header class="{% if site.has_brand_name %}brand{% endif %}">
<div class="site-headline">
<div class="parent-org-reference">
<a href="/" class="logo-link">
<a href="{{ '/' | relative_url }}" class="logo-link">
<img src="{{ site.committee.main_logo.path | relative_url }}" alt="{{ site.committee.main_logo.alt_text }}">
</a>
</div>
Expand Down Expand Up @@ -124,7 +124,7 @@ <h1 class="title">
{% if extra_scripts %}
{% for sc in extra_scripts %}
<script
src="{{ sc.src }}"
src="{{ sc.src | relative_url }}"
{% if sc.integrity %}integrity="{{ sc.integrity }}"{% endif %}
{% if sc.crossorigin %}crossorigin="{{ sc.crossorigin }}"{% endif %}></script>
{% endfor %}
Expand Down
4 changes: 2 additions & 2 deletions _pages/concept-search-index.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permalink: "/api/concept-search-index.json"
json.array! site["concepts"].each_with_index.to_a do |(concept, idx)|
json.termid concept.termid
json.term concept.data.dig("eng", "terms", 0, "designation")
json.term_url concept.url
json.term_url "#{site["baseurl"]}#{concept.url}"

json.sort_order do
json.natural idx + 1 # loop index, indexing from 1
Expand All @@ -26,7 +26,7 @@ json.array! site["concepts"].each_with_index.to_a do |(concept, idx)|

json.term localized.dig("terms", 0, "designation")
json.id localized["id"]
json.term_url "#{concept.url}#entry-lang-#{lang}"
json.term_url "#{site["baseurl"]}#{concept.url}#entry-lang-#{lang}"
json.entry_status concept["status"]
json.language_code localized["language_code"]
json.review_decision english["review_decision"]
Expand Down
7 changes: 5 additions & 2 deletions _pages/concepts-index.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ for concept_page in site["concepts"]
json.set! concept_page.termid.to_s do
json.term concept_page.data["term"]
json.termid concept_page.termid
json.set! "uri-html", concept_page.url
json.set! "uri-json", concept_json_page&.url
json.set! "uri-html", "#{site["baseurl"]}#{concept_page.url}"

if concept_json_page&.url
json.set! "uri-json", "#{site["baseurl"]}#{concept_json_page.url}"
end
end
end

Expand Down
4 changes: 2 additions & 2 deletions assets/js/concept-search-worker.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
---
importScripts('/assets/js/babel-polyfill.js');
importScripts("{{ '/assets/js/babel-polyfill.js' | relative_url }}");

const CONCEPTS_URL = '/api/concept-search-index.json';
const CONCEPTS_URL = "{{ '/api/concept-search-index.json' | relative_url }}";

/** For example:
* const LANGUAGES = [ 'eng', 'deu' ];
Expand Down
4 changes: 2 additions & 2 deletions assets/js/concept-search.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
---
(function () {

const searchWorker = new Worker('/assets/js/concept-search-worker.js');
const searchWorker = new Worker("{{ '/assets/js/concept-search-worker.js' | relative_url }}");

/** For example:
* const LANGUAGES = [ 'eng', 'deu' ];
Expand Down Expand Up @@ -231,7 +231,7 @@
);
}
headerEls.push(el('span', { key: 'title' }, 'Find a concept'));
headerEls.push(el('a', { key: 'link', href: '/concepts' }, '(browse all)'));
headerEls.push(el('a', { key: 'link', href: "{{ '/concepts' | relative_url }}" }, '(browse all)'));

var els = [
el('h2', { key: 'section-title', className: 'section-title' }, headerEls),
Expand Down

0 comments on commit ee867c6

Please sign in to comment.