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

Improve control over detail pages #153

Open
davidchisnall opened this issue Jun 16, 2016 · 16 comments
Open

Improve control over detail pages #153

davidchisnall opened this issue Jun 16, 2016 · 16 comments

Comments

@davidchisnall
Copy link

Since I updated Jekyll Scholar, I'm getting "Details" links that don't go anywhere. I already extract a number of fields from the BibTeX and format the equivalent in a more expressive way, how do I turn this off? It has also broken the page that generates a clean BibTeX file for people to download, as now the .tex file contains a load of mismatched quotes.

@inukshuk
Copy link
Owner

Do you know from which version you upgraded? I'm sure this would help us to figure out what's causing the change.

@davidchisnall
Copy link
Author

I'm using 4.5.0 on a remote machine and that works as I expect and I was using 5.0.0.pre.1. I'm now using 5.8.2, and that appears to be adding the details stuff. I tried setting the details_ variables to nothing, but I then get Jekyll dying with an error that it can't cast null to a string.

@inukshuk
Copy link
Owner

OK thanks.

So, the issue is that 'details' links are being generated, which were not generated previously (and this should not happen or there should be a way to turn it off), yes?

I'm not sure I understand the second part; you have a page that generates a BibTeX file? This is something you're doing yourself (how?) or are you using the entry.bibtex which scholar exposes to the template?

Do you think you can provide failing test cases for the issues? (See here for examples)

@davidchisnall
Copy link
Author

So, the issue is that 'details' links are being generated, which were not generated previously (and this should not happen or there should be a way to turn it off), yes?

Yes, I have done nothing to enable details, but I am still getting Details links.

I'm not sure I understand the second part; you have a page that generates a BibTeX file? This is something you're doing yourself (how?) or are you using the entry.bibtex which scholar exposes to the template?

I'm using entry.bibtex to generate the BibTeX for each entry and have a trivial template that just grabs this and strips out the HTML markup to give me a BibTeX file (it's useful for generating a BibTeX file that orcid can consume, as it doesn't like some of the extra metadata that I have in the entries and has terrible error reporting so I don't know which ones. This mechanism gives me a simple and clean BibTeX file).

Do you think you can provide failing test cases for the issues? (See here for examples)>

I don't know how to read those, but I have a config that makes no reference to the details feature at all, yet it still appears to generate a link with the text "Details" and the link target of bibliography/{BibTeX ID of the reference}. It is also generating a bibliography/ directory in my output directory and populating it with empty files, one per BibTeX file. I don't want this, as my style puts all of the useful information (abstract, BibTeX) inline in the publications pages with some CSS / JavaScript to hide and show them.

I would expect to only see the details links and pages if I have explicitly asked for them to be generated.

@inukshuk
Copy link
Owner

Hmm, I added a test case to ensure that details pages and links are not rendered by default -- which passes. So I'm guessing there is something in your configuration that triggers this.

Details pages are generated if you provide a details_layout -- this is called bibtex.html by default (you can change it using details_layout in your config). Given that you're generating bibtex pages, my guess is that you have a bibtex.html in your layouts folder. To fix this you could set details_layout to something else. However, I don't think this is something that was added between 4.5 and 5.8 so it doesn't explain why this happens after the upgrade.

@i2000s
Copy link

i2000s commented Jul 20, 2016

Same here. Any way to turn off the Detailed page link in citation/reference lists?

@inukshuk
Copy link
Owner

Like I said above, details links are only generated by default if you have a layout that matches the layout specified by the details_layout setting. By default this is 'bibtex'; so if you want to use a layout called 'bibtex' you need to set details_layout to something else (or rename your layout).

@i2000s
Copy link

i2000s commented Jul 20, 2016

Sorry for taking your time. Just to make my question clear. I want to have details pages on one post page with my own publication bibtex source file, while I don't want to have the detailed pages and links shown for references on another post. I understand that using a non-bibtex.html name for the details_layout will globally turn off the option to generate details pages and showing the links, but is there any switch to turn on and off at where I generate the bibliography list?

This tool is good to generate a bibliography for a list of stuffs at once, but it would be nice to have more buttons to tweak around for generating citation lists. Maybe it's there I just don't know how to use. Thanks.

@inukshuk
Copy link
Owner

Ah, that's a good point. You're right, the details feature can only be activated for everything at the moment. This is probably for legacy reasons: when we added the feature there was just a single bibliography I believe. Plus, detail pages use a generator which runs before the individual pages are built I think... so it's sort of all or nothing at the moment. Having said that, it can't be too difficult disabling at list the links at more granular level. I think that would certainly be a good addition.

@inukshuk inukshuk reopened this Jul 20, 2016
@i2000s
Copy link

i2000s commented Jul 20, 2016

Just a followup. I tried to use different *.bib files with the --file option in citations, and found that for some reason files other than the one defined in _config.yml could not generate individual details pages. There may be a problem with my bibtex.html layout file, but I feel most likely if the details page switch can be turned on and off on the file level, that will solve the problem. Let me know how can I be helpful on this issue.

@inukshuk
Copy link
Owner

The details are only generated for the main bibliography specified in the config IIRC, so there is not problem with your setup (the details generator was implemented before the --file option existed I believe).

Unfortunately, I don't have the time to work on this now, but for future reference, we want to

  • be able to toggle detail links for each bibliography tag
  • if detail pages are enabled, we would like to generate pages for every file being used

Correct?

@JoostvanPinxten
Copy link
Collaborator

Would it be sufficient to specify a list of bib files in the config, so that at least all the listed files have details pages generated? And then add a tag to allow references to be rendered with or without the details link. I think that should be the least invasive modifcation...

@inukshuk
Copy link
Owner

It's been a long time, but glancing over the Jekyll docs they mention that 'Generators run after Jekyll has made an inventory of the existing content, and before the site is generated.' -- if I am not mistaken this means that there is no way to know all the files which are used by bibliography tags, because they have not run at the point in time when we need to generate the detail pages. (Obviously there are ways around this, but I imagine it might get complicated quickly.) So yes, if that's the case then your suggestion is probably the best solution for us. To add an explicit list of bibtex files for which detail pages shall be generated and, additionally, add a separate setting for whether or not to generate details links which can also be overridden per tag.

@inukshuk inukshuk changed the title Disable details? Improve control over detail pages Aug 28, 2016
@inukshuk
Copy link
Owner

Also see #52

@alessandropellegrini
Copy link

I want to revive this issue, because I think that a bit more control on the details page generation would be beneficial. In particular, I think that the capability to generate details pages and to automatically add the link to details pages in the bibliography list should be separated.

I have a very complicated setup of this plugin, which tries to mimic what dblp does on an author page, plus the ability to show the bibtex entry in a dialog.

To reach this goal, I had to tweak hardly scholar to remove all forms of automated lists, to rely on a custom style, and to provide the whole logic to generate a proper entry in the bibliography_template. In particular, I am using a div both for bibliography_list_tag and bibliography_item_tag (so that I can style my entry with no annoyance in the bibliography_template).

The problem I have been facing is twofold. Since I cannot style the divs with a class, for proper spacing I have an additional div in the bibliography_template, which adds proper space at the end of an entry. I like details pages (e.g., because this allows to create complicated metas for helping Google Scholar at properly indexing the papers). But I want to have a link exactly where I want in the entry. While this can be done by relying on the {% details_link key %} tag in the bibliography_template, it was leaving an extremely spaced and unnecessary link at the end of every entry.

To work around this, I have in my main layout template the following:

{{ content | regex_replace: '\<a class\="details" href\="\/publications\/.*\.html"\>DetailsToRemove\<\/a\>', '' }}

This is extremely hackish, totally tailored for my site, and it slows down significantly the generation. Yet, it works. But it would be much easier to prevent the generation of the links, rather than removing them later.

TL;DR

  • I want to generate details pages
  • I don't want to automatically include the links in the bibliographic entry

An option like details_link_output: false in _config.yml might do the job?

@robgjansen
Copy link

robgjansen commented Jun 21, 2023

I found that you can specify multiple bib files in your _config.yaml like this:

# Bibliography settings
scholar:
  bibliography: "*.bib"
  ...

and then if you have the details generator enabled it will generate details pages for all entries in all of the bib files in _bibliography.

Then you can list all of your articles, including link to each of their details pages, e.g. like this:

<h2>Journal Papers</h2>
{% bibliography --file journals.bib %}
<h2>Conference Papers</h2>
{% bibliography --file conferences.bib %}
...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants