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

Metadata editing not enabled by default #658

Closed
nomicode opened this issue Jan 8, 2014 · 10 comments
Closed

Metadata editing not enabled by default #658

nomicode opened this issue Jan 8, 2014 · 10 comments

Comments

@nomicode
Copy link

nomicode commented Jan 8, 2014

When I create a new Markdown document, the metadata button on the right is not enabled by default. Nor is the "Published" button, which operates on the metadata.

If I edit an existing document with a pre-existing front matter, these UI elements are made available.

But I'd like them to be made available by default with new documents.

I had a look at the configuration options, and I think there might be a way to get this working for files that live under a directory. But I am trying to do this for files that live in the top level directory.

@mikemorris
Copy link
Contributor

@nslater The logic for the metadata button is in https://github.com/prose/prose/blob/master/app/views/file.js#L507-523, which looks like it should show the button if a document is a Markdown file within the _posts or _drafts directory. The assumption is that top level Markdown files will be things like README.md and CHANGELOG.md that shouldn't have metadata - can you provide more detail on your specific use case?

@nomicode
Copy link
Author

nomicode commented Jan 8, 2014

Yep, I'm just creating a regular static site with Jekyll. Not a blog. So I don't have a _posts directory.

@nomicode
Copy link
Author

nomicode commented Jan 8, 2014

From that logic, it looks like if I were to have some defaults defined, then the metadata button would appear. But I am unable to figure out how to add defaults for the top level directory. Is it possible?

@mikemorris
Copy link
Contributor

@nslater Specifying defaults for a root directory should be working now, per #504

@nomicode
Copy link
Author

This doesn't seem to be working.

I used the following config:

prose:
  metadata:
    /:
      - name: "dir"
        field:
          element: "text"
          label: "Dir"
          value: ""
          placeholder: "Root"
          type: "text"
    _posts:
      - name: "dir"
        field:
          element: "text"
          label: "Dir"
          value: ""
          placeholder: "Posts"
          type: "text"
    test:
      - name: "dir"
        field:
          element: "text"
          label: "Dir"
          value: ""
          placeholder: "Test"
          type: "text"

Then I created the following directories: _posts and test.

After reloading the Prose interface, I then I tried the following three actions:

  1. Creating a new file from the root directory
  2. Creating a new file from the _posts directory
  3. Creating a new file from the test directory

And I observed the following:

  1. No metadata button was present
  2. A metadata button was present, and had "Dir" set to "Posts"
  3. A metadata button was present, and had "Dir" set to "Test"

I am using the hosted version of Prose.

@nomicode
Copy link
Author

Oops! Heh.

@nomicode nomicode reopened this Jan 11, 2014
@mikemorris
Copy link
Contributor

@nslater Try "" as the root directory path?

@nomicode
Copy link
Author

Ooh, that works now. Thanks!

One remaining issue: is there a configuration option to turn on metadata editing and the Published button? I would like to enable this for all top-level files.

(One way is to configure a metadata default for the top-level files. But this doesn't make the Published button show up. You have to save the file first and then refresh to see it.)

coboje added a commit to coboje/coboje.github.io that referenced this issue May 4, 2014
@fulldecent
Copy link

Hello and thank you for this issue report. There have been several point releases in Prose since this issue was opened and there has not been much discussion here. I wanted to ask if you could please assist in confirming this is still an issue in the latest version of the product. If it is fixed, please close this issue :-)

Also, if possible could you please

  • Find out if this only affects certain browsers
  • Create a test case -- a list of steps we can perform to reproduce the problem
  • Enable web developer extensions and report the Javascript error message. And when in doubt, be over-descriptive of the bug and how you discovered it.

Since this project is looking for new maintainers (#743), it will be helpful if users can double check the old issues and delete ones that are fixed. This will be super helpful for the new team that works on moving this project forward.

I'm sorry this message is impersonal. And thanks for your help!

@dereklieu
Copy link
Member

Main issue here is closed. Tracking the published button/metadata editor issue in #869

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

No branches or pull requests

4 participants