Closed jamestagal closed 1 year ago
Hi @jamestagal,
I'm trying to recreate this, but when I pull your main
branch it builds fine on my end. It looks like the breaking change and the temporary fix are both on the bugfix branch?
I'm a little confused, adding content/pages/contact.json
breaks the site but changing the menu
key in a different file (content/pages/login.json
) fixes the issue?
What is the menu
key supposed to do? I don't see it even being used in the corresponding template: layouts/content/pages.svelte
. Sorry I'm just not familiar with the underlying logic of the theme, so any context is helpful! Thanks!
Hi @jimafisk
Good question. Setting that menu
key to true
adds it to the nav menu. The context is that some time ago I couldn't get the Netlify form working and while waiting for a solution , see issue https://github.com/jamestagal/edtechdesigner/issues/17 I decided to remove the contact.json
file thus not displaying it. Then more recently to get the page back again I just copied the content over from @roobyz (content/pages/contact.json
file from his theme. But I can see when switching to the main
branch now is it working.
Note: The goal with the login.json
menu item in content/pages/login.json
is to link to my Moodle LMS https://www.edtechdesigner.com/
But I am not sure how to do that in Plenit (ie route to an external page)
Ben
Hey @jamestagal,
You should be able to route to an external page simply by using the full domain in the link:
<a href="https://myexternalsite.com">My External Site</a>
Or if you want it to open in a new tab:
<a href="https://myexternalsite.com" target="_blank" rel="noopener noreferrer">My External Site</a>
Does that work for your site?
Hi @jimafisk
Thanks yes I should have been more specific.. what I am not sure about is where to insert that <a>
tag as you listed above.
In the navbar.svelte
file I think any new json
file created in content/pages/
is dynamically added to the nav menu. See below.
https://github.com/jamestagal/edtechdesigner/blob/1bb8edac0a36f198cc9a435bed7f66facac5a5e4/layouts/global/navbar.svelte#L117-L129
So would I need to create a separate svelte
component and add the <a>
tag link?
Thanks
Ben
Could you hardcode an additional link above or below the {#each}
block similar to posts? https://github.com/jamestagal/edtechdesigner/blob/1bb8edac0a36f198cc9a435bed7f66facac5a5e4/layouts/global/navbar.svelte#L109-L116
Yes I guess to it could work! it just doesn't match the styling of the other links in the nav.
I'd inspect the element on the front and see what's different. It's likely that different classes or slightly different markup is being applied. Just let me know if that gives you trouble!
Hi @jimafisk How are you going?
I wonder whether you could help me please with a recent error on my site? I recently added the
Contact
page back to my site but once doing so I got the following error:I can't see why this would have happened because I only just copied over the same content, Roberto had in his theme's
contact.json
file into mine. See below.But what is intriguing about the error is it refers to the 404 svelte file is not defined. Any thoughts on this one would be much appreciated. In the meantime, I have pushed a bugfix branch so that I would not cause the site to crash.
Regards, Ben