threefoldtech / www-mastodon

Apache License 2.0
2 stars 0 forks source link

WWW-MASTODON

Mastodon Deployment Weblet

Table of contents

  1. How to include weblet in another website?
  2. Provider ID

How to include weblet in another website?

  1. Clone the project
git clone https://github.com/threefoldtech/www-mastodon.git

# Change directory inside project
cd ./www-mastodon
  1. Install project dependencies
yarn install
  1. Build project
yarn build
  1. Copy all files in ./dist folder into your project (for e.g in ./weblet)

  2. Import scripts in your project

<script src="https://github.com/threefoldtech/www-mastodon/raw/development/weblet/config.js"></script>
<script defer src="https://github.com/threefoldtech/www-mastodon/raw/development/weblet/mastodon.js"></script>
  1. Use weblet within your templates
<!DOCTYPE html>
<html>
  <head>
    <!-- Code... -->
    <script src="https://github.com/threefoldtech/www-mastodon/raw/development/weblet/config.js"></script>
    <script defer src="https://github.com/threefoldtech/www-mastodon/raw/development/weblet/mastodon.js"></script>
  </head>
  <body>
    <tf-mastodon provider="your-provider-id"></tf-mastodon>
    <tf-mastodon-list></tf-mastodon-list>
  <body>
</html>

Provider ID

If you didn't add a Provider ID. User will be asked to enter a valid id or stick to our default id(1). image

If you add a Provider ID. you will get Credentials as first page.

<tf-mastodon provider="your-provider-id"></tf-mastodon>

image