Skip to content
Discussion options

You must be logged in to vote

Here is the solution:

- template:: .add-prop
	- ```javascript
	  ``{
	    function addPropertyToContent(content, propertyName, propertyValue) {
	      const newContent = content + (!content.toLowerCase().includes(`${propertyName}::`) ? `\n${propertyName}:: ${propertyValue}` : '')
	      return newContent
	    }
	  }``
	  ``addPropertyToContent(c.args.content, c.args.property, c.args.value)``
	  ```
- template:: assign-project
	- ```javascript
	  ``{  
	    const content = await include('.add-prop', `:content ${c.currentBlock.content}, :property project, :value [[>/Or/Projects/${cursor()}]]`)
	  }``
	  ``content``
	  ```

Notes

  • I've drop block update to simplify code. Now it cannot be us…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@mjkaye
Comment options

@stdword
Comment options

Answer selected by mjkaye
@mjkaye
Comment options

@stdword
Comment options

@mjkaye
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants