A small and simple responsive Substack post feed component for your website
* this is in Alpha and not fully production ready, please watch the FAQ's as some parts could change without notice
Version: 0.0.1-Alpha
This is a short explanation on how the substack rss feed component renderer can work and how it functions.
An example of how the feed can render is displayed below:
A breakdown of how the component can work and function:
The substack-posts-feed
is a custom HTML element
that fetches and displays an RSS feed from a specified
Substack page. It's a powerful tool that allows you to
integrate Substack content directly into your website.
To use this component, you need to include it in your HTML file. Here's how you can do it:
This component can be customized with several attributes:
substack-page-name
: This attribute is used to
specify the name of the Substack page from which the RSS
feed will be fetched. This is a required attribute for the
component to function.
show-feed-description
: This attribute is a
boolean that determines whether the description of the feed
should be displayed. By default, it is set to
false
and it doesn’t need to be provided for
default functionality. If you want to show the feed
description, set it to true
feed-error-message
: This is optional and can be
used to provide a custom error message when the feed fails
to load
feed-no-results-message
: This is optional and
can be used to provide a custom message when there are no
results returnd from the feed but the request has returned
successfully
feed-amount-displayed
: This attribute is used
to specify the number of feed items to display. By default,
it is set to 6
. You can adjust this number to
your liking
custom-css-feed
: This attribute is used to
provide custom CSS for the feed. Instead of a URL, you can
provide inline CSS
custom-css-loader
: This attribute is used to
provide custom CSS for the loader. You can also provide
inline CSS
custom-css-url
: You can provide the url of a
`.css` file and this will load that css stylesheet
Example of Full Component:
<substack-posts-feed substack-page-name="your-substack-page-name" show-feed-description="true" feed-amount-displayed="10" custom-css-feed=".rss-feed { background-color: green; }" custom-css-loader=".rss-feed__loader { color: #ff0000; }" feed-error-message="There was an error loading the feed" feed-no-results-message="No results were found" ></substack-posts-feed>
Replace "your-substack-page-name" with the name of your
Substack page, and adjust the
feed-amount-displayed
attribute to the number of
feed items you want to display. You can also replace the CSS
in custom-css-feed
and
custom-css-loader
with your own CSS to customize
the look of the feed and the loader.
Please note that the
substack-posts-feed
component must be imported
into your HTML file before you can use it. You can do this by
adding a script tag pointing to the
substack-carousel.js
file in your HTML file:
<script src="https://api.pascalcouturier.com/resources/scripts/components/substack-post-feed.js"></script>
NOTE: The domain that you are using needs to be added to the API access or there will be errors and it will not be able to load.
Please notify the admin of api.pascalcouturier.com to be able to have your domain added to the list for access on your site.
You can customise the css classes to tyarget them directly, or override them in the css attributes of the component.
The classes that are available are below:
9th June, 2024