Skip to content

Add sitemap generation to reflex app#3936

Closed
TG199 wants to merge 10 commits intoreflex-dev:mainfrom
TG199:dynamic_sitemap_gen
Closed

Add sitemap generation to reflex app#3936
TG199 wants to merge 10 commits intoreflex-dev:mainfrom
TG199:dynamic_sitemap_gen

Conversation

@TG199
Copy link
Copy Markdown
Contributor

@TG199 TG199 commented Sep 17, 2024

All Submissions:

  • Have you followed the guidelines stated in CONTRIBUTING.md file?
  • Have you checked to ensure there aren't any other open Pull Requests for the desired changed?

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

New Feature Submission:

  • Does your submission pass the tests?
  • Have you linted your code locally prior to submission?

Changes To Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

After these steps, you're ready to open a pull request.

a. Give a descriptive title to your PR.

b. Describe your changes.

c. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such).

@TG199 TG199 force-pushed the dynamic_sitemap_gen branch from 4015975 to b0cb5f3 Compare September 18, 2024 00:38
Copy link
Copy Markdown
Contributor

@picklelo picklelo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TG199 thanks for the contribution! We currently use next-sitemap to automatically generate a sitemap when you do reflex export or reflex run --env prod

See here:

def generate_sitemap_config(deploy_url: str, export=False):

Does that feature work for you? I think offloading the sitemap generation to a third party library as we do now is nice unless there's some functionality missing.

@benedikt-bartscher
Copy link
Copy Markdown
Contributor

@picklelo regarding the shift to python, take a look at #3489 and #3693.
For many features, we need the sitemap to be dynamic. For example, dynamic hostname, which allows deploying the same app under different hostnames without compiling twice. Or dynamic pages of a blog/forum.

@TG199
Copy link
Copy Markdown
Contributor Author

TG199 commented Sep 20, 2024

Hi @picklelo,
Thanks for the clarification! My implementation aims to provide dynamic sitemap generation, which can complement the current next-sitemap approach by adding flexibility for dynamic hostnames and real-time updates.

This commit moves all sitemap generation functions from the separate sitemap file into app.py.

Developers can now easily integrate sitemaps into their applications using the add_page method. For example:
app.add_page(/about, sitemap_priority=0.8, sitemap_changefreq=monthly)
@TG199 TG199 force-pushed the dynamic_sitemap_gen branch from f53f039 to 993cdca Compare September 24, 2024 01:13
@TG199
Copy link
Copy Markdown
Contributor Author

TG199 commented Oct 2, 2024

Hi! @benedikt-bartscher After testing locally and writing unit tests, I encountered some unrelated errors when running poetry run pytest tests/units --cov. Would you recommend that I address these issues, or is there a workaround available?

@adhami3310
Copy link
Copy Markdown
Member

Hey there! It seems we haven't given this much attention, if you can rebase it to main we can try to get it merged, for now will be putting it to draft

@adhami3310 adhami3310 marked this pull request as draft November 5, 2024 22:06
@benedikt-bartscher
Copy link
Copy Markdown
Contributor

@TG199 do you plan to continue with this PR?

@TG199
Copy link
Copy Markdown
Contributor Author

TG199 commented Jan 25, 2025

Oh, Thank you for following up, and I apologize for the delay in getting back to this PR. Life got in the way for a while, but I definitely plan to continue and will start making progress on it right away. I appreciate your patience!

@benedikt-bartscher
Copy link
Copy Markdown
Contributor

@TG199 if you decide to start working on this again, pls take a look here first: #4923

@masenf masenf closed this Sep 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants