Skip to content

Commit d692482

Browse files
committed
Add docs for social share previews
1 parent 1b4cecd commit d692482

File tree

5 files changed

+57
-1
lines changed

5 files changed

+57
-1
lines changed

content/menu.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ site_menu:
333333
url: /streamlit-cloud/get-started/share-your-app
334334
- category: Streamlit Cloud / Get started / Share your app / App indexability
335335
url: /streamlit-cloud/get-started/share-your-app/indexability
336+
- category: Streamlit Cloud / Get started / Share your app / Share previews
337+
url: /streamlit-cloud/get-started/share-your-app/share-previews
336338
# - category: Streamlit Cloud / Get started / Share your app / Configuring Single Sign-on (SSO)
337339
# url: /streamlit-cloud/get-started/share-your-app/configuring-single-on-sso
338340
# visible: false

content/streamlit-cloud/get-started/deploy-an-app/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,4 +109,4 @@ It's that simple! You can then access your app by visiting your custom subdomain
109109

110110
If a custom subdomain is not available (e.g. because it's already taken), you'll see an error message like this:
111111

112-
![Custom subdomain error](/images/streamlit-cloud/custom-subdomain-error.png)
112+
<Image src="/images/streamlit-cloud/custom-subdomain-error.png" clean />
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: Share previews
3+
slug: /streamlit-cloud/get-started/share-your-app/share-previews
4+
---
5+
6+
# Share previews
7+
8+
Social media sites generate a card with a title, preview image, and description when you share a link. This feature is called a "share preview." In the same way, when you share a link to a Streamlit app on social media, a share preview is also generated. Here's an example of a share preview for a public Streamlit app posted on Twitter:
9+
10+
![Share preview for a public Streamlit app](/images/streamlit-cloud/share-preview-twitter-annotated.png)
11+
12+
## Titles
13+
14+
The title is the text that appears at the top of the share preview. The text also appears in the browser tab when you visit the app. You should set the title to something that will make sense to your app's audience and describe what the app does. It is best practice to keep the title concise, ideally under 60 characters.
15+
16+
There are two ways to set the title of a share preview:
17+
18+
1. Set the `page_title` parameter in [`st.set_page_config()`](/library/api-reference/utilities/st.set_page_config) to your desired title. E.g.:
19+
20+
```python
21+
import streamlit as st
22+
23+
st.set_page_config(page_title="My App")
24+
25+
# ... rest of your app
26+
```
27+
28+
2. If you don't set the `page_title` parameter, the title of the share preview will be the name of your app's GitHub repository. E.g., if you don't set the `page_title` parameter in `st.set_page_config()`, the title of the share preview for an app hosted on GitHub at https://github.com/jrieke/traingenerator will be "traingenerator".
29+
30+
## Descriptions
31+
32+
The description is the text that appears below the title in the share preview. The description should summarize what the app does and ideally should be under 160 characters.
33+
34+
Streamlit pulls the description from the README in the app's GitHub repository. If there is no README, the description will default to:
35+
36+
_This app was built in Streamlit! Check it out and visit https://streamlit.io for more awesome community apps. 🎈_
37+
38+
If you want your share previews to look great and want users to share your app and click on your links, you should write a good description in the README of your app’s GitHub repository
39+
40+
## Preview images
41+
42+
Community Cloud takes a screenshot of your app once a day and uses it as the preview image, unlike titles and descriptions, which are pulled directly from your app's code or GitHub repository. This screenshot may take up to 24 hours to update.
43+
44+
## Public vs. private apps
45+
46+
All of the above information applies to public apps. If you share a private app, the share preview will contain no information about your app. Instead, it will include a default title ("Streamlit app"), a default description ("This app was built in Streamlit! Check it out and visit https://streamlit.io for more awesome community apps. 🎈"), and a default preview image that contains the Streamlit logo:
47+
48+
<div style={{ marginLeft: '10em' }}>
49+
<Flex>
50+
<Image caption="Default share preview for a private app" src="/images/streamlit-cloud/share-preview-private-app.png" />
51+
</Flex>
52+
</div>
53+
54+
If your app was initially public and you later made it private, the share preview will no longer contain any information about your app. It will look like the image above, containing a generic title, description, and image. However, the last publicly available data will be discoverable for up to 24 hours after the app is made private.
Loading
Loading

0 commit comments

Comments
 (0)