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

Costum shortcode with css not renderd in hugo production mode #45

Closed
winux1 opened this issue Feb 12, 2021 · 2 comments
Closed

Costum shortcode with css not renderd in hugo production mode #45

winux1 opened this issue Feb 12, 2021 · 2 comments

Comments

@winux1
Copy link

winux1 commented Feb 12, 2021

Hello!
I am using the navigator theme for hugo. I managed to create a costum shortcode with css. When I am running the hugo server command it renders nicely but when I use the hugo command it only renders pure text.
Here is my code and css:
The code:

<div class="shortcode-notice {{ .Get 0 }}">
<div class="shortcode-notice-title {{ .Get 0 }}">
{{- if len .Params | eq 2 -}}
{{ .Get 1 }}
{{ else }}
{{ .Get 0 }}
{{- end -}}
</div>
<div class="notice-content">{{ .Inner | markdownify }}</div>
</div>

The css:

/*=================================================================
Notice Shortcode
==================================================================*/
.shortcode-notice .notice-content {
padding: 0.6em 1em;
display: block;
font-size: 1em;
margin-top: 0;
margin-bottom: 0;
color: #666;
}
.shortcode-notice-title {
color: #fff;
padding-left: 1em;
font-weight: bold;
}
.shortcode-notice-title.note {
background-color: #6ab0de;
}
.shortcode-notice.note .notice-content {
background: #e7f2fa;
}
.shortcode-notice-title.tip {
background-color: rgba(92, 184, 92, 0.8);
}
.shortcode-notice.tip .notice-content {
background: #e6f9e6;
}
.shortcode-notice-title.info {
background-color: #f0b37e;
}
.shortcode-notice.info .notice-content {
background: #fff2db;
}
.shortcode-notice-title.warning {
background-color: rgba(217, 83, 79, 0.8);
}
.shortcode-notice.warning .notice-content {
background: #fae2e2;
}

How can I make it work?
Thanks for your help in advance!

@somratpro
Copy link
Contributor

Hey @winux1
Where did you put the css? can you share your repo with me?

@winux1
Copy link
Author

winux1 commented Feb 13, 2021

Hi!
I was able to make it work I just had to put the css into the shortcode html file

@winux1 winux1 closed this as completed Feb 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants