-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add caching comment and update READMEs (#168)
* chore: add caching comment and update READMEs * Update packages/web-shared/client/apollosApiLink.js Co-authored-by: Vincent Wilson <[email protected]> * Update micro-service/README.md Co-authored-by: Vincent Wilson <[email protected]> * Update micro-service/README.md Co-authored-by: Vincent Wilson <[email protected]> * Update micro-service/README.md 😆 Co-authored-by: Vincent Wilson <[email protected]> * Update web-embeds/README.md Co-authored-by: Vincent Wilson <[email protected]> * Update micro-service/README.md Co-authored-by: Vincent Wilson <[email protected]> * fix: whoopsie --------- Co-authored-by: Vincent Wilson <[email protected]>
- Loading branch information
Showing
3 changed files
with
68 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,16 +15,17 @@ The JS file used to embed these widgets is hosted on GitHub and picked up by [js | |
|
||
That's it! Your updated version of the apollos-embeds will be available for use. | ||
|
||
_⚠️ React needs to be imported in every file it is used, otherwise the js build file will error when you embed it in your website._ | ||
_⚠️ React needs to be imported in every file it is used, otherwise the js build file will error when you embed it in your website._ | ||
|
||
*** | ||
--- | ||
|
||
# Using Embeds in Webflow | ||
|
||
## 1. Adding the Script Tags: | ||
|
||
Copy the following script tags into your Webflow website. In your Dashboard, you should see the tab 'Custom Code'. Scroll to the bottom and paste the following script tags in the Footer Code block: | ||
html | ||
|
||
``` | ||
<link href="https://cdn.jsdelivr.net/npm/@apollosproject/[email protected]/widget/index.css" rel="stylesheet"/> | ||
<script src="https://cdn.jsdelivr.net/npm/@apollosproject/[email protected]/widget/index.js"></script> | ||
|
@@ -45,6 +46,7 @@ Add the class `apollos-widget` to both of those divs. This is necessary for the | |
<img width="935" alt="image" src="https://user-images.githubusercontent.com/2528817/231847323-53430bca-f2fd-4d2c-b7ee-90948fb694b5.png"> | ||
|
||
## 4. Adding Custom Attributes: | ||
|
||
To control which embed shows up in which div and what church content is displayed, we use 'data-attributes' or 'Custom attributes' in Webflow. | ||
|
||
For the 'Auth' embed, add `data-type="Auth"` and `data-church=[INSERT_CHURCH_SLUG_HERE]` as custom attributes. Here's an example for Bayside: | ||
|
@@ -63,51 +65,59 @@ For the 'FeatureFeed' embed, which displays the church's content, add `data-type | |
|
||
<img width="928" alt="image" src="https://user-images.githubusercontent.com/2528817/231847773-9698dc62-3ca8-4814-ad33-63204fb5f625.png"> | ||
|
||
|
||
_⚠️ Make sure to replace [INSERT_CHURCH_SLUG_HERE] with your church's unique identifier, or 'slug'._ | ||
|
||
### Options | ||
### Enabling Caching for Local Frustration | ||
|
||
For local development and testing purposes, you might want to enable caching to ensure you're not receiving the latest responses directly from the API. To do this, please refer to the Apollo client configuration file: | ||
|
||
| data-type | | ||
|----------------| | ||
| Auth | | ||
| FeatureFeed | | ||
|
||
| data-church | | ||
|---------------------------| | ||
| apollos_demo | | ||
| bayside | | ||
| cedar_creek | | ||
| celebration | | ||
| chase_oaks | | ||
| christ_fellowship | | ||
| city_first | | ||
| community_christian | | ||
| crossings_community_church| | ||
| crossroads_kids_club | | ||
| crossroads_tv | | ||
| default | | ||
| eastview | | ||
| eleven22 | | ||
| fairhaven | | ||
| fake | | ||
| fake_dag_church | | ||
| fellowship_greenville | | ||
| fellowship_nwa | | ||
| hope_in_real_life | | ||
| king_of_kings | | ||
| lcbc | | ||
| liquid_church | | ||
| newspring | | ||
| oakcliff | | ||
| real_life | | ||
| river_valley | | ||
| try_grace | | ||
| willow_creek | | ||
| woodmen | | ||
| ymca_gc | | ||
|
||
|
||
*** | ||
[../packages/web-shared/client/apollosApiLink.js](../packages/web-shared/client/apollosApiLink.js) | ||
|
||
In this file, locate the header configuration within the `apollosApiLink` function and comment the following line: | ||
|
||
```javascript | ||
'x-cache-me-not': 1, | ||
``` | ||
|
||
### Options | ||
|
||
| data-type | | ||
| ----------- | | ||
| Auth | | ||
| FeatureFeed | | ||
|
||
| data-church | | ||
| -------------------------- | | ||
| apollos_demo | | ||
| bayside | | ||
| cedar_creek | | ||
| celebration | | ||
| chase_oaks | | ||
| christ_fellowship | | ||
| city_first | | ||
| community_christian | | ||
| crossings_community_church | | ||
| crossroads_kids_club | | ||
| crossroads_tv | | ||
| default | | ||
| eastview | | ||
| eleven22 | | ||
| fairhaven | | ||
| fake | | ||
| fake_dag_church | | ||
| fellowship_greenville | | ||
| fellowship_nwa | | ||
| hope_in_real_life | | ||
| king_of_kings | | ||
| lcbc | | ||
| liquid_church | | ||
| newspring | | ||
| oakcliff | | ||
| real_life | | ||
| river_valley | | ||
| try_grace | | ||
| willow_creek | | ||
| woodmen | | ||
| ymca_gc | | ||
|
||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters