-
-
Notifications
You must be signed in to change notification settings - Fork 171
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
theme: add multi column support #716
Comments
would love to see this, too. |
I must admit, it's not something I plan to add in the near future. There are multiple reasons to this:
|
I don't know if this information is helpful: The Hugo Book Theme apparently supports columns via shortcodes. Perhaps these ideas can be utilised? |
On my website my husband implemented the following in
And css:
So the use of this shortcode is not too cubersome:
I use this on a single page on my website with empty middle column, here is the layout rendering: It was indeed borrowed from aforementioned Hugo Book theme 😊 But is standard markdown for table layout not practical for you? |
Where does the css file go and what to name it? Also, are there any other settings to change for this? |
@postb99 not really - using markdown tables you get also separators and alternating line "highlighting", and there are use cases where i just want two or three columns (e.g. a figure and some text aside). @McShelby i'd really like to have this "native" in the theme, but i also understand your hesitation. since i'm already performing some pre-processing w/ pandoc, i'd just need to add the custom css. however, i'd like to keep my customisations in my projects to a minimum :) |
@postb99 Additionally to @cagix comments, the width of the columns is automatically set. This is usually not what you want in a column layout as you want a fixed an reliable distribution of space. @cagix The used shortcode is really basic and easy. While I personally dislike the column divider of Also shortcodewise, such a syntax feels alien. I would rather go with the (probably nested) syntax as with |
@McShelby yeah, this syntax using something quite like but not just html comments is kinda ... ugly (and not really standard markdown). interestingly pandoc's implementation of columns (cf. https://pandoc.org/MANUAL.html#columns) is also using nested divs. |
Is there a way to add a picture with text next to it? Maybe I don't need multi column for this? |
You could try out Hugo's build-in |
I've styled the |
Ah, looks like this just puts some text under the picture. Where you able to get the Colum CSS mentioned above to work with this theme? They mentioned what file to put the html in but not the css. |
Where do you put the css? Is there anything special I need to do to get this to work? |
You can supply your own |
Here is the minimum CSS + template code borrowed from the books theme which can be organized all together in one file and stored as ../shortcodes/columns.html. It can be used as described above in an easy way. Code:
Usage:
|
Did not see an answer this question. I got @JohannOberdorfer 's solution to work, but i need to play around with the column widths. I want full width as shown by @postb99 and i can use flex to adjust column widths. So repeating @DavidVargasxyz 's question. Please advice on how/where to insert the css. Thanks in advance. |
@McShelby : yes, i see where to put the html. But where does the css go? |
|
At this point, I don't plan to add this shortcode to the release for the reasons mentioned above. |
As hugo template engine is quite flexible, both ways are possible: a) The css could either be placed directly in the shortcode (see code example at the beginning of this discussion). b.) css could also be placed in a static/css/custom.css file {{- $assetBusting := not .Site.Params.disableAssetsBusting }} I have written a briefe description which you can find here: |
oops the above statement has been truncated, should be:
|
@JohannOberdorfer : Thank you very much. Appreciate it - will go and work on this avenue now. I do prefer (i am a novice, so its a preference only) the separate css file approach. |
Being able to add multiple columns in a page would be awesome. I would really like to add a paragraph of text next to a picture or have tables next to each other. Is there a solution to this? Can not figure out how to do it with custom shortcodes.
The text was updated successfully, but these errors were encountered: