Using thumbnails in posts generated by thumbnailer plugin - restructuredtext

I've recently moved to Pelican for my blog. I'm writing my posts using rst. I'm now using the thumbnailer plugin to create thumbnails for my posts, the idea being that these will then link to the complete picture. The file looks like this:
|Some reference to image|
text
text
.. |Some reference to image| image:: {filename}images/my-image_small.png
:target: {filename}/images/my-image.png
The tree structure is line this:
[asinha#localhost blogdir]$ tree
.
├── content
│   ├── images
│   │   └── my-image.png
│   └── some-post.rst
└── output
3 directories, 2 files
The issue here is that both image references are supposed to refer to paths in the content/ folder, but the thumbnailer plugin creates images in the output/ folder. So, when pelican runs, it doesn't find the thumbnail images and just replaces them with the alternate text. Even if I remove the {filename} part from the thumbnail specification, it doesn't work, since then it thinks the image should be in output/$postdir/images. How is this supposed to be done? What am I missing? Is what I want not the purpose of the plugin (and what is?)?

I think what you want to achieve is not natively supported by the plugin.
The thumbnail generating part of the code code seems not to tell pelican about the relation of thumbnail and image file.
Nor does it tell pelican at all about the thumbnails in output.
Consequently, linking to the thumbnails has to happen statically.
As of lines 186ff the creation of a gallery which connects thumbnail and image uses manual path operations to get from one file to the other.
This does second the above conclusion of pelican knowing nothing about the thumbnails in output.
I see the following options:
Improve the plugin.
Create a custom rst directive, say tnimg, which realizes what you outlined in your rst code in python. Here, you could do the same as the thumbnail plugin does in its gallery generation code to connect the original image filename with the thumbnail filename.
Create a small pelican plugin which takes the HTML code, searches for image tags and replaces the URL with the correct thumbnail URL. Also you would introduce the anchor tag to link the actual image file.
Look for alternatives. I saw another plugin for creating thumbnails. Maybe this one does something different.
I hope this helps :)

Related

Silverstripe not using HomePage.ss as Chrome?

Hi I followed the Silverstripe lesson https://www.silverstripe.org/learn/lessons/v4/working-with-multiple-templates-1, and even tried to download the code from repository but when I tried to create templates/HomePage.ss as chrome Silverstripe still uses Page.ss. Clearly lesson says "It first looks in the main templates/ directory to find the chrome for this page. If it finds HomePage.ss in there, it will select that as your chrome." What is missing?
The issue here is that you are conflating the idea between a Page template, and a HomePage template.
The Page 'chrome' template (as the lesson calls it) resides in templates/ because Page class is not namespaced, or that is it resides in the root namespace.
The HomePage class on the other hand is namespaced, and this must be reflected in the path to the template.
A main template (the 'chrome'), the template should be in templates/SilverStripe/Lessons/
A Layout template should reside in the same base, but with a Layout folder; templates/SilverStripe/Lessons/Layout
This information is featured in the lesson.
I understand you are frustrated, but spreading fear uncertainty and doubt about bugs before finding the answer to your question is not a nice thing to do.
You need to create a few folders in the templates folder, as described in that lesson:
Make a directory called templates/SilverStripe/Lessons. In that directory, create another directory called Layout/. In that directory, create HomePage.ss. The full path should be templates/SilverStripe/Lessons/Layout/HomePage.ss.
So you basically need to move your file from templates/HomePage.ss to templates/SilverStripe/Lessons/Layout/HomePage.ss
Silverstripe is buggy, I got same issue. Just switch to Wordpress.

The Images URL's doesn't show in my Home Page

Am using This bootstrap CSS design it works fine but the images doesn't appear. I took from its github repository the css file and the index.html.
i didn't make any changes, and am using it with my meteor project. I already added twbs:bootstrap package. Are there any packages i need to add to my meteor project?
why the images doesn't appear with me?
Those images does not appear because you just copied the index the css, you are missing the rest of the assets (where images are stored). But for your own images, you shouldn't have any problem to add them.

Need help adding adobe edge animate to wordpress without plugin

I have actually done this before but I can not remember how to get this right. Does anyone know the proper setup or of a tutorial that explains how to set this up without a plugin?
Getting Adobe Edge Animations to work in WordPress (or any other CMS)
I just did this myself, and posted an article on Codepen about it; http://codepen.io/write/getting-adobe-edge-animations-to-work-in-wordpress
I've also opened up an issue over at Github; https://github.com/wittnl/Edge-Animate-Runtime/issues/3
The problem
When EA (Edge Animate) is looking for assets they use relative paths.
This becomes a problem when we're using WordPress, where we need to reference our theme folder, an absolute URL.
ERROR 1
The main file edge.x.x.x.js fails loading the right javascript file for the composition. Resulting in a 404, file not found.
ERROR 2
The composition specific javascript file that get's loaded by edge.x.x.x.js have relative paths to images etc. Resulting in that no images are loaded.
What we want
Have all our assets stored in our theme folder
Have all files load properly and enjoy our animations
The solution
1) Modify the main javascript file
Make your own version of the main javascript file, e.g; edge.5.0.1-edited.js
Check for comp.load and change it so that it loads from our theme folder correctly.
comp.load('/wp-content/themes/my-awesome-theme/assets/edge/' + projectPrefix + "/" + projectPrefix + "_edge.js");
2) Modify the "composition"-specific javascript file
Change the variables you need to change (e.g images) inside tools_edge.js so that it points to your theme folder.
var im='/wp-content/themes/my-awesome-theme/assets/edge/tools/images/'

Rails: Stylesheet/view issue? Nothing is showing on the screen although there is source code when viewed in browser

I have a rails app with many partials for one view, each partial is a section in the view (one paged website).
I have put all my assets in the correct places etc.
below is a screenshot of how the actual page should look (outside of rails) (header, then section one which you can see, and there are sections below etc).
However this is how it is showing when done in rails
No images are shown for some reason, nor any content.
When I do not include the style sheet, all the content (writing) shows fine. When I include the stylesheet, everything disappears, its all white. However there are content there because I am able to scroll up/down.
Below is a screenshot of the structure of my files
I basically have all my images inside the image folder, but there are subfolders inside the image folders.
so:
assets (folder)
images (folder)
section_1 (folder)
image.png (file)
in my css, because my css files are inside the stylesheets folder, I call my urls as follows:
background-image:url("../images/section_1/image.png");
As for my views, it is basically one view which renders out each section (partial).
Try background-image:url("section_1/image.png");
This works in my rails project. However, I'm using compass, so it might be different.
I know what the problem is. But I still have one more problem.
The solution.
When calling an image from anywhere, even if you have a sub directory like I have, you simply call the url as follows:
background-image:url("assets/header/header_bg.png")
So you basically leave out the images folder for some reason.
The problem I still have is a routing issue.
In my assets folder I have a folder named fonts.
Inside this folder I have a number of folders, with different fonts in each folder (.eof,.ttf.svg) the usual font files.
When I type in the exact url of where these files are stored I get a routing error.
I also have a file called fonts.css in my stylesheet folder.
In the url if i put localhost:3000/assets/fonts which is the folder of the fonts I get a routing error.
Is there anyway in the routes file can I route the application correctly?
Both for the images and for the fonts?

How can I change the way my Drupal theme displays the front page

I am trying to build an website for my college's magazine. I used the "views" module to show a block of static content I created on the front page.
My question is: how can I edit the theme's css so it changes the way that block of static content is displayed?
For reference, here's the link to the site (in portuguese, and with almost zero content for now).
I can't access your site at the moment, so I'm basing this on fairly limited information. But if the home page is static content, the views module might not be appropriate. It might be better to create a page (In the menu, go to: Create content > page), make a note of the page's url, and then change the default home page to that url (Administer > Site Configuration > Site information, 'Default front page' is at the bottom). Although I might be misunderstanding what you mean by 'static content'.
But however you're creating the front page, don't edit the css in the theme - it'll get overwritten next time you upgrade. Instead you need to create a sub-theme.
As an example, if you want to subtheme Garland, in drupal 6. You first need to setup a directory for your themes. Go to sites/all/ in your drupal installation, and create a subdirectory called themes if it doesn't already exist. Go into that directory, and create a directory for your subtheme, say mytheme (i.e. sites/all/themes/mytheme/). Then use your text editor to create a file called mytheme.info in that directory, with the contents:
name = My Theme
version = 0.1
core = 6.x
base theme = garland
stylesheets[all][] = mytheme.css
And then use your text editor to create a file called mytheme.css in that directory, and put the extra CSS in there.
For more information, there's the druapl documentation on .info files and style sheets. Although, you might want to buy a book, as the online documentation isn't great.
The main css file that drives your content is the styles.css file located in your currently selected theme. In your case that means that most of your site styling is driven by this file: /aroda/roda/themes/garland/style.css with basic coloring effects handled by this file:
/aroda/roda/files/color/garland-d3985506/style.css
You're currently using Garland, the default Drupal theme included with the core download, so for best practices you shouldn't edit the included style.css file directly. Instead, you should, as Daniel James said, create a subdirectory in /sites/all called "themes".
If you're using Drupal 6, I'd follow Daniel James directions from there. If you're using Drupal 5, I'd go ahead and copy the garland directory into the themes directory and rename it for something specific to your site (aroda_v1) so you would have something like /sites/all/themes/aroda_v1 which would contain styles.css. At that point, you can edit the styles.css file directly to make any changes you see fit. Hope that helps!
It looks like most of your CSS info is in some *.css files. There is also some inline Style info on the page. Your style for the static info comes from the in-line stuff. I am not sure how Drupal generates the page but the place to start looking is for any properties for "ultima-edicao". That is what the surrounding DIV is called.

Resources