parsiya / hugo-shortcodes Goto Github PK
View Code? Open in Web Editor NEWParsia's Hugo Shortcodes
License: MIT License
Parsia's Hugo Shortcodes
License: MIT License
Create a version of the codecaption shortcode that reads the source code from a file in the data directory.
MIT license comes with conditions of use stating use of any of your snippets (of which people are likely going to copy some not all) must include the license and copyright notice:
As such, it would be a good idea for you to:
README
.Of course you don't have to do any of this. But it would be nice to prevent others from potentially copying this work without the attribution required by your license.
I see a lot of people—even those with years of experience—get this wrong so no worries. Should you decide to do nothing that's fine too just don't expect to see attributions based on your license when the shortcodes included here are ultimately copied by others without meeting the conditions.
There are, of course, other licenses which do not come with the conditions of the MIT license. Ultimately BlackDuck will know so you don't have to. ;)
I don't do a pull request for that, but you can use (with your Scratch use, that is no more necessary)
{{ $.Scratch.Set "wp_title" (replace (.Get 0) "_" " ") }}
Of course it is untested, but I have similar code in my shortcodes.
The blockquote shortcode removes the protocol://
from the start of the link when displaying it in absence of a title. It should also remove the www.
for better visibility.
Be sure to update the screenshot.
The last blockquote is missing a forward slash
Over the past 24 hours I've been reflecting on my life & I've realized only one thing. I need a medieval battle axe.
{{< blockquote >}} <--- here
If scratch variables are not reset, they will keep their value between different shortcodes. If uninitialized that will mess things up.
wp.html and blockquote.html create links. Possibly, others.
Hello, friend!
$subj. Example:
{{< blockquote author="Марк Аврелий" title="Наедине с собой" link="http://www.opentextnn.ru/man/?id=518" >}}
Да живи ты хоть три тысячи лет, хоть тридцать тысяч, только помни, что человек никакой другой жизни не теряет, кроме той, которой жив
{{< /blockquote >}}
If I remove link, title will go away, which is not good in my opinion - one should be able to quote the book without linking.
By the way, thanks for the plugin again, it's amazing.
This is how my relref
snippet does:
[link text]({{< relref "/post/2020/2020-01-01-blog/index.markdown#anchor" >}} "link text")
However, this is bulky and make blog posts unreadable.
Make a shortcode that does it a bit better. I have not decided on the parameters yet but here's an example:
{{< myref title="link text" post="/2020/2020-01-01-blog" anchor="anchor" >}}
should generate the above.
Or I can do positional parameters {{< myref "link text" "/2020/2020-01-01-blog" "anchor" >}}
Hello!
Thank you very much for your blockquote plugin, it's amazing!
However, I found a little difference with original one which I think might be considered a problem:
Here is the source code of fragment:
{{< blockquote author="Paul Graham" title="Write Like You Talk" link="http://www.paulgraham.com/talk.html" >}}
Here's a simple trick for getting more people to read what you write: write in spoken language.
Something comes over most people when they start writing. They write in a different language than they'd use if they were talking to a friend. The sentence structure and even the words are different. No one uses "pen" as a verb in spoken English. You'd feel like an idiot using "pen" instead of "write" in a conversation with a friend.
<...>
You don't need complex sentences to express complex ideas. When specialists in some abstruse topic talk to one another about ideas in their field, they don't use sentences any more complex than they do when talking about what to have for lunch. They use different words, certainly. But even those they use no more than necessary. And in my experience, the harder the subject, the more informally experts speak. Partly, I think, because they have less to prove, and partly because the harder the ideas you're talking about, the less you can afford to let language get in the way.
<...>
People often tell me how much my essays sound like me talking. The fact that this seems worthy of comment shows how rarely people manage to write in spoken language. Otherwise everyone's writing would sound like them talking.
If you simply manage to write in spoken language, you'll be ahead of 95% of writers. And it's so easy to do: just don't let a sentence through unless it's the way you'd say it to a friend.
{{< /blockquote >}}
Now Shortcodes support codecaption and imagecaption, how about tablecaption?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.