@milky-themes/lucky-post

1.0.6 • Public • Published

Lucky post

Generate random post links for Ghost. It's easy to set up and get going.

Installing Lucky Post

  1. In your Ghost admin dashboard, navigate to Settings > Code injections and in your "Site footer" paste the following code:
<script src="https://unpkg.com/@milky-themes/lucky-post@latest/min/index-min.js"></script>
  1. Navigate to Settings > Integrations and select "Add custom integration"

  2. Name your custom integration Lucky Post and the description as Generate random post links for Ghost

  3. Copy your Content API key

  4. Navigate to Settings > Code injections and in your "Site header" insert the following code and replace the placeholder with your Content API key:

<script>
    let key = 'replace-text-with-api-key'
</script>

All done!

How to use Lucky Post

There are two ways to use Lucky Post and some rules to follow to ensure it works.

Method 1: href link

Perhaps the simplest method is to link your href (url) to https://example.com/#rdm-post/

Important notes:

  • It's important to keep the forward-slash '/' at the beginning and end of 'rdm-post' along with the full url and hash '#'. Otherwise the trigger will not function. Correct usage example:
<a href="https://example.com/#rdm-post/">Random Post</a>

Inccorect usage:

<a href="/rdm-post">Random Post</a>

Method 2: classname

Sometimes we may have elements without a href (url) link anchored. In these instances we can use the classname btn-random

E.g.

<button class="btn-random">Get random post</button>

How do I add Lucky Post to my navigation?

Navigate to Settings > Navigation and create a new link with your website URL followed by '/rdm-post/'

E.g. https://example.com/#rdm-post/

Package Sidebar

Install

npm i @milky-themes/lucky-post

Weekly Downloads

34

Version

1.0.6

License

GPL-3.0

Unpacked Size

5.61 kB

Total Files

5

Last publish

Collaborators

  • milky-themes