Skip to content

Commit f625a75

Browse files
Jared KobosGitHub Enterprise
authored andcommitted
Dynamic iframe rebuilt (linode#226)
* Dynamic iframe url - Adds a config.toml for each of our environments (production, staging, testing, development) - api.html reads an environment variable from the current environment to set the docs iframe url. - To test, run hugo with the corresponding environment flag, e.g.: hugo server --environment staging * Rebuild dynamic iframe url PR
1 parent cd66e97 commit f625a75

File tree

7 files changed

+12
-4
lines changed

7 files changed

+12
-4
lines changed

config.toml renamed to config/_default/config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ url = "/changelog/"
4545
date_format = "Monday, January 2, 2006"
4646
copyright = "Copyright (c) 2018, Linode LLC"
4747
logo = "/img/linode-logo_standard_light_medium.png"
48+
docsUrl="https://developers.linode.com/api/docs/v4"
4849

4950
[params.truncate]
5051
enable = true

config/development/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[params]
2+
docsUrl="https://developers.dev.linode.com/api/docs/v4"
3+

config/production/config.toml

Whitespace-only changes.

config/staging/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[params]
2+
docsUrl="https://developers-staging.linode.com/api/docs/v4"

config/testing/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[params]
2+
docsUrl="https://developers.testing.linode.com/api/docs/v4"

gulpfile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ const gulp = require('gulp');
22
const shell = require('gulp-shell');
33
var runSequence = require('run-sequence');
44

5-
gulp.task('get-base-theme',
5+
gulp.task('get-base-theme',
66
shell.task(
77
'./dev_setup.sh',
88
)
99
);
1010

11-
gulp.task('start-theme-tools',
11+
gulp.task('start-theme-tools',
1212
shell.task(
1313
'cd themes/dlc && yarn && gulp watch'
1414
)
1515
);
1616

17-
gulp.task('start-hugo',
17+
gulp.task('start-hugo',
1818
shell.task(
1919
'hugo server -D'
2020
)

themes/dlc/layouts/api/api.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{{ define "main" }}
2-
<iframe src="https://developers.linode.com/api/docs/v4" style="width: 100%; height: calc(100vh - 65px); border: none; position: fixed; top: 65px; width: 100%; background: #fff"></iframe>
2+
<iframe src="{{ .Site.Params.docsUrl }}" style="width: 100%; height: calc(100vh - 65px); border: none; position: fixed; top: 65px; width: 100%; background: #fff"></iframe>
33
{{ end }}

0 commit comments

Comments
 (0)