Skip to content

Commit 54929c9

Browse files
Merge pull request #75 from contributorpw/edits
webapp/responsive-meta
2 parents 448e7ea + ca58955 commit 54929c9

File tree

6 files changed

+56
-10
lines changed

6 files changed

+56
-10
lines changed

readme.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -306,16 +306,6 @@ function hash_(str, digestAlgorithm, charset) {
306306

307307
### Web application
308308

309-
#### Responsive meta tag for the webapp
310-
311-
https://plus.google.com/u/0/+MarcoColomboMow/posts/GXgRCh98HTu
312-
313-
```js
314-
HtmlService.createHtmlOutput('Hello world')
315-
//Responsive
316-
.addMetaTag('viewport', 'width=device-width, initial-scale=1');
317-
```
318-
319309
#### Google Site Verification for the webapp
320310

321311
```js
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"webapp": {
3+
"executeAs": "USER_DEPLOYING",
4+
"access": "ANYONE_ANONYMOUS"
5+
},
6+
"runtimeVersion": "V8"
7+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "webapp",
3+
"src": []
4+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* exported doGet */
2+
/**
3+
* Using responsive meta tags for the webapp
4+
*/
5+
function doGet() {
6+
const htmlContent = 'Hello world!';
7+
return HtmlService.createHtmlOutput(htmlContent).addMetaTag(
8+
'viewport',
9+
'width=device-width, initial-scale=1'
10+
);
11+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: 'A responsive webapp'
3+
date: '2021-06-07'
4+
description: 'Using responsive meta tags for an apps script webapp'
5+
tags: ['webapp']
6+
categories: ['snippets']
7+
images: ['./snippets/webapp/responsive-meta/screenshot.png']
8+
---
9+
10+
{{< toc >}}
11+
12+
## Using responsive meta tags for an apps script webapp
13+
14+
![Snippet of Using responsive meta tags for an apps script webapp](./screenshot.png)
15+
16+
To display a responsive webapp on different devices you can use the `addMetaTag` method
17+
18+
### Snippet
19+
20+
- {{< externalLink >}}
21+
- {{< commentLink >}}
22+
- {{< scrvizLink >}}
23+
24+
{{< codeFromFile "index.js" >}}
25+
26+
### Run it
27+
28+
For custom run you need to deploy a webapp with the current `doGet` function.
29+
30+
### Manifest
31+
32+
{{< codeFromFile "appsscript.json" >}}
33+
34+
{{< clipboard >}}
31 KB
Loading

0 commit comments

Comments
 (0)