Skip to content

Commit 2131032

Browse files
committed
Factor out common hbs partial for the SPARQL preamble (#455)
1 parent 3de323f commit 2131032

File tree

5 files changed

+11
-3
lines changed

5 files changed

+11
-3
lines changed

frontend/src/global/hbsPartials.ts

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Handlebars from 'handlebars/dist/handlebars.runtime';
2+
3+
import sparqlPreamble from '../sparql/query-templates/preamble-template';
4+
5+
Handlebars.registerPartial('sparqlPreamble', sparqlPreamble);

frontend/src/main.ts

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import './global/scroll-easings';
77
import { i18nPromise } from './global/i18n';
88
import './global/internalLinks';
99
import './global/hbsHelpers';
10+
import './global/hbsPartials';
1011
import user from './global/user';
1112
import { prefetch } from './global/ld-store';
1213
import './global/item-cache';

frontend/src/sparql/query-templates/items-for-source-template.hbs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
{{#each namespaces}}
2-
PREFIX {{label}}: <{{prefix}}>
3-
{{/each}}
1+
{{>sparqlPreamble}}
42
PREFIX schema: <http://schema.org/>
53
PREFIX oa: <http://www.w3.org/ns/oa#>
64
CONSTRUCT {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{#each namespaces}}
2+
PREFIX {{label}}: <{{prefix}}>
3+
{{/each}}

frontend/src/test-util.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Events } from 'backbone';
66

77
import Store from './common-rdf/store';
88
import './global/hbsHelpers';
9+
import './global/hbsPartials';
910
import { i18nPromise } from './global/i18n';
1011

1112
/**

0 commit comments

Comments
 (0)