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

Assets dir in Plenti site template #286

Closed
jamestagal opened this issue Jul 16, 2023 · 3 comments
Closed

Assets dir in Plenti site template #286

jamestagal opened this issue Jul 16, 2023 · 3 comments

Comments

@jamestagal
Copy link
Sponsor

Hi @jimafisk

Just started on a new theme and noticed that in the head.svelte file the logo.svg points to the assets not the newer media directory. See below.

Also not sure whether the first back slash is needed as well but that might only be the case when using a baseurl setup?

See below.

<script>
  export let title;
</script>

<head>
  <meta charset='utf-8'>
  <meta name='viewport' content='width=device-width,initial-scale=1'>

  <title>{ title }</title>

  <script type="module" src="/spa/core/main.js"></script>

  <link rel="icon" type="image/svg+xml" href="/assets/logo.svg">
  <link rel='stylesheet' href='/spa/bundle.css'>
</head>

Cheers,
Ben

@jimafisk
Copy link
Member

Oh good catch @jamestagal! Looks like the bare starter was still referencing the old assets folder instead of the new media folder. I just fixed this, so it should be available in the next release!

You're exactly right about the baseurl. If you're using baseurl, removing the forward slash from static references lets you serve the entire site from a subfolder. If you're not using baseurl, you can just use an absolute or root relative reference with a forward slash. It's more confusing than I'd like, but unfortunately that's how HTML handles baseurls and root relative paths: https://stackoverflow.com/questions/11521011/why-base-tag-does-not-work-for-relative-paths

@jimafisk
Copy link
Member

Should be all set in v0.6.21

Thanks for flagging this to me @jamestagal!

@jamestagal
Copy link
Sponsor Author

Thanks @jimafisk and thank you for adding an entry into the docs for baseurl. That information really helps.
Cheers,
Ben

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

2 participants