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

Block title not taken into account when block type is not defined in _config.yml #13

Closed
MaximeKjaer opened this issue Jun 5, 2019 · 4 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@MaximeKjaer
Copy link
Collaborator

MaximeKjaer commented Jun 5, 2019

The current implementation of create_resource does not use the title of a block if the block type is not a "default block", and is not defined in the _config.yml

For instance, if I don't specify any configuration in _config.yml and write the following block:

> test "hello"
> This is a test

Then the following will be output:

<div class="premonition test">
	<div class="fa fa-check-square"></div>
	<div class="content">
		<p>This is a test</p>
	</div>
</div>

Seeing that the default template is:

<div class="premonition {{type}}">
  <div class="fa {{meta.fa-icon}}"></div>
  <div class="content">{% if header %}<p class="header">{{title}}</p>{% endif %}{{content}}</div></div>

I would expect a <p class="header"> to be generated as well, but it isn't. Is this intended behavior?

To fix this in the short term, I'm able to do the following config, which makes the plugin generate a <p class="header">.

premonition:
  types:
    test:
      id: test
@lazee
Copy link
Owner

lazee commented Feb 27, 2020

Its actually by design since test is not a box type. Actually I think we should render an error (with tip on how to implement types) instead of the box itself when using an undefined box type.

@lazee
Copy link
Owner

lazee commented Feb 27, 2020

image

Actually this is my suggested solution in the v4 branch

@lazee
Copy link
Owner

lazee commented Feb 27, 2020

34c8bd7

@lazee lazee self-assigned this Feb 27, 2020
@lazee lazee added this to the v4 milestone Mar 5, 2020
@lazee
Copy link
Owner

lazee commented Mar 11, 2020

I'm quit satisified with this solution. Will be part of the v4 release soon #18

@lazee lazee closed this as completed Mar 11, 2020
@lazee lazee added the enhancement New feature or request label Mar 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants