Closed sawilde closed 3 years ago
Hey @sawilde! Thanks so much for this excellent contribution. Please give me a couple of days to review it in detail. It's nice that you made a new packages, so it can be easily switched on/off. One question upfront: Where does the data for TagIcons, TagHeaders, etc. come from? I'd prefer to have this configured in Ghost as much as possible.
TagIcon - implemented the same way as TwitterIcon (in fact it is just a copy of, as I don't have a good source of free svg icons.) - this needs some tinkering - the alternative is to add it to the menu like the contact plugin - I am not sure there is a place in Ghost to configure this.
TagHeader - currently the data is in a localisation file - which is why I created that piece as a separate component to allow it to be overridden. This is the first pass at turning it into a plugin and it may be possible to pass in the config for the title via the options - again not sure if such a place in Ghost exists for this.
tags.js - currently this is a page (as that is how I currently host it) but looking at the other plugins I think I may need to inject it as a PageNode (similar to contact) but I need to get my head on how that works.
All the other information for the tags (title, image, description, count) comes from the ghost CMS itself - add an image to the tag in your ghost blog that is being used as reference. Add more tags and you get the 1,3,2 pattern and infinite scroll.
@styxlab - some updates
tags.js is now a template and is being added as a page (pageNode) - title and path pulled in via config - ditched the dodgy language translations (I assume people can now configure this in the config)
TagIcon is gone and I am now using FontAwesome and using the faTags icon (the attribution is in the svg and so good)
Renamed some of the components
@styxlab added ability control Icon visibility - I haven't added it as a navigation entry yet 2 ways
contacts
plugin appends its entry to the navadding it to the navigation menu (as contact does - or perhaps doesn't) will take time.
I tried disabling the hook for contact by updating the setting as navigation: []
and the contact menu entry remained
navigation: []
handling as the endpoint /tags
can be configured in Ghost to display a navigation link.I think I have done what I needed to for this
Please be patient with me as I need a couple of days before I can do my final tests, merge and publish.
no worries - how do you publish the packages once they have merged? Do you have a separate build pipeline?
Thanks so much @sawilde ❤️!!!
This package still needs to be published to npm....
Finally published on npm. Sorry for the delay and thanks again for your contributions!
thanks and it was a pleasure
new theme package to show all the tags as a collection of pages, similar to how posts are displayed in the main page
I am not keen on how I have hooked in the tags page - I hope there is a better way.
I have been using this code on my own site for about a year and had no issues - only just converted to package though so feedback appreciated as it is probably a little rough for general consumption.