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

Add shortcode IsNamedParams property #1597

Closed
wants to merge 1 commit into from

Conversation

moorereason
Copy link
Contributor

It would be helpful to know whether a shortcode was called with positional or
named parameters. This commit adds a ParamsType function that returns name
or position.

If this proposed change is acceptable, I can write tests for it.

@bep
Copy link
Member

bep commented Nov 21, 2015

I agree this is useful, but I would just make a bool IsNamedParams -- I fail to see how we'll get a third option in there.

It would be helpful to know whether a shortcode was called with positional or
named parameters.  This commit adds a boolean `IsNamedParams` property to the
`ShortcodeWithPage` struct.
@moorereason
Copy link
Contributor Author

Reworked this PR to change to a boolean IsNamedParams property in ShortcodeWithPage. Tests included. Rebased commits to keep this clean.

@moorereason moorereason changed the title Add shortcode ParamsType function Add shortcode IsNamedParams property Nov 23, 2015
@bep bep mentioned this pull request Nov 23, 2015
@bep
Copy link
Member

bep commented Nov 23, 2015

Merged in fde47c5

Would be nice with 1 line in the documentation about this, see #1607

@bep bep closed this Nov 23, 2015
@moorereason moorereason deleted the sctype branch December 11, 2015 17:34
bep added a commit that referenced this pull request Dec 13, 2021
4eb10c1a9 Set a sensible maxAge on the image cache
2c37f4f89 Update lists.md
8690c018f Update introduction.md
0458c3d88 Update index.md
150982f5e Update index.md
50dc0b6b9 Update multilingual.md
648598090 Configure image cache to use :cacheDir/images
4dfb523c3 Update introduction.md
b94d42e6f Add text to social images
d3253d2aa Add resources/_gen/images/ to .gitignore
8a56e1dfd Delete resources/_gen/images
1521e79b6 Update introduction.md
c7110a597 Update introduction.md
f7c4d220f Update introduction.md
c14ecf1ff Update introduction.md
c4b388c20 Fix shortcode in hugo-pipes/introduction (#1605)
d9876bd68 Update introduction.md
a39a532d5 Update introduction.md
fa8758122 netlify: Hugo 0.90.1
50cc40570 Update Contribute to Hugo Development
fc98fc82c Add .vscode dir to .gitignore (#1602)
8f8bcdefc Add frontmatter param to code-toggle shortcode (#1601)
f3b432c7c Add markdownlint configuration file (#1597)
7ea3aea92 netlify: Bump to 0.90.0
e2b6f990b docs: Regenerate docs helper
c02259e33 Merge commit '8d9511a08f14260cbfb73119e4afae50e5a9966d'
2e3573899 Add custom font support to images.Text
3186e6458 images: Text filter that draws text with the given options (#9239)
424f219eb tpl/transform: Optional options for highlight func
7993f17d0 Implement XML data support
1eb9d34cf Make resources.Get use a file cache for remote resources
8a0fffd56 Add remote support to resources.Get

git-subtree-dir: docs
git-subtree-split: 4eb10c1a9689aebf652011a6260a14bf8a3dcef4
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants