question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Theme assets broken when hosted on GitLab Pages

See original GitHub issue

This is from the browser console:

The resource from “https://foo.gitlab.io/docs/assets/codedoc-styles.css” was blocked due to MIME type (“text/html”) mismatch (X-Content-Type-Options: nosniff).

Note: foo is not the real project name.

The published site is missing js and styling due to this error.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
loreanvictorcommented, Mar 4, 2021

@oxr463 perhaps setting the project namespace resolves the issue? to the best of my (limited) understanding, you should set it to the repo name:

import { configuration } from '@codedoc/core';

import { theme } from './theme';


export const config = /*#__PURE__*/configuration({
  theme,                                  // --> add the theme. modify `./theme.ts` for changing the theme.
  dest: {
    namespace: '<repo-name>',
  },  
  page: {
    favicon: '/favicon.png',
    title: {
      base: 'Foo'               // --> the base title of your doc pages
    }
  }
});
1reaction
loreanvictorcommented, Mar 4, 2021

The problem appears to be due to this issue. @oxr463 could you please also comment the contents of .codedoc/config.ts here?

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitLab Pages doesn't load assets when using absolute paths
Summary GitLab Pages won't load assets when using absolute paths for CSS/JS files in href. Using relatives paths will work:
Read more >
CSS styles and links are not working on jekyll deployment with ...
After having problems saying that the theme could not be found, when I solved the issue, now the webpage is deployed but CSS...
Read more >
Discussions · CONNECT-platform/codedoc - GitHub
Discussions · gh-branch stayes empty with the current setup and the use of "deploy-to-gh-pages.yml" · Theme assets broken when hosted on GitLab Pages...
Read more >
Host on GitLab - Hugo
GitLab makes it easy to build, deploy, and host your Hugo website via ... assets to GitLab or keep your output website in...
Read more >
Known issues · Cloudflare Pages docs
After you have selected a GitHub/GitLab repository for your Pages application, it cannot be changed. Delete your Pages project and create a new ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found