My latest contribution to Blockpress has been to add support for steem post content. To demonstrate this I added, as seen in the highlighted code segment in the above screenshot, a link to the menu of my original steem introduce yourself post, Ahoy There!.
See it in action
Blockpress doesn't yet have permalink support(*), so you will have to visit anton.blockpress.me and then click Ahoy There from the menu. Blockpress then uses steem-js to get the markdown for this post from the steem blockchain. To parse this into html I added support for the showdown javascript library to blockpress.
Blockpress then includes the content on the page. Support for other post related fields, such as title, author, post date, votes, etc, and an option to display comments will be added, but for now just the main content displays.
(*) it is on my agenda, I just haven't gotten around to it yet.
My commit in github
All my changes to implement this basic post feature can be found in one commit on github.
Changes in the commit include
- External libraries used, such as
steem-js
andshowdown
, are now kept separate from modules in a speciallib
folder. Thejquery
library should probably be moved to fit this new pattern. This means that if another module needs steem-js or showdown libraries, they won't rely on thesteem
module being installed, or have to duplicate the libraries. - I created the default steem post html template. This defines areas for content not yet supported, but which we plan to support. An individual theme may altar this layout by including a file of the same name. The code will look for a version in the current theme first and only load the default if one can't be found.
- Most of the work was in
modules\steem\steem.js
. This involved adding the functions that are activated when a steem post link is activated. These get the template, use the steem api to get the post content, put the template in thecontentArea
, parse the mardown into html, and put the resulting post into the relevant section of the page. It will be here that additional information from the steem post object will be used to add information about the author, title and postdate. - I also made some basic adjustments to the default
dark
style to accommodate the new type of content. I expect @dana-varahi will tidy this up further later.
Where next?
Whilst @dana-varahi extends the profile and post fields supported, I will concentrate next on creating a list of posts given a username and/or tag. Once I have these three steem content types supported I will then be able to create links between them. Click on a post in a list of posts and bring up the post content. Click on a username in a post or post list and go to a profile. Click on a tag in a profile about or a post and go to the post list for that tag.
Once we can link between these kinds of content, that will be when blockpress becomes really exciting...
Posted on Utopian.io - Rewarding Open Source Contributors
Glad to hear that the project is progressing! My best regards to Dana!
I've had a small break due to 1) Travel to attend funeral :( , 2) A slight cold :/ and 3) Enjoying the first real snow o the year! :D But today I started work on getting blockpress to display a list of posts. So progress has resumed... :)
Awesome! you finally did it!
Still more to do to make it useful, but we're getting there. Really excited by our progress.
Keep us posted! Because I can see huge potential of appreciation. Especially if it can look nice as a WordPress widget.
I can already how I can introduce this widget as a content marketing platform and at the same time onboard business/entrepreneurs onto steem.
Hmm. A wordpress widget? I suppose it could be made to work as one. To be honest though, if I was building a wordpress widget for steem content, I'd probably tackle the problem a slightly different way.
Owh.. You did not have that in mind? Perhaps you can put that in the pipeline? As that's what I can think of as a non programmer. Of course any other ways works.
Hey @antonchanning I am @utopian-io. I have just upvoted you at 7% Power!
Achievements
Suggestions
Human Curation
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]