Showing file name in Jekyll with Pygments code highlight
By : albx
Date : March 29 2020, 07:55 AM
hop of those help? When highlighting a standard file at a known location I'd like to put the file name in the code block; preferably at the top. A hypothetical example would be , You can simply use the nice html5 figure tag. code :
<figure>
<figcaption>File: folderName/fileName.rb</figcaption>
{% highlight ruby %}
def print_hi(name)
puts "Hi, #{name}"
end
{% endhighlight %}
</figure>
|
Browser showing 200 status code and showing as cached
By : dummy
Date : March 29 2020, 07:55 AM
I wish did fix the issue. This is the expected behaviour. By using expires [some-date-in-the-future] you're basically telling the Browser to use it's local cache to serve the request until that date is reached. The Browsers local cache answers with a 200 OK response, since that's what the Protocol expects if a resource is successfully fetched.
|
jekyll yaml code not showing in markdown file
By : Harshavardhan N
Date : March 29 2020, 07:55 AM
Any of those help if I understand you correctly, you need to display liquid code in a liquid (Jekyll) template. If so, you need to wrap your code in a {% raw %} tag like this: code :
```
{% raw %}
{% assign features = site.work | where:"featured", "yes" | sort:"featured-rank" %}
{% endraw %}
```
|
Jekyll: how to not interpret jekyll / ruby lines in a code snippet (rouge)?
By : Ediosn
Date : March 29 2020, 07:55 AM
it helps some times I have this snippet of code in a Jekyll post: , Surround code with code :
{% raw %}
{% endraw %}
|
Posts not showing correctly on jekyll (multiple site) blog -- only post code
By : acristi
Date : March 29 2020, 07:55 AM
I hope this helps . blog.md is a markdown file. In markdown a four space indentation represents code or preformatted text. Kramdown will wrap this code in tag, resulting on what you actualy see on your site. code :
{% for post in site.posts %}
{% if post.categories contains 'blog' %}
<div class="post">
<h3 class="title"><a href="{{ post.url }}">{{ post.title }}</a></h3>
<p class="meta">Date: {{ post.date }}</p>
<div class="entry">
{{ post.content | strip_html | truncatewords: 100 }}
</div>
</div>
{% endif %}
{% endfor %}
|