diff options
author | zwbetz <zwbetz@gmail.com> | 2019-12-11 06:30:01 +0300 |
---|---|---|
committer | zwbetz <zwbetz@gmail.com> | 2019-12-11 06:30:01 +0300 |
commit | a9ad566b6c6a46f7a06e6e18be30030d45e7725c (patch) | |
tree | 1c382d4c52fb621a85266ca06511e6f6afdd51fc | |
parent | 6804562e619c03e4046caaf7d8e3cf7fca6bf897 (diff) | |
parent | 341eb1eb1c90b09f33d46104fa2477b80eedc83d (diff) |
Merge branch 'master' of github.com:zwbetz-gh/minimal-bootstrap-hugo-theme
-rw-r--r-- | README.md | 22 | ||||
-rw-r--r-- | layouts/_default/baseof.html | 3 | ||||
-rw-r--r-- | layouts/partials/mastodon-js.html | 3 | ||||
-rw-r--r-- | layouts/shortcodes/mastodon.html | 9 |
4 files changed, 28 insertions, 9 deletions
@@ -12,7 +12,6 @@ A minimal hugo theme made with bootstrap that focuses on content readability. - [Updating](#updating) - [Run example site](#run-example-site) - [Configuration](#configuration) -- [Blog post folder](#blog-post-folder) - [Favicons](#favicons) - [Override](#override) - [Homepage example](#homepage-example) @@ -23,6 +22,7 @@ A minimal hugo theme made with bootstrap that focuses on content readability. - [`imgAbs`](#imgabs) - [`imgRel`](#imgrel) - [`imgProc`](#imgproc) + - [`mastodon`](#mastodon) - [Getting help](#getting-help) - [Stackbit Deploy](#stackbit-deploy) @@ -62,12 +62,6 @@ hugo server --themesDir ../.. Copy the `config.toml` from the [`exampleSite`](https://github.com/zwbetz-gh/minimal-bootstrap-hugo-theme/tree/master/exampleSite), then edit as desired. -## Blog post folder - -This theme expects your _posts_ to be under the `post` folder. - -If you want to use a different folder, then override the [`post-list.html`](https://github.com/zwbetz-gh/minimal-bootstrap-hugo-theme/blob/master/layouts/partials/post-list.html) partial and replace `post` with the name of your folder. - ## Favicons Upload your image to [RealFaviconGenerator](https://realfavicongenerator.net/) then copy-paste the generated favicon files under `static`. @@ -157,6 +151,18 @@ class="some-class" style="some-style" >}} ``` +### `mastodon` + +This will embed a toot in an `iframe`. + +These arguments are optional: `width`, `height`. + +``` +{{% mastodon +status="https://mastodon.social/@kevingimbel/100700713283716694" +width="1000" height="500" %}} +``` + ## Getting help If you run into an issue that isn't answered by this documentation or the [`exampleSite`](https://github.com/zwbetz-gh/minimal-bootstrap-hugo-theme/tree/master/exampleSite), then visit the [Hugo forum](https://discourse.gohugo.io/). The folks there are helpful and friendly. **Before** asking your question, be sure to read the [requesting help guidelines](https://discourse.gohugo.io/t/requesting-help/9132). Feel free to tag me in your question, my forum username is [@zwbetz](https://discourse.gohugo.io/u/zwbetz/summary). @@ -165,4 +171,4 @@ If you run into an issue that isn't answered by this documentation or the [`exam This theme is ready to import into Stackbit. This theme can be deployed to Netlify and you can connect any headless CMS including Forestry, NetlifyCMS, DatoCMS, or Contentful. -[![Create with Stackbit](https://assets.stackbit.com/badge/create-with-stackbit.svg)](https://app.stackbit.com/create?theme=https://github.com/zwbetz-gh/minimal-bootstrap-hugo-theme)
\ No newline at end of file +[![Create with Stackbit](https://assets.stackbit.com/badge/create-with-stackbit.svg)](https://app.stackbit.com/create?theme=https://github.com/zwbetz-gh/minimal-bootstrap-hugo-theme) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 19302ce..8e684cf 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -14,7 +14,8 @@ {{ partial "bootstrap-js.html" . }} {{ partial "google-analytics-async.html" . }} + {{ partial "mastodon-js.html" . }} {{ partial "cookie-consent.html" . }} </body> -</html>
\ No newline at end of file +</html> diff --git a/layouts/partials/mastodon-js.html b/layouts/partials/mastodon-js.html new file mode 100644 index 0000000..ac77131 --- /dev/null +++ b/layouts/partials/mastodon-js.html @@ -0,0 +1,3 @@ +{{ if ($.Page.Scratch.Get "include_mastodon") "true" }} +<script src="https://mastodon.social/embed.js" async="async"></script> +{{ end }} diff --git a/layouts/shortcodes/mastodon.html b/layouts/shortcodes/mastodon.html new file mode 100644 index 0000000..71060e0 --- /dev/null +++ b/layouts/shortcodes/mastodon.html @@ -0,0 +1,9 @@ +{{ .Page.Scratch.Set "include_mastodon" true }} +{{ $width := .Get "width" | default "400" }} +{{ $height := .Get "height" | default "333"}} +{{ $status := .Get "status" | default "false" }} + +{{ if eq ($status) "false" }} +{{ else }} +<iframe src= "{{ $status }}/embed" class="mastodon-embed" style="max-width: 100%; border: 0" width="{{ $width }}" height="{{ $height }}"></iframe> +{{ end }}
\ No newline at end of file |