Skip to content

Commit

Permalink
docs: update to v2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
SebaOfficial committed Dec 9, 2024
1 parent b7ebe0d commit 0cd4790
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 40 deletions.
9 changes: 9 additions & 0 deletions docs/analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,20 @@ Analytics are entirely handled by [simpleanalytics.com](https://www.simpleanalyt
You can see the analytics for the demo website [here](https://dashboard.simpleanalytics.com/demo.linksharer.js.org?referral=rofes).

## Usage

Follow these steps to enable analytics in you LinkSharer website:

1. Enable `analytics` in you [configuration file](configuration).
2. Signup to [simpleanalytics.com](https://www.simpleanalytics.com/?referral=rofes) and [enter your domain](#limitations)

## Short Links

If analytics are enabled and a sort version of a link is set, analytics are collected on that link.

### How?

When a link in the links list is clicked, the user is redirected to `/s/[short_version]`, when the [simpleanalytics](https://www.simpleanalytics.com/?referral=rofes) script is loaded and analytics are collected, the user will be redirected to the actual url.

## Limitations

In order to enable analytics you can't use an url like user.github.io/repository, you must set a [CNAME](configuration) or create a repository named `user.github.io`, where `user` is your username.
79 changes: 43 additions & 36 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,54 +6,61 @@ sidebar_position: 2

Here's a list of available confuguration fields:

| Field | Type | Description |
| --------- | -------------------------- | ------------------------------------------------------------------------------------------------------------- |
| template | string | The url of the CSS template. |
| i18n | string | Internalization strings. Use one of [these](https://github.com/LinkSharer/LinkSharer/tree/main/src/lib/i18n). |
| cname | string | _Optional_. The `CNAME`. |
| seo | [SEO](#seo) | SEO configurations. |
| user | [User](#user) | User configurations. |
| links | Array of [Link](#link) | A list of links/resources. |
| socials | Array of [Social](#social) | _Optional_. A list of socials to display after the links. |
| analytics | boolean | _Optional_. Whether [analytics](analytics) should be enabled or not. Default's false. |
| scripts | Array of [Script](#script) | _Optional_. A list of scripts to be included in the page. |
| credits | boolean | _Optional_. Whether the credits should be displayed or not. Default's true. |
| Field | Type | Description |
| ---------------------- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| template | string | The url of the CSS template. |
| i18n | string | Internalization strings. Use one of [these](https://github.com/LinkSharer/LinkSharer/tree/main/src/lib/i18n). |
| cname | string | _Optional_. The `CNAME`. |
| seo | [SEO](#seo) | SEO configurations. |
| user | [User](#user) | User configurations. |
| links | Array of [Link](#link) | A list of links/resources. |
| socials | Array of [Social](#social) | _Optional_. A list of socials to display after the links. |
| analytics | boolean | _Optional_. Whether [analytics](analytics) should be enabled or not. Default's false. |
| googleSiteVerification | string | _Optional_. A Google site verification meta tag. Look at [this resource](https://support.google.com/webmasters/answer/9008080#meta_tag_verification&zippy=%2Chtml-tag) to know how to generate one. |
| scripts | Array of [Script](#script) | _Optional_. A list of scripts to be included in the page. |
| credits | boolean | _Optional_. Whether the credits should be displayed or not. Default's true. |

## User

| Field | Type | Description |
| ------ | ------ | --------------------------------------------------- |
| name | string | The name to be displayed in the user's information. |
| bio | string | A short description of the website. |
| avatar | string | The url to the user's avatar. |
| Field | Type | Description |
| ----- | ------ | --------------------------------------------------- |
| name | string | The name to be displayed in the user's information. |
| bio | string | A short description of the website. |

You can change the avatar displayed in the main page by adding your own `user/avatar.png`.

## SEO

| Field | Type | Description |
| ----------- | ------ | -------------------------- |
| title | string | The website's title. |
| description | string | The website's description. |
| Field | Type | Description |
| ----------- | ------------------ | ---------------------------------------------- |
| title | string | The website's title. |
| description | string | The website's description. |
| canonical | string | _Optional_. A canonical tag for the main page. |
| og | Array of key-value | _Optional_. OpenGraph configuration. |
| twitter | Array of key-value | _Optional_. Twitter configuration. |

## Social

| Field | Type | Description |
| ------ | ------ | --------------------------------------------------------------------------------------- |
| url | string | The social's url. |
| icon | string | The social's icon. Use [Fontawesome's Icons](https://fontawesome.com/search?o=r&m=free) |
| target | string | _Optional_. The target of the anchor element. Default's `self`. |
| name | string | _Optional_. The name of the url, will be used as `aria-label`. |
| Field | Type | Description |
| ------ | -------------- | --------------------------------------------------------------------------------------- |
| url | string | The social's url. |
| icon | IconDefinition | The social's icon. Use [Fontawesome's Icons](https://fontawesome.com/search?o=r&m=free) |
| target | string | _Optional_. The target of the anchor element. Default's `self`. |
| name | string | _Optional_. The name of the url, will be used as `aria-label`. |

## Link

| Field | Type | Description |
| -------- | ------- | --------------------------------------------------------------------------------------------------------------- |
| name | string | The name of the link. |
| url | string | The link's url. |
| icon | string | The link's icon. Use [Fontawesome's Icons](https://fontawesome.com/search?o=r&m=free) |
| target | string | _Optional_. The target of the anchor element. Default's `self`. |
| sameAs | boolean | _Optional_. Whether `itemprop="sameAs"` should be included in the HTML element or not. Default's false. |
| privacy | boolean | _Optional_. Whether `rel="noopener noreferrer"` should be included in the HTML element or not. Default's false. |
| external | boolean | _Optional_. Whether `rel="external"` should be included in the HTML element or not. Default's false. |
| Field | Type | Description |
| -------- | -------------- | --------------------------------------------------------------------------------------------------------------- |
| name | string | The name of the link. |
| url | string | The link's url. |
| icon | IconDefinition | The link's icon. Use [Fontawesome's Icons](https://fontawesome.com/search?o=r&m=free) |
| target | string | _Optional_. The target of the anchor element. Default's `self`. |
| sameAs | boolean | _Optional_. Whether `itemprop="sameAs"` should be included in the HTML element or not. Default's false. |
| privacy | boolean | _Optional_. Whether `rel="noopener noreferrer"` should be included in the HTML element or not. Default's false. |
| external | boolean | _Optional_. Whether `rel="external"` should be included in the HTML element or not. Default's false. |
| display | boolean | _Optional_. Set this to false to not display the link in the list. Default's true. |
| short | string | _Optional_. A shorter version of the url. |

## Script

Expand Down
6 changes: 3 additions & 3 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type * as Preset from '@docusaurus/preset-classic';

const githubOrg = "https://github.com/LinkSharer";
const githubUrl = `${githubOrg}/LinkSharer`;
const demoUrl = "https://demo.linkshare.js.org";
const demoUrl = "https://demo.linkshare.js.org?utm_source=docs&utm_campaign=landing_page&utm_medium=";

const config: Config = {
title: 'Link Sharer',
Expand Down Expand Up @@ -73,7 +73,7 @@ const config: Config = {
},
{
label: "Example Website",
to: demoUrl,
to: `${demoUrl}header`,
},
{
label: "GitHub Template",
Expand Down Expand Up @@ -102,7 +102,7 @@ const config: Config = {
},
{
label: 'Example Website',
href: demoUrl
href: `${demoUrl}footer`
},
{
label: 'GitHub Organization',
Expand Down
2 changes: 1 addition & 1 deletion src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function HomepageHeader() {
<div className={styles.buttons}>
<Link
className="button button--secondary button--lg"
href="https://demo.linksharer.js.org?utm_source=docs&utm_medium=button&utm_campaign=landing_page&utm_content=example_link">
href="https://demo.linksharer.js.org?utm_source=docs&utm_medium=button&utm_campaign=landing_page">
Example Website
</Link>
<Link
Expand Down

0 comments on commit 0cd4790

Please sign in to comment.