Does anyone know know why Hugo is generating files in /public that are missing the CSS styling? I’m currently using the hugo-mainroad theme. However, it does it with any theme. Never had this problem before and it’s driving me nuts! Thanks in advance!
@phmullins That is a very broad question. Can you point us to a repository where you’re keeping the site?
I checked here…
<!DOCTYPE html>
<html lang="{{ .Site.LanguageCode | default "en-us" }}">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ .Title }}</title>
{{ with .Site.Params.description }}<meta name="description" content="{{ . }}">{{ end }}
{{ .Hugo.Generator }}
{{ if .Site.Params.opengraph }}{{ template "_internal/opengraph.html" . }}{{ end }}
<link rel="dns-prefetch" href="//fonts.googleapis.com" />
<link rel="dns-prefetch" href="//fonts.gstatic.com" />
{{ if .RSSLink }}<link rel="alternate" type="application/rss+xml" title="{{ .Site.Title }} Feed" href="{{ .RSSLink }}">{{ end }}
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,400italic,700" type="text/css" media="all" />
<link rel="stylesheet" href="{{ "css/style.css" | relURL }}" type="text/css" media="all" />
<script type="text/javascript" src="{{ "js/scripts.js" | relURL }}"></script>
<link rel="shortcut icon" href="{{ "favicon.ico" | relURL }}">
{{ template "_internal/google_analytics_async.html" . }}
</head>
<body class="body {{ if (.Site.Params.leftsidebar) or (.Params.leftsidebar) }}body-left-sidebar{{ else }}body-right-sidebar{{ end }} mobile" itemscope="itemscope" itemtype="http://schema.org/WebPage">
<div class="container container-outer">
This file has been truncated. show original
And it looks like the stylesheet is housed in css
according to how you’ve set your baseURL
in your config
file.
I’d need more info to help you out. Also, if this is a theme-specific issue, you might want to raise an issue on the GitHub for hugo-mainroad.
I hate to admit it but the problem was nothing more than a messed baseurl
in the config.toml file. Thanks everyone!
2 Likes