I would like to use Hindu-Arabic numbers in Jekyll i.e. ۱۲۳۴۵۶۷۸۹۰ instead of 1234567890. How can I customize Jekyll to achieve this or which parts of Jekyll should be extended to support this feature?
Jekyll outputs date strings with the date Liquid filter by default. To customize this behavior, you need to use a plugin to provide an i18n-aware date formatter (filter) to use in your templates.
For example, take a look at i18n_filter.rb which is linked from the official Jekyll documentation.
The use of any utf-8 characters is up to the writer. It's content and it's not par of the software. So you have nothing to customize for Jekyll to use Hindu-Arabic numbers natively.
Just check that your charset is present in your html and that it is set as utf-8.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
Nothing more.
Related
I'm making custom file adaptor using adaptor library.
In my adaptor getDocContent(), I retrieve file from URL, and set the content to the Response's OutputStream like sharepoint connector do.
So, I thought "Where is the file's title property I have to set? This is just a content."
As I was thinking, the file does not hit by it's title on the GSA search API. Also by File Extension Filter.
When developing a connector for Google Search Appliance using the Adaptor Framework, you have a few options on how to display metadata. You can send metadata via HTTP headers, but this lacks somehow. For example, when your metadata is too long, it will get truncated (because of it's size).
Since some time we use Handlebars for templating in GSA connectors. You pass your retrieved object to Handlebars, after which you can compose an HTML document such as following:
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="{{object.description}}"/>
<meta name="filetype" content="{{object.filetype}}"/>
<title>{{object.title}}</title>
</head>
<body>
<h1>{{object.title}}</title>
<p>{{object.description}}</p>
<p>{{object.someMoreContent}}</p>
</body>
</html>
So when you getDocContent method is invoked (usually, when GSA crawls you connector), it will crawl the page you design with HTML and HandleBars. Very straightforward and easy to maintain!
We use mandrill to send emails and we have many templates defined to send emails. Below is one such template
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<style type="text/css">
----- some styling information ----
</style>
</head>
<body>
------ Other html content ------
</body>
</html>
As you can see there is no mention of text only version of this email template. To improve the chances of this email not going to spam i also want to add text only version of it as well. I got to know about "multipurpose internet mail extensions" but i still do not understand how i can make my email to have a text only version too.
I will be really grateful for any kind of help on this.
Strongly suggest using a templating service on top of Mandrill, such as apostle or sendwithus.
Makes it way easier to manage and edit html+text templates, and I believe both support your use case.
You didn't indicate anything about your environment, where you're storing the templates, or whether you're using Mandrill's SMTP integration or API. Those things can make a difference in how/where you store the text versions of your templates.
If you're generating the full SMTP message in some fashion in your system, then you'd need to create a multi-part/alternative MIME document to store the text version. Or use a library or templating engine that can generate this for you in accordance with the relevant specifications.
If you're storing them in your system, and using the Mandrill API, then you'd want to store a separate text version to pass in the text parameter.
For Mandrill templates, there's an explicit text version that can be provided and saved.
Alternately, Mandrill has an option to auto-convert your HTML to text. It can be configured in your Sending Defaults, or on a per-message basis through the API or with SMTP headers.
I am new to Oracle WebCenter Portal. I have a page template where the DOCTYPE specification is:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
I need to change the doctype to:
<!doctype html>
I have been pulling out my hair for 2 days trying to figure out where to configure this.. and cannot seem to find it. Note: I DO NOT want to manually edit each published page, I want to make this a global configuration.
I did find documentation on how to do this on older WebCenter version, but I am on:
Oracle WebCenter Portal: Spaces Version 11.1.1.7.0 and the instructions for any documentation I have found does not show how to do it on this version.
To be honest, I would rather be pointed to an XML file I can directly edit, but if there is a way to do it in the WebCenter Adiministration panel that would be fine.
I will also need to add IE Emulation tags, but that is another topic.
Thank you for any help.
This will be inside your page style, create your custom Page Style and add the doctype at the top.
Since I learned to serve XHTML pages as XML, I have started noticing something odd: whenever I view an XHTML page in the Firefox source code viewer, the DOCTYPE is always marked as an error. According to the tooltip I get from mousing over it, the error in question is a "stray doctype". From what I understand, a "stray doctype" means that there is an extra DOCTYPE in the middle of the document where it doesn't belong, which is certainly not the case here.
Here's an example - this markup will pass validation, and display correctly in all modern browsers:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--FF source viewer will mark the preceding two lines as an error.-->
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="content-type"
content="application/xhtml+xml; charset=utf-8" />
<title>Sample XHTML Page</title>
</head>
<body>
<p>This is an example.</p>
</body>
</html>
This error message is especially odd, considering that these pages pass validation perfectly, and that a single parsing error would normally break the page.
I am the developer of this feature. You have found a bug. (Filed just now.) Thanks.
View Source syntax highlighting is based on the HTML parser, because our XML parser is not suited for the purpose and XML is rare enough that it doesn't make sense to put resources into implementing proper XML View Source. Hence, the XML View Source feature is a hack on the HTML parser and this aspect doesn't work quite right.
The error appears because the file is saved as UTF-8 BOM instead of UTF-8. Open the file in Notepad and change its encoding.
In addition to #Public Sphere's answer.
This warning can also occur when using <!DOCTYPE html>.
Probably the same warning is then also shown for the <html>, <head> and <body> tags (stray start tag "html").
To check if UTF-8 BOM is the problem:
Click the 'network' tab
Click the first request
On right details panel, click 'Response' tab and expand 'Response Payload'
You'll see the raw response now.
A red dot is in front of the doctype line,
and on hover it displays "\ufeff"
To easily find the files that could cause the problem, you can, in Linux, use this grep to find all files with BOM:
grep -rl $'\xEF\xBB\xBF' .
In order to simply create templates for HTML pages (no PHP, no ASPX etc), I need the ability to build up HTML page-chunks that I could then assemble to form a complete HTML page.
So that when I need adding a new menu item, I can re-assemble all the pages with the changed menu-chunk.
I tried W3C's Amaya, and got it fatal error on 1st attempt! Yes, it's W3C and it's a bug pot lol.
Komposer's outdated version had a templating model, but not in the new version.
Since I can't find any "honest" open source website editor to do that, I think I will try this as a solution:
Use c# of VB .NET to build a database out of all HTML chunks.
Create very simplistic web pages with chunk names as comments, like:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>A title here</title>
</head>
<body>
<!-- menu_chunk12 -->
<!-- body1_chunk -->
<!-- footer3_chunk -->
</body>
</html>
When some chunk is edited, I just click a button and my little app will rebuild all the web pages and I'll re-publish them upload to the server.
What do you guru guys think about that?
This is not a terrible approach, but I would probably use some special notation in the comments like <!-- #include(chunk_name) --> so that these special comments are distinguished from regular comments.
You might also look at something like htp.
It's an interesting idea, but in my opinion, if you want a little more extensibility, look into doing XSLT tranformations into HTML. This would provide you a very homogeneous design, that would work on any platform serving HTML, and provide you with a complexity level you desire (simple or extreme).
Yes. I wrote a very simple but effective preprocesor for html that does this.
I used an extremely simple format where "##" was used to introduce a command. The most useful command was "##include " which caused another file's contents to be inserted in place of the include command.
Other useful commands would allow me to set variables, increment variables, and emit the value from a variable into the HTML output. These allow you to add things like a copyright date on all your pages and simply update it easily in a single ##included location.
It's a trivial program to write, and you have full power over the features.
I used this for about 10 years until I pretty much switched from html to php.