HugoBlox / hugo-blox-builder

🚨 GROW YOUR AUDIENCE WITH HUGOBLOX! 🚀 HugoBlox is an easy, fast no-code website builder for researchers, entrepreneurs, data scientists, and developers. Build stunning sites in minutes. 适合研究人员、企业家、数据科学家和开发者的简单快速无代码网站构建器。用拖放功能、可定制模板和内置SEO工具快速创建精美网站!
https://hugoblox.com/templates/
MIT License
8.38k stars 2.91k forks source link

LF or return in abstract? #198

Closed HughP closed 7 years ago

HughP commented 7 years ago

Greetings,

I am trying to use Markdown in the abstract field. is this permissible? the specific issue is that I want to use two paragraphs but I don't know how to break them. I have tried \n and \s\s. I don't know where to go with this.

ghost commented 7 years ago

does < b r > (remove spaces) work?

HughP commented 7 years ago

neither <br> nor <br/> break the lines or create paragraphs. Oh, I also tried the markdown method of two spaces and then a return. but the return character kills hugo and the site won't render. aka the command line spits out an error.

gcushen commented 7 years ago

The IEEE/Springer journals and proceedings I read all tend to enforce a single paragraph abstract. What is your use case for needing line breaks in the abstract - is this common in other fields such as medicine?

HughP commented 7 years ago

I work in linguistics, technology, and language study. Just a quick look through my first 30 citations in Endnote revealed 2 with lists in the abstract. That was actually my use case, needing lists, not additional paragraphs.

Here are some proper abstracts with multiple paragraphs not just lists:

HughP commented 7 years ago

on a technical level I tried to add the markdownify code to abstract but that did not solve my issue. any pointers or ideas?

HughP commented 7 years ago

Resolved with the following code (also see comment in #201 as there are 3 places in the theme that need to have the | markdownify filter applied):

 <div class="pub-abstract" itemprop="text">
        {{ if .Params.abstract_short }}
        {{ .Params.abstract_short | markdownify }}
        {{ else }}
        {{ .Params.abstract | markdownify }}
        {{ end }}
      </div>
ShaminderSingh commented 7 years ago

Hi HughP; I am a newbie in this. Can you please let me know which one is the simplest solution to make separate paragraphs and how exactly should I do. I have downloaded my_website following steps on George's website. I do not see anything in my_website > Layouts. However, there are bunch of .html files in my_website>themes>academic>layout. Please help!

mcoster commented 7 years ago

Hi @ShaminderSingh - this fork does what you want. It markdownifys abstracts in layouts/partials/publication_li_detailed.html and layouts/publication/single.html

gcushen commented 7 years ago

The requested behaviour (parsing Markdown in abstracts) has now been added in #238.

ShaminderSingh commented 7 years ago

This worked! Thank you!

basille commented 7 years ago

I see that indeed Markdown can now be used in the abstract (as long as it remains a single line). So what is the way to go for a list? If I write: "1. First item.<br />1. Second item.", it combines everything in a single li element:

<ol>
<li>First item.<br />2. Second item</li>
</ol>

How can I have a true list, with different li elements? (I tried using \n or other escape characters without success)

gcushen commented 7 years ago

@basille List in abstract is possible using following code:

abstract = """- item 1 \n- test 2 \n- test 3"""

Or numbered list:

abstract = """1. item 1 \n2. test 2 \n3. test 3"""
basille commented 7 years ago

Excellent, thanks @gcushen. I thought I tried the use of \n, but I seem to have missed it.