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
Icon permalinks #137
Icon permalinks #137
Conversation
Was going to tackle some JS here for copy to clipboard, but it's becoming more and more work. Dropping that for now and focusing instead on shipping some iterative improvements. |
@XhmikosR Would love your eyes on this, in particular on how I'm using pages to create the permalinks (not sure if posts make more sense?) and how the new icons layout is shaping up. |
I think this works, but it's far from optimal and I'd like to ask @regisphilibert to have a look when he has some time so that we do this properly in this repo which is smaller :) So, basically we should find a way to automate the icons content pages based on the icons folder, since we already traverse the folder. |
Yeah, manually creating them is a little tough—or at least time consuming. 😅 Thought about doing a data file for it as a "single file source of truth", but wasn't sure how to create the permalink pages based on that. Basing on the icons folder could be cool, too, but I'm obviously not familiar enough with Hugo for that. My hunch before was to make a shell script that would read the list of files and create the I'm also okay shipping not optimal for another alpha release or two and iterating over time :). |
Separated out the renames and moves into #142, merged that, and just rebased here. This is now all about the icon permalink pages and Hugo updates. |
Hi there, I could take a look tomorrow and give you feedbacks if any. |
So I can see you have
For now, the relationship between content file and icon file is based on their matching filename (icon-something.md = icon-something.svg), This involves matching filenames and generating URLs using ProsThis avoids relying too much on ConsBelow Content Structure changeContent Structure A: Each icon is a Page Bundle with an Icon Resource (file)Each icon page could be a Page Bundle, a directory which could shelter its own resources, one being the icon
Content structure B: Only the icons section becomes a Page Bundle with every icons in it.This solution does not require too much change in your content structure. Only to move all the TemplatesRegardless of the Content Structure option chosen, your template would simply grab the icon resource with For the Content Structure B your template for the icons partial would look something like that:
Inside template:
Iside partial
Reco. reading: |
34a2e19
to
e727c93
Compare
Would it be possible, at build time, to generate a JSON file with the icons names as keys, and meta data (categories, tags) as properties under the keys? e.g.
It might be handy for handling the icon search, and for 3rd party libraries importing the SVGs. |
Yes it would. I could help once you're ready. |
First of all I'd like to thank you @regisphilibert for your time. I really appreciate your feedback!
We try to always use the latest version so that's not an issue :)
I think this is the easiest solution and maybe with mounts we can do this without even moving the files? As a first step, I'd like to first fix the layouts. Currently each content file specifies the layout, but we should leverage the layouts hierarchy for this. Do note that the plan is to add category and tag pages later based on the frontmatter values. I think we could probably merge this patch and if you have time you could submit a PR later? This way we would unblock releasing alpha3. PS. I haven't forgotten about your reply in the bootstrap Hugo issue. I'm cleaning up my inbox and I will get back to you soon :) |
Works for me! |
Creates pages for each icon so we can easily add meta tags, categories, etc.
Fixes #44, fixes #85.
Todos
Add download buttonAdd copy buttons to code snippetsTag pages and linked tagsCategory pages and/or category sort on homepage