Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting content-type isn't working #134

Open
csimmons0 opened this issue Oct 6, 2016 · 3 comments
Open

Setting content-type isn't working #134

csimmons0 opened this issue Oct 6, 2016 · 3 comments

Comments

@csimmons0
Copy link

I've been unable to set files' content-type. Is this a known issue? I tried debugging it by putting some print statements inside of the "def content_type" statement in resource.rb, and it looked like the Middleman::S3Sync::content_types dictionary was completely empty no matter what I put in s3_sync.content_types in config.rb. It also looked like the local_path variable used as a key to that dictionary had values other than what I expected. Instead of "index.html," for example, its value would be "build/index.html."

@cpence
Copy link

cpence commented Feb 4, 2018

+1 to this for me, too. I think that Middleman::S3Sync::content_types is an error; it should be options.content_types?

@cpence
Copy link

cpence commented Feb 4, 2018

I can monkey-patch this to work by adding:

module Middleman::S3Sync
  def self.content_types
    {
      'build/travel/data.geojson' => 'application/json'
    }
  end
end

to the config file, if that helps anybody else who finds this bug (where build/ is my build directory). But that's definitely not how this feature is supposed to work!

@ndorfin
Copy link

ndorfin commented Jul 9, 2018

I've issued a PR (to address this issue) that could do with some help. See: #153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants