Help with inserting custom Paypal Shortcode

Hi,

I’m looking for some help with inserting a paypal shortcode for a “donate” button to my Hugo page.
Here is my shortcode HTML:

# quickstart/layouts/shortcodes/ppdonate.html
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_donations" />
<input type="hidden" name="business" value="string" />
<input type="hidden" name="currency_code" value="USD" />
<input type="image" src="https://i.imgur.com/serser.png" border="0" name="submit" title="PayPal - The safer, easier way to pay online!" alt="Donate with PayPal button" />
<img alt="" border="0" src="https://www.paypal.com/en_CA/i/scr/pixel.gif" width="1" height="1" />
</form>

Here is my _index.md:
# quickstart/content/_index.md

heading: “Trauma Book Club: Book Drive”
subheading:

---
# handle: "hugo-theme-codex"

{{% ppdonate %}}

Any ideas? I’m not getting an error message, just nothing is showing up.

If you view source in your browser, you’ll see this instead of the form:

<!-- raw HTML omitted -->

Call your shortcode like this instead:

{{< ppdonate >}}

Thanks, tried that but still nothing. Still no error messages, either.

View source. What do you see?

I’m not even seeing the ppdonate button or naything else show up. I’ll attach it in case i’m missing something obvious:

Your shortcode, and calling it with {{< ppdonate >}}, works fine for me.

You’ve got something else going on.

Please post a link to the public repository for your site. See:
https://discourse.gohugo.io/t/requesting-help/9132

Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.

If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.

Appreciate the pointers! I have made the repo public and it is available here:

You have placed {{< ppdonate >}} in content/_index.md. By definition, this file contains the front matter and content for your home page. It is rendered to HTML using this template:

themes/hugo-theme-codex/layouts/index.html

This template displays some of the front matter from content/_index.md, but it does not display the content (the stuff after the YAML). That’s why your shortcode is not displayed.

To fix, place {{ .Content }} somewhere within the {{ define "main" }} block. For example:

{{ define "styles" }}
    {{ $.Scratch.Set "style_opts" (dict "src" "scss/pages/about.scss" "dest" "css/about.css") }}
{{ end }}

{{ define "main" }}

<div class="splash-container">
  <div class="splash">
    <h1>{{ .Params.heading }}<span class="fancy">.</span></h1>
    {{ if isset .Params "handle" }}
    <span class="handle">@{{ .Params.handle }}</span>
    {{ end }}
    <h2>
      {{ .Params.subheading }}
    </h2>
    {{ .Content }}
    <!-- Replace MEEEEE -->

    {{ partial "social-icons.html" .}}
  </div>
</div>

{{ end }}

Not sure where the <!-- Replace MEEEEE --> comment came from, but it’s an indication that this template isn’t ready to go live.