Skip to content

viewdocs.io should serve template support files (js, css, json, appcache) #21

@marfarma

Description

@marfarma

Currently attempting to link to http://{{user}}.viewdocs.io/{{name}}/assets/app.js returns 404 - file not found. Github's anti-hot-linking provision prevents the use of http://raw.github.com/{{user}}/{{name}}/docs/assets/app.js As a workaround I've added my script code to my template using a script tag. The same issue exists for css and json files. While that's not too bad, what's really awful is that I've had to do the same with my customized bootstrap.css - add it to the head in a style tag.

And while json files don't suffer from Github's anti-hot-linking provision - they are subject to same-origin restrictions via ajax access - leading me to embed json in a markdown file, and then parse it out from the rendered template after it's fetched from the server. This is further made difficult by the attribute stripping from markdown included html - see my other issue.

Are image files served? I haven't tested that yet. If not, and they can't be hot-linked, they should also be supported.

If security is a concern, perhaps enforce that non-markdown files served must be included in a manifest file at the same location as the template (whether or not the template includes a manifest tag), or only server files local to the docs directory and it's children?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions