Skip to content
This repository was archived by the owner on Jul 21, 2019. It is now read-only.

Commit a83acb4

Browse files
authored
Merge pull request #571 from devopsdays/add-form-shortcode#230
Add shortcode for google forms
2 parents 2f9cb6f + 03e9c48 commit a83acb4

3 files changed

Lines changed: 17 additions & 5 deletions

File tree

REFERENCE.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
 [Talk Page Fields](#talk-page-fields)
2424
 [Speaker Page Fields](#speaker-page-fields)
2525
 [Blog Post Fields](#blog-post-fields)
26+
[Shortcodes](#shortcodes)
27+
 [google_form](#google_form)
2628

2729
<!-- /MDTOC -->
2830

@@ -277,3 +279,13 @@ Pages of the type `speaker` have a few additional frontmatter elements available
277279
| `Author` | No | The name of the person who wrote the blog post. | "Matt Stratton" |
278280
| `title` | Yes | The title for the blog post. | "Chicago 2016 In Review" |
279281
| `sharing_image` | No | The image to use for social sharing. This is a path relative to the `static` directory. | "img/blog/chicago-2016-sharing.jpg" |
282+
283+
## Shortcodes
284+
285+
Shortcodes can be used in any of your content (i.e., ".md" files. They provide easy ways to add content without having to write a lot of coding.)
286+
287+
### google_form
288+
This shortcode allows for the embedding of a Google form on a page, in a manner that maintains the responsive, mobile-friendly design of the site. To use it, you only need the URL of your form (not the full embed code) and enter this on your page (substituting the proper URL):
289+
```
290+
{{< google_form "https://docs.google.com/forms/d/e/1FAIpQLScvv-ty_wEBlYkJaEC1OU0qqqbIHjf9JVa-Ptdo5TcHqz5EDA/viewform?usp=sf_link" >}}
291+
```

exampleSite/content/events/2017-ponyville/registration.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
Title = "Registration"
33
Type = "event"
44
+++
5+
<h2>Registration</h2>
56

6-
<div style="width:100%; text-align:left;">
7-
8-
Embed registration iframe/link/etc.
9-
</div></div>
10-
</div>
7+
{{< google_form "https://docs.google.com/forms/d/e/1FAIpQLScvv-ty_wEBlYkJaEC1OU0qqqbIHjf9JVa-Ptdo5TcHqz5EDA/viewform?usp=sf_link" >}}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<div style="width:100%; text-align:left;">
2+
<iframe src="{{ .Get 0 }}" width="100%" height="800px" frameborder="0" marginheight="0" marginwidth="0">Loading...</iframe>
3+
</div>

0 commit comments

Comments
 (0)