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

feat: add id to figures to make them linkable. #1475

Merged
merged 2 commits into from
Mar 6, 2020

Conversation

beckerjohannes
Copy link
Contributor

@beckerjohannes beckerjohannes commented Dec 13, 2019

Purpose

Figures used in a technical articles shall have an ID in order to be able to create an anchor link (like headings in native HUGO). See https://gohugo.io/content-management/cross-references/

For a figure:

{{< figure src="image.jpg" title="A caption" numbered="true" lightbox="true" >}}

you should be a able to do the following in markdown text:

This is some awesome text. For more please see [the awesome figure]({{< relref "#a-caption" >}}

Documentation

https://github.com/sourcethemes/academic-www/pull/20

@stale
Copy link

stale bot commented Jan 16, 2020

This issue has been automatically marked as stale because it has not had any recent activity. The resources of the Academic team are limited, and so we are asking for your help.
If this is a bug and you can still reproduce this error on the master branch, please reply with all of the information you have about it in order to keep the issue open.
If this is a feature request, and you feel that it is still relevant and valuable, please tell us why.
This issue will automatically close soon if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 16, 2020
@beckerjohannes
Copy link
Contributor Author

Would please consider merging this pull request? It is a minimal change. I submitted the necessary code and documentation changes.

I am using your theme to write the documentation for an open standard. The articels are often longer and I think it is very useful to have the ability to cross reference figures. Any comments?

@stale stale bot removed the stale label Jan 17, 2020
@gcushen gcushen added this to the v4.8 milestone Feb 3, 2020
@beckerjohannes
Copy link
Contributor Author

You added "needs investigation". Anything with which I can assist?

@gcushen gcushen merged commit f9794e9 into HugoBlox:master Mar 6, 2020
YoungWilliamZ pushed a commit to YoungWilliamZ/hugo-academic that referenced this pull request Jul 29, 2020
Generates linkable IDs for figures by anchorizing the caption and namespacing the figure ID by prefixing it with `figure-` to help prevent conflicts with other existing IDs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants