-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcode.gs
33 lines (25 loc) · 765 Bytes
/
code.gs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/**
* this file executes the doGet function for our web app
* see https://developers.google.com/apps-script/guides/web
* and provides some utility functions to help organize things
*/
function doGet() {
const htmlTemplate = HtmlService.createTemplateFromFile('index');
return htmlTemplate.evaluate();
}
/**
* function to include external files in html
*/
function include(filename) {
return HtmlService.createHtmlOutputFromFile(filename).getContent();
}
/**
* function to render external files in html
*/
function render(filename, attributes = {}) {
let template = HtmlService.createTemplateFromFile(filename);
for (const k of Object.keys(attributes)) {
template[k] = attributes[k]
}
return template.evaluate().getContent();
}