我目前正试图部署一个雨果网站Netlify,但我一直无法。我得到以下错误:
https://cdn.jsdelivr.net/gh/theasteve/blog/master@0.0.1/public/assets/main.js
由于MIME类型(文本/纯文本)不匹配而被阻止
(X-Content-Type-Options:nosniff)。
prism.js
文件和
main.js
文件。
错误显示来自
About
页面,即使删除了脚本标记,我仍然得到一个没有添加任何样式的页面。
<footer class="footer">
<div class="footer__inner">
{{ if $.Site.Copyright }}
<div class="copyright copyright--user">{{ $.Site.Copyright | safeHTML }}</div>
{{else}}
{{ partial "logo.html" . }}
<div class="copyright">
<span>© {{ now.Year }} Powered by <a href="https://gohugo.io" target="_blank" rel="noopener">Hugo</a></span>
<span>Theme created by <a href="https://twitter.com/panr" target="_blank" rel="noopener">panr</a></span>
</div>
{{end}}
</div>
</footer>
<script src="https://cdn.rawgit.com/theasteve/blog/master/public/assets/main.js"></script>
<script src="https://cdn.rawgit.com/theasteve/blog/master/public/assets/prism.js"></script>
<!-- <script src="{{ "assets/prism.js" | absURL }}"></script> -->
# baseurl = "https://theasteve.github.io/"
languageCode = "en-us"
theme = "hello-friend"
paginate = 5
[params]
# dir name of your blog content (default is `content/posts`)
contentTypeName = "posts"
# "light" or "dark"
defaultTheme = "light"
# if you set this to 0, only submenu trigger will be visible
showMenuItems = 2
# Show reading time in minutes for posts
showReadingTime = false
[languages]
[languages.en]
title = "theAsteve"
subtitle = "Lets get it"
keywords = ""
copyright = ""
menuMore = "Show more"
writtenBy = "Written by"
readMore = "Read more"
readOtherPosts = "Read other posts"
newerPosts = "Newer posts"
olderPosts = "Older posts"
minuteReadingTime = "min read"
dateFormatSingle = "2006-01-02"
dateFormatList = "2006-01-02"
[languages.en.params.logo]
logoText = "theAsteve"
logoHomeLink = "/"
# or
# path = "/img/your-example-logo.svg"
alt = "theAsteve"
[languages.en.menu]
[[languages.en.menu.main]]
identifier = "about"
name = "About"
url = "/about"
我注释掉了baseurl,因为在部署到Netlify时没有显示任何内容。这是我的Netlify.toml
[build]
publish = "public"
command = "hugo --gc --minify"
[context.production.environment]
HUGO_VERSION = "0.69.2"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
[context.split1]
command = "hugo --gc --minify --enableGitInfo"
[context.split1.environment]
HUGO_VERSION = "0.69.2"
HUGO_ENV = "production"
[context.deploy-preview]
command = "hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL"
[context.deploy-preview.environment]
HUGO_VERSION = "0.69.2"
[context.branch-deploy]
command = "hugo --gc --minify -b $DEPLOY_PRIME_URL"
[context.branch-deploy.environment]
HUGO_VERSION = "0.69.2"
[context.next.environment]
HUGO_ENABLEGITINFO = "true"
为什么返回HTML?为什么资产没有被编译?