FHIR Chat · site variable · IG creation

Stream: IG creation

Topic: site variable


view this post on Zulip Jens Villadsen (Feb 13 2019 at 16:03):

There seems to be a minor issue with the site.data.fhir.path variable ... or at least how it is used. Eg. my template (which I can imagine does not differ from most other IG templates regarding structuredefinitions) the line

<a href="{{site.data.fhir.path}}profiling.html#representation">Description of Profiles, Differentials,
                Snapshots, and how the XML and JSON presentations work</a>.

gets resolved to (when running locally) http://localhost:4000/hl7.org/fhir/STU3/profiling.html#representation which is not really working - and I guess its not the intention that it should work that way - ... or is it? Also, the link to the '?' icon (help16.png) on the summary tables does not resolve. When it should have been looking locally, it instead looks at http://localhost:4000/http:/hl7.org/fhir/STU3/help16.png ... which really does not make sense

Am I doing something wrong here, or is there room for improvement?

view this post on Zulip Eric Haas (Feb 13 2019 at 16:57):

here are all the Jekyll site variables implemented; https://healthedata1.github.io/IG-Template2/index.html#variables

view this post on Zulip Eric Haas (Feb 13 2019 at 17:00):

locally I get:

path : path to the main FHIR specification (defined in ig.json)- {{site.data.fhir.path}} = http://hl7.org/fhir/STU3/

view this post on Zulip Eric Haas (Feb 13 2019 at 17:03):

it is defined in the ig.json file as path.specification here:

...
"paths": {
    "output": "docs",
    "specification": "http://hl7.org/fhir/STU3",
    "qa": "generated_output/qa",
...

view this post on Zulip Eric Haas (Feb 13 2019 at 17:09):

I don't run Jekyll on a localhost so I don't know how it behaves. I have issue with some pngs in the past as well - I don't understand that part very well

view this post on Zulip Jens Villadsen (Feb 13 2019 at 17:13):

I've got specification set to http:/hl7.org/fhir/STU3 ... yet {{site.data.fhir.path}} still resolves to localhost

view this post on Zulip Eric Haas (Feb 13 2019 at 17:21):

Since Jekyll builds a set of static pages they all use a static base path path e.g. locally is my file:///Users/ehaas/Documents/FHIR/IG-template2/docs/

and on the web when using git pages its... 'https://healthedata1.github.io/[repo]/1

view this post on Zulip Eric Haas (Feb 13 2019 at 17:22):

I remember some discussions on SO re using Jekyll on localhost and having to resolve the base path... is a pain in the a**

view this post on Zulip Eric Haas (Feb 13 2019 at 17:22):

https://stackoverflow.com/questions/27386169/change-site-url-to-localhost-during-jekyll-local-development

view this post on Zulip Jens Villadsen (Feb 13 2019 at 17:25):

Regarding the serving: I use both jekyll and python for serving the files ... same result ... - this bug is happening during generation.

view this post on Zulip Jens Villadsen (Feb 13 2019 at 17:26):

I expected that site.data.fhir.path was mapping to the site set in specification

view this post on Zulip Jens Villadsen (Feb 13 2019 at 17:26):

as stated in the doc

view this post on Zulip Jens Villadsen (Feb 13 2019 at 17:30):

thats weird ...
<a href=" {{ site.data.fhir.path }}/profiling.html#representation">{{ site.data.fhir.path }}Description of Profiles, Differentials, Snapshots, and how the XML and JSON presentations work</a>.
ends up being

http:/hl7.org/fhir/STU3/Description of Profiles, Differentials, Snapshots, and how the XML and JSON presentations work.

view this post on Zulip Jens Villadsen (Feb 13 2019 at 17:31):

but the link is http://localhost:4000/hl7.org/fhir/STU3//profiling.html#representation

view this post on Zulip Eric Haas (Feb 13 2019 at 17:31):

it is setting it up correctly...

baseurl = http://localhost:4000/ site.data.fhir.path = hl7.org/fhir/STU3/ local path =profiling.html#representation

view this post on Zulip Eric Haas (Feb 13 2019 at 17:32):

your baseurl is shifting . the ig is expecting it to be /

view this post on Zulip Eric Haas (Feb 13 2019 at 17:32):

see the SO discussion. I could never figure this out btw

view this post on Zulip Jens Villadsen (Feb 13 2019 at 17:35):

site.data.fhir.path is an absolute url

view this post on Zulip Jens Villadsen (Feb 13 2019 at 17:35):

it aint relative

view this post on Zulip Jens Villadsen (Feb 13 2019 at 17:35):

regardless of where the site it built, it should stay the same

view this post on Zulip Eric Haas (Feb 13 2019 at 17:53):

I don't think that is how Jekyll works.

view this post on Zulip Jens Villadsen (Feb 13 2019 at 17:55):

variable substitution .... thats all im asking ... and jekyll can do that

view this post on Zulip Eric Haas (Feb 13 2019 at 17:57):

maybe this will help... https://byparker.com/blog/2014/clearing-up-confusion-around-baseurl/

view this post on Zulip Jens Villadsen (Feb 13 2019 at 18:05):

I'm not confused about siteurl or baseurl ... Im just expecting simple variable substitution

view this post on Zulip Jens Villadsen (Feb 13 2019 at 18:05):

and the 'specification' is just set as a variable, right? and it should be resolveable under site.data.fhir.path

view this post on Zulip Eric Haas (Feb 13 2019 at 18:51):

yes

view this post on Zulip Eric Haas (Feb 13 2019 at 18:52):

@Josh Mandel do you understand this issue and whether is a Jekyll thing or specific to ig-pub?

view this post on Zulip Jens Villadsen (Feb 13 2019 at 21:42):

And it is only a problem when injecting into link places .... eg. hrefs

view this post on Zulip Jens Villadsen (Feb 14 2019 at 08:29):

@Lloyd McKenzie

view this post on Zulip Jens Villadsen (Feb 14 2019 at 09:28):

I've also found that when adding eg. ![alt text](data/kitten.jpg) to the description field in a structuredef, the link that is inserted is http://localhost:4000/http:/hl7.org/fhir/STU3/data/kitten.jpg - where it should have resolved to localhost:4000/data/kitten.jpg

view this post on Zulip Josh Mandel (Feb 14 2019 at 11:13):

I guess its not the intention that it should work that way - ... or is it?

I'm not sure what @Grahame Grieve's intention was, assuming this site.data.fhir object is defined as part of the standard template?

view this post on Zulip Lloyd McKenzie (Feb 14 2019 at 15:04):

It's being set in temp/pages/_data/fhir.json. What's appearing there?

view this post on Zulip Jens Villadsen (Feb 14 2019 at 16:06):

{
  "path": "http:/hl7.org/fhir/STU3/",
  "canonical": "http://trifork.dk/fhir",
  "igId": "dk-tm",
  "igName": "eHealth Infrastructure",
  "igVer": "0.6.0",
  "errorCount": 256,
  "version": "3.0.1",
  "revision": "11917",
  "versionFull": "3.0.1-11917",
  "toolingVersion": "4.0.0",
  "toolingRevision": "3",
  "toolingVersionFull": "4.0.0 (3)",
  "totalFiles": 61,
  "processedFiles": 145,
  "genDate": "Thu, Feb 14, 2019 17:04+0100",
  "ig": {
    "id": "dk-tm",
    "name": "eHealth Infrastructure",
    "url": "http://trifork.dk/fhir/ImplementationGuide/dk-tm",
    "version": "0.6.0",
    "status": "draft",
    "experimental": true,
    "publisher": "Systematic | Trifork",
    "contact": [
      {
        "telecom": [
          "http://ehealth.sundhed.dk"
        ]
      }
    ],
    "description": "The Danish eHealth Infrastructure Implementation Guide defines a set of FHIR profiles with extensions and bindings needed to create interoperable, quality-focused applications.",
    "fhirVersion": "3.0.1"
  }
}

view this post on Zulip Lloyd McKenzie (Feb 14 2019 at 16:14):

Then {{site.data.fhir.path}} should always be evaluating to "http:/hl7.org/fhir/STU3/". If it's not, that's some weird Jekyll thing. (Though I'll note that the URL is wrong - should be two slashes after the http.)

view this post on Zulip Jens Villadsen (Feb 14 2019 at 16:15):

That single '/' could be the cause of many issues

view this post on Zulip Jens Villadsen (Feb 14 2019 at 16:16):

If jekyll reverts that to '/' and remove the http part because the protocol stuff is wrong - that would explain the relative links that looks like localhost:9000/hl7.org/fhir/stu3 ....

view this post on Zulip Jens Villadsen (Feb 14 2019 at 16:19):

hmmm .... so guess who's the fool now ... It was stated like that in the ig.json ...

view this post on Zulip Jens Villadsen (Feb 14 2019 at 16:20):

ahem ....

view this post on Zulip Jens Villadsen (Feb 14 2019 at 16:20):

sry

view this post on Zulip Jens Villadsen (Feb 14 2019 at 16:21):

everything seems to work like a charm :)


Last updated: Apr 12 2022 at 19:14 UTC