Skip to content

Conversation

Mpdreamz
Copy link
Member

@Mpdreamz Mpdreamz commented Mar 14, 2025

It still defaults to UrlPathPrefix but with the assembler build we need a way to ensure static files can
be rooted seperately from the path prefix of the page.

To help with development we now have a 'dev' environment which defaults to http://localhost:4000/docs

We can now view the output of docs-assembler repo build all with docs-builder serve-static
which will host the combined docs under http://localhost:4000

This should fix the styling on: https://staging-website.elastic.co/docs/

It still defaults to UrlPathPrefix but with the assembler build we need a way to ensure static files can
be rooted seperately from the path prefix of the page.

To help with development we now have a 'dev' environment which defaults to http://localhost:4000/docs

We can now view the output of `docs-assembler repo build all` with `docs-builder serve-static`
which will host the combined docs under http://localhost:4000
@Copilot Copilot AI review requested due to automatic review settings March 14, 2025 15:18
@Mpdreamz Mpdreamz requested a review from a team as a code owner March 14, 2025 15:18
@Mpdreamz Mpdreamz added the fix label Mar 14, 2025
@Mpdreamz Mpdreamz self-assigned this Mar 14, 2025
Added explicit diagnostic suppression rules for IL3050 and IL2026 under the StaticWebHost.cs section in the .editorconfig file. This ensures consistent handling of these diagnostics specifically for StaticWebHost-related code.
@Mpdreamz Mpdreamz merged commit d2334d2 into main Mar 14, 2025
8 checks passed
@Mpdreamz Mpdreamz deleted the fix/assembler-build-paths branch March 14, 2025 15:34
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR separates the static URL prefix from the path prefix to support serving static files independently and adds a new "dev" environment for development. Key changes include:

  • Introducing a new StaticUrlPathPrefix property in BuildContext and updating view models to use it.
  • Adding a new "serve-static" command endpoint that leverages the StaticWebHost.
  • Updating the assembler and builder code to support environment-based URL and path prefix configurations.

Reviewed Changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/docs-builder/Http/StaticWebHost.cs New static web host implementation for serving static files.
src/docs-builder/Cli/Commands.cs Added ServeStatic command for hosting static files on a separate port.
src/Elastic.Markdown/BuildContext.cs Introduced StaticUrlPathPrefix with fallback to UrlPathPrefix.
src/docs-assembler/Cli/RepositoryCommands.cs Updated environment default to "dev" and adjusted BuildAllAsync call.
src/docs-assembler/assembler.yml Added a new "dev" environment configuration.
src/docs-assembler/Building/AssemblerBuilder.cs Adjusted BuildAllAsync and BuildAsync signatures for PublishEnvironment.
src/docs-assembler/Sourcing/RepositorySourcesFetcher.cs Commented out an unused timeout setting.
src/Elastic.Markdown/Slices/_ViewModels.cs Updated view models to include StaticUrlPathPrefix.
src/Elastic.Markdown/Slices/HtmlWriter.cs Updated layout rendering to inject StaticUrlPathPrefix.
src/docs-assembler/AssembleContext.cs Fixed assembler configuration file path resolution.
src/docs-assembler/Building/PublishEnvironmentUriResolver.cs Updated constructor to use PublishEnvironment and improved URI parsing.
src/Elastic.Markdown/Slices/Index.cshtml Updated razor view to include StaticUrlPathPrefix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants