samvincent / jekyll-haml Goto Github PK
View Code? Open in Web Editor NEWHAML html converter for Jekyll
License: MIT License
HAML html converter for Jekyll
License: MIT License
Hi I'm new to Jekyll and liquid tags (but not HAML). With this plugin, I can pull in a basic haml partial using
{% haml footer.hml %}
My problem:
The default Jekyll index page fails to compile when I try to convert index.html to index.haml. How should it be written? This is what I have...
%div#home
%h1 Blog Posts
.posts
{% for post in site.posts %}
%li
%span {{ post.date | date_to_string }}
»
%a{:href => "{{ post.url }}"}
{{ post.title }}
{% endfor %}
What am I missing? Thanks!
In jekyll 3.1.6 _layout haml is not working.
_layouts/test.haml
!!!
%html
{% include head.html %}
%body
{% include header.html %}
.page-content
.wrapper
{{ content }}
{% include footer.html %}
This does not get converted but the includes are working.
Would it be possible to report line numbers when there is an error in parsing HAML?
So I have an issue where excerpts seem to end up causing errors because they aren't gracefully merged with the whitespace-awareness of haml. My workaround so far has been to explicitly define excerpts in the front-matter, but I feel like there's a better solution. I would gladly submit a pull request if anyone could give a thought on how they would like it to work.
I'm getting the following error when I build:
jekyll 3.3.0 | Error: undefined method 'transform' for #<Jekyll::Renderer:0x007fd77d960f58>
I don't get the error and my site builds successfully when I comment out the jekyll-haml gem.
When trying to run jekyll build
I am receiving HAML parse errors, but they don't mention the file/line number which makes troubleshooting difficult.
$ jekyll build
Configuration file: /Users/bm5k/projects/blog/_config.yml
Source: /Users/bm5k/projects/blog/www.blog
Destination: /Users/bm5k/projects/blog/_site
Generating... (haml):114: Inconsistent indentation: 7 spaces used for indentation, but the rest of the document was indented using 2 spaces. (Haml::SyntaxError)
$ haml index.haml index.html
Syntax error on line 119: Inconsistent indentation: 7 spaces used for indentation, but the rest of the document was indented using 2 spaces.
Use --trace for backtrace.
When setting the markdown: redcarpet
option in _config.yml
, it would be nice & desirable that this module would also be aware of this option, and switch the HAML markdown renderer to use redcarpet.
The current solution involves adding an extra plugin manually.
(feature request)
jekyll-sass has a "compile_in_place" flag allows compilation of scss files into css files side-by-side in the jekyll source directory as well as the destination directory. This is very handy for use with GitHub Pages. Could we also have this for jekyll-haml?
This doesn't seem to play nice:
%img{src: "{% asset steps1.jpg %}"}
Conversion error: Jekyll::HamlConverter encountered an error while converting '_posts/post.haml':
(haml):1: syntax error, unexpected tIDENTIFIER, expecting ')' ...e1a6cc8bcbc5bb0085de30e4a378bed.jpg">")).to_s);; _hamlout.bu... ...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (haml):1: syntax error, unexpected ')', expecting end-of-input ...085de30e4a378bed.jpg">")).to_s);; _hamlout.buffer << (">\n".... ... ^
Given a Gemfile:
"""
source "https://rubygems.org"
gem "jekyll"
group :jekyll_plugins do
gem "jekyll-haml"
end
"""
And `foo.haml` containing `%h1 Foo`
When I run `jekyll b`
Then `_site/foo.html` doesn't exist
And `_site/foo.haml` does exist
Jekyll 3.2, 3.3.0, and latest JH. Not sure what's wrong.
I am using this plugin with guard-jekyll. I get this error whenever I try to use the partial syntax from a page template.
# index.haml
{% haml navbar.haml %}
It works fine when I use it from a layout template
# _layouts/default.haml
{% haml navbar.haml %}
Great gem! But I'm having a problem I can't seem to figure out.
I'd like to be able to pass a variable to my includes but it interprets everything after haml as the file name.
{% haml comments.haml author="tom" %}
=> interprets comments.haml author="tom"
as the file
{% include comments.html author="tom" %}
=> how it would work with html
I think the cause is related to https://github.com/samvincent/jekyll-haml/blob/master/lib/jekyll-haml/tags/haml_partial.rb#L8 where file
really refers to an options string, with the first part being the file.
Let me know if I'm just missing something, or if you'd be interested in a PR. Thanks!
Hello! First off thanks for creating this, love it!
The issue I'm having is that when I use liquid to assign a value to a tag attribute it's not being interpolated correctly. For example:
%a.button.filled.color-yellow{ href: "{{ '/venue' | relative_url }}" }
is returning an anchor with an empty href attribute. However if I move that liquid tag into the contents of the anchor it renders correctly.
Any assistance you can provide?
I'm using the technique described by Jekyllrb called Named folders containing index HTML files to do subfolders to Clean URLs.
Unfortunately the gem isn't converting any files in the subfolder with the .haml extension, so I'm getting a 504 Forbidden because the browser tries to access the subfolder since index.html doesn't exist.
The haml file still shows up in the rendered _site folder.
Any ideas?
The following code is meant to change the attribute quotes from the default single quote ('
) to double ("
), however it has no effect when called from another (custom) plug-in.
Haml::Template.options[:attr_wrapper] = '"'
Is there another mechanism to specify options for jekyll-haml?
Hey everyone,
I'm having an issue with my haml layouts not being rendered. My setup is a _layouts/default.haml
:
!!!
%html
%head
%title title stuff
[...]
%body
= "{{ content }}"
and an index.haml
:
---
layout: default
---
%i Hello world!
When I run jekyll serve --watch
and head over to localhost:4000 I see that the default.haml
is just being outputted haml (it's not being compiled) {{ content }}
is outputting the compiled haml as html (as it should).
Any ideas as to what would be causing this? I'm not sure if I overlooked something or not, so hopefully this is a silly mistake on my part...
Thanks in advance, and keep up the great work on this project!
โ Steve
How would you use if statements?
| {% if page.tags %}
meta[name="keywords" content="{{ page.tags | join: ', ' }}"]
| {% endif %}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.