Eleventy not showing blog images in markdown files - eleventy

I've looked through the docs and I barely understand what is going on with image processing; I installed #11ty/eleventy-img and followed the instructions to add eleventyConfig.addNunjucksAsyncShortcode("image", imageShortcode); and the imageShortcode async func provided in the readme docs.
Besides that, I'm not sure what else to do to get images in my blog posts to show (they still don't show).
How can I get the markdown processor to find refs like:
![blah](./images/blah.png) and then replace them with sthg like:
<img src="/path/to/post/images/blah.png"> ?
Any help appreciated. This is the only thing I haven't been able to figure out; rest of the docs are great!

Related

Atom html snippets not working

I have been pulling my hair out trying to finds a solution to this problem.
I start typing <a then press ctrl-enter to open up the available snippets.
I would then be provided with just a list of tags (with the red V icon at the left), I was expecting to see a list of snippets (green right pointing arrow) that could be selected and would auto complete the tag and closing tag.
The same functionality as seen on this blog post (HTML Paragraph) http://blog.atom.io/2015/05/15/new-autocomplete.html
It is my understanding that autocomplete-plus has snippets from autocomplete-HTML, auto-complete-CSS, autocomplete-atom-API, and autocomplete-snippets. And that these are all now bundled by default into the atom.
I have read many blogs and GitHub issues trying to find a solution and none have worked. my snippets.cson is empty (Ignoring comments)and it is my understanding that they are for custom snippets. I do not want custom snippets at the moment, I just want the defaults which are advertised on the autocomplete plus docs
Has anybody else had this issue or would know solutions?
Each Atom snipped has a specific prefix, in case of the <a> tag it is just a (without the < character), so typing atab pastes the snippet body tag.

Webmaster Tools doesn't like my page set pattern

I'm trying to use the highlighting feature on Webmaster tools. I got done filling it out for my page, but when I go and try to create the page set, it doesn't find any files matching the pattern.
The default pattern that google chose is:
http://www.example.com/*/*/*/*
That's not good enough because that's everything on my site.
What I want is this:
http://www.example.com/Team/Schedule/*/*
It can't find this. The first asterisk is just the id, and the second * is the name associated with that id.
I tried adding this:
http://www.example.com/Team/Schedule/*
It can't find anything here either.
This DOES work
http://www.example.com/Team/*/*/*
So, why doesn't the pattern that I want get recognized? I've even tried copying and pasting in the "Team/Schedule" portion to make I didn't misspell, but that still doesn't work.
Edit:
the "template" path that I used for the highlighting looks like this:
http://www.example.com/Team/Schedule/105/Bears
And similar pages would be:
http://www.example.com/Team/Schedule/52/Vikings
This was a result of Google containing an old cached version of my page structures. I had just recently updated the structure, and Google had not re-crawled to get those changes.

Rails : How To Search and Get the First Image from a Post?

I have created a blog with rails. All the posts will contain at least one image. On the Blog page, I need to list all the posts. In this list, I need to add the first image of the post infront of each post. How Can I do this? (Please tell me how. Im new to rails!)
If possible, when there are more than one images, I need to select the image which have the css class "features". If it not there, select the first image. How to do it?
PS : I use CKEditor to write the post and upload images.
I just managed to get the image paths with the regular expression [/img.?src="(.?)"/i,1]. Know how to identify the css class and use the image with the class "featured" if its available?
I am not sure how CKEditor works with all of this out of the box, but here is what I would do.
Checkout paperclip or carrierwave and create the models/columns that you are looking for.
With both of these you can specify sizes which you could use in your views so you code could look like this:
#blog_post.main_photo.small.url if #blog_post.main_photo

How do I link to a LABEL in org-mode?

In org-mode, I have defined a figure+caption like this:
#+CAPTION: My great figure
#+LABEL: fig:myfigure
[[myfigure.png]]
How do I write "See figure [myfigure]"? I've found the following syntax:
See figure \ref{fig:myfigure}
but this looks ugly in the source file. In particular, you cannot use it for actually jumping to the figure.
You actually don't need '#+NAME', it works fine if you use '#+LABEL', which won't break your short-caption for list of figures.
Orgmode does now offer a 'jumpable', enumerated or link with name of your choice in the exported (latex, html) text if you link with:
see figure [[fig:myfigure]].
or
see figure [[fig:myfigure][figurenameintext]].
I would have added this as a comment, but I don't have the reputation yet.
--
In response to your comment (still can't comment): you do need the '#+NAME' for it to jump within the .org source file; as mentioned in the manual, and i also just confirmed that works. Not sure about the short-captions in the latest version.
With a very recent org-mode, you can use #+name:, see:
http://thread.gmane.org/gmane.emacs.orgmode/62644/focus=62646
#+CAPTION: My great figure
#+LABEL: fig:myfigure
#+name: fig:myfigure
[[test.png]]
See figure [[fig:myfigure][test]].
This works for me to jump from the link , but has no effect when exporting, I'm afraid...

Rails: Embed metadata in templates – YAML in my HAML?

I would like to be able to set things like the page title and <meta> description from within HAML “pages” served up by my static page controller.
Is there a good way to do this? Ideally, I see it working something like:
Name files like about_us.html.haml.yaml
Use the normal render method
But now there is a hash of metadata available to my controller and layout templates, which set various headers and elements, respectively.
Thoughts?
(Since no one contributed a full answer)
If you want to set up title, description, noindex or similar tags in the head, then github.com/kpumuk/meta-tags is the best way to do it! I've used in a various projects, and think it's best gem ever for manipulating with title, description and other stuff that sits in the head tag.
— Dmitry Polushkin
It seems to work well for me, though it is a touch less powerful than what my question was looking for. Further answers welcome.

Resources