-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Themes Header is completly broken when loaded into Hugo #9
Comments
@Vinylwalk3r Try this out.
#!/usr/bin/env bash
hugo-obsidian -input=content -output=assets/indices -index -root=.
hugo serve -b "$YOUR_HOST_IP" --bind "$YOUR_HOST_IP" --noHTTPCache --disableFastRender As one would expect, you will need to replace Stay Swedish my friend. |
@anoduck Sorry for a late reply! And thank you greatly for your help! I tried your script and it mostly works. (forget what I said about hugo-obsidian, I got it working. Had forgot to add it to .bash_profile🤦) Also, how come this little script you've written here isn't mentioned in the install instructions? I don't know much about Hugo but it seems like quite the necessary bit of code for the site? |
@Vinylwalk3r You are correct, it is important, and your observation concerning the assets folder is right on target as well. There are numerous aspects of this theme that are fishy, and lead one to believe it was originally not written to be shared publicly, or at least sharing it publicly was an afterthought. Some of these things wouldn't be noticed unless you have had experience troubleshooting Hugo templates before and have been using Hugo for some time. Several years ago, themes were not placed in their own subdirectory as they are now, back then you cloned the theme repository first, and used your cloned version to build your site directly inside. As you can guess, this placed limitations on the degree to which you could customize your site. It also complicated matters if you wanted to use any form of versioning control, or simply made a mistake and deleted the wrong file. At first glance, this is how the theme appears to be structured and/or intended for use. The entire theme could use an overhaul and have the locations of several resources refactored to align itself with how Hugo currently structures themes. I still have not gotten the integrated graph to work, and Hugo does not like how obsidian reformats the front matter header of site entries. Also, Hugo can be configured to run hugo-obsidian on its own, this would be a nice feature to have. |
@anoduck The way you describe how themes worked before Hugo got the theme functionality we have today, it seems like it was a nightmare to update your site if your working theme recieved an update. Probably not to bad if you just used a theme "vanilla" but if you had made personal modifications to the theme and had to merge them with a updated theme. Yikes, I'm not envious. Indeed, it couldn't hurt. But would probably require a considerable amount of work, I could imagine. Wouldn't it require a almost entire rewrite? I wonder, (and I shall not pretend to understand much about the front matter problem you described) but could a, admittedly a bit of a dirty solition, be to have two sets of front matter? One that Obsidian reads from and then a second "copy" edited to make Hugo happy? It's not neat at all, but maybe it atleast could work? |
@Vinylwalk3r check out --> https://github.com/anoduck/amethyst-theme I didn't want to mention it earlier, because my knowledge of Hugo isn't up to snuff, and I don't program in Go. The good news is that it is currently running from the theme subdirectory, and I have tried to copy the necessary bits into the It is going to take some fiddling and a little finagling, but the majority of the codebase is solid. Mostly what needs to be done is move things around and change the resource paths to match the new locations. The project developer is thankfully considerably better at programming JavaScript and Go than I. Last but not least, Hugo itself is incredibly flexible, and has an entire template lookup table. Which is what provides its flexibility. OK, got to run. Gunsmoke is on. |
Hey all, apologies for the lack of response. You're right in that a lot of the components are pretty hacky. The version of Hugo this theme was built on is a couple years old at this point, and a lot of things are probably deprecated / no longer best practice. I'm also primarily a backend/infra dev so Hugo's not my strong point. The main reason why I built this theme to only be clone-able (and not that easily imported in the standard way) is its dependencies on hugo-obsidian. At the time I couldn't find a clean way of allowing others to have a built-in way of generating Obsidian graphs with it while also being clonable into Given that Jacky, the original maintainer of Quartz, rewrote that entire codebase to be in React and deprecated hugo-obsidian in the process, it's unlikely we'd be able to get Amethyst fully up-to-date without also rewriting it from the ground up as well. I'm strongly considering archiving this project since I don't have the bandwidth to maintain it, and it's clear it does need some considerable amount of bugfixing to be properly usable in its current state. |
"Hacky" or "Hackish" is a little too harsh. After all, you were in school at the time, and there was a justifiable reason for your approach. Let's call it "innovative".
Does this mean you have graduated?
Eureka, this explains everything, including why my interactive graph is blank.
😕 The last update was a year ago, and it wasn't archived until last month. I am curious if the graphs couldn't be generated with Gojs.
If I understand correctly, the biggest hurdle to overcome is the restriction placed on resource location by hugo-obsidian. This is in addition to the eventual loss of functionality of obsidian-hugo in the long-term. Does this sound correct? My selection of this theme had nothing to do with its integration with obsidian, it was purely based on features, simplicity, and aesthetics. Amethyst was my first choice, but I did try out two other Hugo themes for documentation sites. They both left me with a bad taste in my mouth. Docura did not provide taxonomy, and when I peeked at the code, it was apparent modification to handle taxonomy was not going to be a fun venture. Google's Docsy was the next, and the ability to customize the theme was found to be very limiting without considerable effort. Amethyst appeared to have the best mix of simplicity and flexibility. Well there is my $0.38 worth. Since you did mention the application of band-aids... binding the server address to |
Certainly; this is the main problem, and there are quite a few ways to it. The simplest approach I can think of is to just separate hugo-obsidian from the theme dependencies, and request users to generate the manifest themselves + paste it into
My experience was pretty similar to yours, hence why I decided to create Amethyst. I couldn't find any existing theme that exactly met all of my needs while still being usable. While others have evidently found Amethyst useful, it's still ultimately an opinionated personal project-- so you're welcome to modify it however you need, but there might get a point where your needs diverge too much for it to be worth using. I suppose this is true for any Hugo theme to some extent.
ah yes, just CORS being CORS 🙃 I'll have to do some experimentation and see if it'd be good to add some more notes about local development usage in the documentation (including your script in some form). |
@64bitpandas I went ahead and forked the project at amethyst-theme. It is not nearly ready for a pull request, but does work enough to allow my site to build. That is, as long as you copy all the components directly from the examplesite folder. Feature regression does not sound too fun at this moment in the game. As stated above, I have no experience writing in Go except the Go text/html templating language, but can program in Python and barely in Zig. I looked at Obsidian-Hugo, and it looks like something I can rewrite in python. I do also owe you some gratitude. I had not given obsidian a thorough enough test run when I first tried it. Now, because of this theme, I gave it a second chance. It is quite polished. |
Describe the bug
The header is broken with both the searchbar being completly missplaced and the title being out of place ass well. The fonts are also wrong and the switch for Dark/Light theme are completly gone.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I'd expect the header to look as per the demo. The search bar to the right and the text in it's proper place. Check the demo for a ...well... demo of how it should look.
Screenshots
Imgur links to show what doesn't work.
Desktop (please complete the following information):
Additional context
A little question, why must the "assets" folder be copied into the root dir for the site? I thought themes fetched their assets from their respective themes/{theme-name} folder?
The text was updated successfully, but these errors were encountered: