wjh18 / hugo-liftoff

Minimal blog/portfolio theme with a focus on content creation and SEO best practices. An ideal choice for technical users jump-starting a personal brand.
https://hugo-liftoff.netlify.app
MIT License
93 stars 27 forks source link

am i doing something wrong with netlify deployment? #38

Closed akhilsahuji closed 11 months ago

akhilsahuji commented 11 months ago

I followed the getting started guide of hugo-liftoff and used submodule but in the following screenhot but it still says Error: failed to load modules: module "hugo-liftoff" not found in "/opt/build/repo/themes/hugo-liftoff"; either add it as a Hugo Module or store it in "/opt/build/repo/themes".: module does not exist

also my netlify.toml is same as mentioned in the theme i only change my version of hugo 0.119.0

am i doing some thing wrong ?

Screenshots image

akhilsahuji commented 11 months ago

so the above problem was solved .gitignore file had theme folder included i guess 😅😅 but now it's not using hugo-liftoff or my custom css link of website

image

wjh18 commented 11 months ago

Glad you were able to figure out the first issue.

RE the 2nd: It's using the theme, otherwise content would not be there. Just not loading/discovering static assets like CSS properly. Have you set the proper base url in your config?

akhilsahuji commented 11 months ago

yes @wjh18 I used the base url and set it 'https://www.akhilsahu.tech/'

also, I tried to use the solution at netlify forum but it didn't worked Hugo theme not applying, works locally

wjh18 commented 11 months ago

Does it load the CSS locally in development mode (i.e. with hugo server)? If so, it's likely a problem with the baseURL pointing to a unconfigured domain and not setting up DNS for that domain on Netlify (or your preferred DNS provider).

If your baseURL is set to the domain above but you haven't set up DNS for that domain, and we visit the https://akhilsahuji.netlify.app/ URL, we wouldn't expect the baseURL to resolve correctly because it's a completely separate domain. You can verify this by changing the baseURL to the latter URL temporarily and redeploy; it should work. That or visit your browser devtools from the netlify.app site and you'll see it's looking for static assets with the domain you set as your baseURL, which isn't configured yet.

In summary, what you need to do is set up DNS for the domain specified as your baseURL. Regardless, this isn't really a theme issue so I recommend referencing the Netlify docs for help.

akhilsahuji commented 11 months ago

Thanks @wjh18 it worked but not completely 😅 So I changed the base URL to https://akhilsahuji.netlify.app/ and it worked you can check. it is not taking my custom CSS, but in my dev server it is working. I am using cdn open-props for css-variables, does the cdn links will affect site deployments?

also, can we hide the all-post drop-down menu for sub-sections from config properties?

my dev server preview image

wjh18 commented 11 months ago

The issue is probably a result of using an @import in the custom CSS file. In prod, the base CSS and custom CSS are concatenated into a single file and to preserve CSS cascade, the custom CSS is appended to the end of that final CSS file. Otherwise, the theme CSS would take precedence. This isn't done in dev because it makes source maps unusable and is largely unnecessary.

In the browser tools, you can see the error on the prod site. I can't think of a workaround for this at the moment that doesn't involve overriding theme files (which you can do, of course). I didn't have the foresight to think of supporting imports in custom CSS, it was more so intended for basic overrides.

No way to disable dropdown in config unfortunately, but you can create a custom shortcode and use that in your _index.md file instead. Simply copy the related shortcode from the theme into your own project's layouts/shortcodes directory (create one if doesn't exist, use the same file name), then remove the filter dropdown markup.

I'm not working on the theme any more, just FYI. I gave a warning about that in the repo. This is roughly the extent of support I can provide, and for anything that doesn't fit your needs out of the box you'll have to try to find a workaround.

akhilsahuji commented 11 months ago

Thanks @wjh18 I found the workaround to add custom CSS I added directly to HTML in the style tag as a snippet through Netlify. do tell me how it feels and looks or roast it. https://akhilsahuji.netlify.app/

Thank you for your help and the work that you have put into the theme. It's perfect for a personal dev brand. I appreciate your efforts and dedication.

I have a question for you. Since you have stopped working on the theme, will you accept pull requests? I noticed that you planned to implement a search feature. I would like to try to implement it myself, as I am using the theme and I think it would be useful. I can do it in my fork, but I would love to hear your feedback and suggestions. Would you be interested in collaborating with me on this?

wjh18 commented 11 months ago

Looks great, I like the colors and animations. It's been cool seeing what color schemes everyone has come up with. I'm glad you like the theme.

I'm open to PRs as long as I don't have to spend a ton of time reviewing them and/or making changes. I still want to keep the theme usable with the earliest supported Hugo version if possible. Introducing too many dependencies adds friction in that regard. In general, I'd like to maintain the minimal approach of the theme. And of course, any major changes would also need to be configurable.

One possible solution: you could do it in a separate branch of your fork so it can be merged into master if everything looks good. And if it doesn't fit the needs of the theme as a whole, no harm done — you'll have it in your fork for private use anyway. But please don't spend too much effort solely for the sake of the project.

I'm going to close this out for the original issue. if you would like to open a separate issue for search to brainstorm ideas, feel free.