For my blog site, I use Node.js, Express, and Jade for templating.
I built a simple rss.jade template for my RSS feed, and am having problems getting the required tag to work nicely.
I believe, in older versions of Jade you could use:
link http://example.com
Now, it is enforcing that 'link' is self-closing like:
link(rel='stylesheet', href='style.css')
Is there any other solution rather than plain-text like:
|<link>http://example.com</link>
Are you sure you defined the right doctype?
With the doctype xml you can produce this example:
doctype xml
rss(version="2.0")
link.
http://example.com
and get the output you wished to see:
<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0">
<link>http://example.com</link>
</rss>
Related
Hi
Everyday my scripts submit a xml to Google, containing new pages as well the images associated to them.
The pages are indexed ok but not the images.
For example, if I type in Google Web Search "Camisa Malha Cavalinhos", the first result is https://www.ebraz.co/listing.php?id=1052, which is ok.
But when I turn to Image Search, no results from my site are returned.
Robots.txt is not disallowing the images folder.
Below is the xml (headers [no longer] omitted).
What can I possibly be doing wrong?
Please ask for more details if you need. Thanks.
<?xml version='1.0' encoding='UTF-8'?>
<urlset xmlns='http://www.sitemaps.org/schemas/sitemap/0.9'
xmlns:xhtml='http://www.w3.org/1999/xhtml'
xmlns:image='http://www.google.com/schemas/sitemap-image/1.1'>
<url>
<loc>https://www.ebraz.co/listing.php%3Fid%3D1052%26title%3DCamisa+Malha+Cavalinhos</loc>
<image:image>
<image:loc>https://www.ebraz.co/upload/o_19la610uf1hpi1cuc11n2e801qc915.jpg</image:loc>
<image:title>Camisa Malha Cavalinhos</image:title>
</image:image>
</url>
</urlset>
On the page: https://support.google.com/webmasters/answer/178636?hl=en
You will notice this one begins with the xml version line. Also it doesn't have the xhtml line in it. I would modify it to be identical to this example from google. I have previously seen non-identical versions having issues.
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
<url>
<loc>http://example.com/sample.html</loc>
<image:image>
<image:loc>http://example.com/image.jpg</image:loc>
</image:image>
<image:image>
<image:loc>http://example.com/photo.jpg</image:loc>
</image:image>
</url>
</urlset>
I have created a sitemap that conforms to the SiteMap protocol. This is in XML format. How would i apply CSS to create a fancy site map similar to Fraunhofer?
The xml was made by an online sitemap generator, and has "url" tags. Each tag represents a page, but nothing is inside that tag except info about that page (no url tags within tags, to show a tree like setup), so how would i even show what links are level 1, 2, or 3? Also, since this format only has one main tag called "URL", i cant style different sites differently.
EDIT: This is what some of my generated XML looks like:
<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"
>
<url>
<loc>http://buytadiran.com/</loc>
<lastmod>2014-03-04T15:21:12-06:00</lastmod>
</url>
<url>
<loc>http://buytadiran.com/index.php?option=com_content&view=article&id=47&Itemid=54</loc>
<lastmod>2014-03-04T15:21:12-06:00</lastmod>
</url>
</urlset>
Id like to have a tree like set up similar to what i linked, without the folds, where a top level page is shown in green or something, and sub pages are shown indented under it with different coloring...
Is it even possible to make a sitemap that is structured this way, and still conform to the SiteMap protocol, or should i be looking at making a seperate sitemap thats "user friendly", that i'm not submitting to google?
Thanks!
I am using yahoo pipes to aggregate a variety of rss feeds (and make some simple transformations, etc). However, the XHTML content of my feeds is stripped away by the aggregation process. The problem seems to have nothing to do with my pipes code, and simply be a result of how Yahoo Pipes transforms the input RSS I am feeding it into the output RSS it spits out -- though both are apparently RSS, they are quite different XML files.
So, for example, when the "input" rss looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<feed>...
<entry>
...
<title>...</title>
<content type="xhtml">
HTML CONTENT HERE
</content>
</entry>
...
</feed>
The output looks like this:
<rss xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<title></title>
<description></description>
<link>
</link>
...
<item>
<title>...</title>
...
<description>
NON HTML CONTENT HERE
</description>
...
</item>
</channel>
</rss>
It seems that the problem is that the contents of the <content> tag in my input are being converted into a <description> tag in the yahoo rss output, and from what I looked up, the <description> tag does not support markup within it, so it makes sense that that content is plain text.
My problem is that I can't find any documentation of why Yahoo is making this transformation or how to avoid it. It is nothing that I can find in my pipe, but on the other hand, I can't find a way to access an un-transformed version of my pipe's output. It seems I must be missing something because obviously people use embedded HTML in RSS all the time and I can't imagine it's all being squashed in every pipe out there.
Here is the link to a minimal test case in which I pull in a single feed and output it again with Yahoo pipes: http://pipes.yahoo.com/pipes/pipe.info?_id=5302fba3cc2d02f7a87ffdded87ce627
Can anyone tell me how to modify the above test pipe so that it will spit out content with html in it? Alternatively, can anyone explain if/why this is impossible to do?
AFAIK you can't get raw feed output as XML - Yahoo! shoehorns your output into specific standard RSS fields, as you noticed. The best option that I can think of is to get your output as json (a javascript object), as the json preserves all the fields in the input:
http://pipes.yahoo.com/pipes/pipe.run?_id=5302fba3cc2d02f7a87ffdded87ce627&_render=json
Most modern processors will take json output in addition to RSS.
Im trying to make an aspx page display as xml for an rss feed
the output looks like its formed ok when i view the source:
<?xml version="1.0" encoding="ISO-8859-1" ?><rss version="2.0"><channel><title>phil</title><link>http://www.mysite.co.uk/blog.aspx</link><description>phils blog</description><item><title>Test Blog</title><link>
http://www.phil.co.uk/blog/test-blog.aspx</link><description>test description</description><pubDate>2011-10-21T14:19:28</pubDate><guid> http://www.phil.co.uk/blog/test-blog.aspx</guid></item></channel></rss>
But when i view the page in chrome it just shows the text from the nodes and not a visual of the xml structure. What do i need to do?
You could use the Google Chrome Tree Extension.
I will suggest you to Use EXtensible Stylesheet Language (XSTL)
You can display xml directly on browser without using any ASPX page. It is used to styling of your xml.
Let me know, if you have any concern.
I have a blank Plone 4.1 site with only collective.quickupload installed. The upload portlet worked fine until I install plone.app.theming and apply my theme. The files were still uploaded, but the web client got "Failed" status.
Inspecting the ajax response from server I found that they were wrapped by html header.
The old response (before install diazo & apply my theme) was simply
{"success":true}
The new response (after install diazo and apply my theme) was being wrapped by a html tag:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><body><p>{"success":true}</p></body></html>
I've pasted my rule.xml file here (nothing special, there is only one rule conditioned by css:if-content="#visual-portal-wrapper"): http://pastebin.com/SaK13Fni
What should I do to work around this ?
Thanks
To avoid this behavior you have to add an exception in your rules.xml that specify to not apply your theme to your specific view , like this:
<notheme if-path="myjson_view"/>
edit:
I've tried with one of my diazo themes and a json view and I didn't have your issue. So I think the problem is either in your rules.xml or in your json view. You should try one of these two way:
change your rules.xml this way:
<rules
xmlns="http://namespaces.plone.org/diazo"
xmlns:css="http://namespaces.plone.org/diazo/css"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Prevent theme usage in zmi-->
<rules css:if-content="#visual-portal-wrapper">
<theme href="index.html" />
</rules>
have you already specified the "Content-type" of the output in
your json view? Like this:
self.request.response.setHeader("Content-type","application/json")
return json_data
If not, that's probably the problem.
Watch out for using Chrome inspector... it adds the html head and pre tags around your json when you inspect it...it's not actually there if you look at view:source of the page (old school)...