Skip to content

Conversation

jordanstephens
Copy link
Member

@jordanstephens jordanstephens commented Jan 14, 2025

Reverts #159

First attempt #137

Closes https://github.com/DefangLabs/defang-mvp/issues/825

Last time we deployed this, the samples disappeared from the marketing site. The intention was to keep them there, but remove them from the docs site.

Todo

  • Find out how samples are sourced from the docs site so they can be presented on the marketing site.
    The marketing website fetches samples from the docs site at https://docs.defang.io/samples-v2.json [1]
  • Remove presentation of samples in the docs site, while preserving samples-v2.json.
    We accomplish this by preserving the scripts/prep-samples.js file, which builds /static/samples-v2.json.

We should probably move this sort of sample processing elsewhere because there is no reason for the docs site to be part of this process, but for now, I'll leave it in place.

@jordanstephens jordanstephens changed the title [2nd Attempt] deduplicate samples from docs site in favour of mktg site [2nd Attempt] Remove samples from docs site Jan 14, 2025
@jordanstephens jordanstephens marked this pull request as ready for review January 14, 2025 18:36
@raphaeltm
Copy link
Contributor

To me, this makes sense. Looks like the main diff is that it keeps the samples build script, is that right @jordanstephens ? That should solve the issue we had.

@jordanstephens
Copy link
Member Author

To me, this makes sense. Looks like the main diff is that it keeps the samples build script, is that right @jordanstephens ? That should solve the issue we had.

Yep that's exactly right. The corp website requests samples from the docs website, so this PR removes the presentation of the samples in the docs, but continues building them so the corp website can fetch them. See https://github.com/DefangLabs/defang-mvp/blob/37d84acb9fbdd03822051058084d7c7d665a7e8c/website/src/modules/samples/lib/fetch-samples/fetch-samples.ts#L16

In the future, we should cut the docs website out of the loop, but this will get things moving for now.

@raphaeltm
Copy link
Contributor

To me, this makes sense. Looks like the main diff is that it keeps the samples build script, is that right @jordanstephens ? That should solve the issue we had.

Yep that's exactly right. The corp website requests samples from the docs website, so this PR removes the presentation of the samples in the docs, but continues building them so the corp website can fetch them. See https://github.com/DefangLabs/defang-mvp/blob/37d84acb9fbdd03822051058084d7c7d665a7e8c/website/src/modules/samples/lib/fetch-samples/fetch-samples.ts#L16

In the future, we should cut the docs website out of the loop, but this will get things moving for now.

Agreed. We had talked about it previously, but ended up deciding that it would be simpler at that time to just roll with it. I think samples.defang.io/samples.json or something would make more sense.

@jordanstephens
Copy link
Member Author

To me, this makes sense. Looks like the main diff is that it keeps the samples build script, is that right @jordanstephens ? That should solve the issue we had.

Yep that's exactly right. The corp website requests samples from the docs website, so this PR removes the presentation of the samples in the docs, but continues building them so the corp website can fetch them. See DefangLabs/defang-mvp@37d84ac/website/src/modules/samples/lib/fetch-samples/fetch-samples.ts#L16
In the future, we should cut the docs website out of the loop, but this will get things moving for now.

Agreed. We had talked about it previously, but ended up deciding that it would be simpler at that time to just roll with it. I think samples.defang.io/samples.json or something would make more sense.

Sure, we may be able to set up a github pages site for the samples repo to host a json file that we build in an action on merge.

@jordanstephens jordanstephens merged commit b3645a8 into main Jan 15, 2025
3 checks passed
@raphaeltm
Copy link
Contributor

To me, this makes sense. Looks like the main diff is that it keeps the samples build script, is that right @jordanstephens ? That should solve the issue we had.

Yep that's exactly right. The corp website requests samples from the docs website, so this PR removes the presentation of the samples in the docs, but continues building them so the corp website can fetch them. See DefangLabs/defang-mvp@37d84ac/website/src/modules/samples/lib/fetch-samples/fetch-samples.ts#L16
In the future, we should cut the docs website out of the loop, but this will get things moving for now.

Agreed. We had talked about it previously, but ended up deciding that it would be simpler at that time to just roll with it. I think samples.defang.io/samples.json or something would make more sense.

Sure, we may be able to set up a github pages site for the samples repo to host a json file that we build in an action on merge.

Exactly. I think that makes a lot more sense. I'll add an issue for it.

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.

2 participants