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

wrong configuration_path with non-default jekyll source #422

Open
krodelabestiole opened this issue Oct 20, 2017 · 6 comments
Open

wrong configuration_path with non-default jekyll source #422

krodelabestiole opened this issue Oct 20, 2017 · 6 comments
Labels

Comments

@krodelabestiole
Copy link

Hello

I cannot access /admin url after having launched the "serve" command (error 500) and I get this message :
Errno::ENOENT - No such file or directory @ rb_sysopen - /path/to/my/website/src/_config.yml: /var/lib/gems/2.3.0/gems/jekyll-admin-0.7.0/lib/jekyll-admin/server/configuration.rb:36:in 'read'

I have to mention that I've changed the jekyll source path to "src" (and destination to "dist"). I find it cleaner this way.
Still, I see no reason for jekyll-admin to look for the _config.yml file in the source path /path/to/my/website/src/_config.yml, since it is in the project root /path/to/my/website/_config.yml.

sorry I don't know ruby. How could I fix this issue ?

@krodelabestiole
Copy link
Author

everything works fine when I define my path the hard way :

# Returns the path to the *first* config file discovered
      def configuration_path
        "/path/to/my/website/_config.yml"
        # sanitized_path configuration.config_files(overrides).first
      end

but I can't change it the good way since I don't understand this line :
sanitized_path configuration.config_files(overrides).first
(line 44 in configuration.rb)

@jekyllbot
Copy link

This issue has been automatically marked as stale because it has not been commented on for at least two months.

The resources of the Jekyll team are limited, and so we are asking for your help.

If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.

If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial.

This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions.

@jameysharp
Copy link

I have the same issue with jekyll-admin 0.8.0 and the setting source: src in my _config.yml, which is at top-level.

As a workaround, things seem to work fine if I symlink src/_config.yml to the top-level copy.

@jekyllbot jekyllbot removed the stale label Jun 3, 2018
@lkjimy
Copy link

lkjimy commented Jun 10, 2018

I have the same problem. We all have basically the same folder structure. Same issue as #451. @jameysharp How do you make the symlink to the root level config? I had to copy the config file to the "src" folder, i suppose you did that too. I don't know how the symlink works.

@XhmikosR
Copy link

Any news on this? I also hit this since I never keep the src files in root.

@ashmaroli
Copy link
Member

I'm afraid this can't be satisfactorily resolved because Jekyll doesn't have a notion of project root.
Jekyll has always looked for config files at the root of the configured source directory.

Here's an excerpt from Jekyll's source code:

      # Get configuration from <source>/_config.yml or <source>/<config_file>
      config_files = override["config"]
      if config_files.to_s.empty?
        default = %w(yml yaml toml).find(-> { "yml" }) do |ext|
          File.exist?(Jekyll.sanitized_path(source(override), "_config.#{ext}"))
        end
        config_files = Jekyll.sanitized_path(source(override), "_config.#{default}")
        @default_config_file = true
      end
      Array(config_files)

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

No branches or pull requests

7 participants