Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSG includes hostname on build links at root directory #183

Open
efc opened this issue Nov 2, 2024 · 0 comments
Open

SSG includes hostname on build links at root directory #183

efc opened this issue Nov 2, 2024 · 0 comments

Comments

@efc
Copy link

efc commented Nov 2, 2024

Used statamic new to create a project named x including SSG. Set /resources/site.yaml default url to /foo. In other words, I am trying to generate a static site that is contained within the /foo folder of another host.

When I generate the static site I get a home page with the following...

        <link rel="preload" as="style" href="http://x.test/build/assets/site-9bd4acd3.css" /><link rel="modulepreload" href="http://x.test/build/assets/site-4ed993c7.js" /><link rel="stylesheet" href="http://x.test/build/assets/site-9bd4acd3.css" /><script type="module" src="http://x.test/build/assets/site-4ed993c7.js"></script>

These links have two problems. One is that they include the http://x.text host, and I plan to serve the static site from another host. The other is that they reference the build directory from the root of the server, and I expect (and need) all the static files to be in the site's /foo directory.

These links are generated from the layout.antlers.html template's vite tag...

        {{ vite src="resources/js/site.js|resources/css/site.css" }}

I also find the build directory at /storage/static/build.

What I expect is a site fully contained in the /storage/static/foo directory, with build at /storage/static/foo/build and links that do not include a host.

What all do I need to change in this plain new Statamic site to get this result?

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

No branches or pull requests

1 participant