I have a template page with a number of labels. I would like to produce several html's from this template, say one per each language. Is this possible using Jekyll?
I have seen a multi-language-plugin, however it seems not working anymore.
Can Jekyll produce more pages from a single template?
If the answer is negative, do you know any other static site generator that can handle multi language?
A good way to implement multi-language sites in Jekyll is via jekyll-multiple-languages-plugin that also works with Jekyll v3.x
You can find an useful tutorials on how to install and configure the plugin here and here.
As an alternative, you can try to implement multi-language without any plugin, using this tutorial.
Related
I feel as if I'm missing something. I've read through the documentation of Jekyll and Hugo, but am still confused as to why one would use them as opposed to something like Pug with Webpack or Parcel to create a static-site.
So, what do static-site generators provide that bundlers don't?
You are comparing apple with oranges here. While all those tools can technically be used to create static websites, they serve different purposes. To quote the header of Jekyll's homepage:
Transform your plain text into static websites and blogs.
Jekyll and Hugo are really designed for plain text and (mostly) blogs. As a user, you write articles in plain text or Markdown, and use those tools to turn them into static HTML sites. Besides generating HTML, the tools have a lot of functionality that is typically needed for blogs, e.g. they create an index of all articles and support categories.
With Jekyll (and probably Hugo, but never used it myself), you can also add pages to your site that are not blog articles. So theoretically, you can ditch the blog and use it to build a static website. But that is probably not why most people use it...
Compare that to Webpack: Webpack is first and foremost a build tool for Javascript. It doesn't care if you are building a static page, a progressive web app or a mobile app. It just bundles your assets based on the configuration you provide. With the right configuration, you can certainly use it for static pages, but Webpack will not offer more functionality than to bundle your files.
Depending on your goal, either of these tools might be better suited for you. Tools like Jekyll and Hugo make it very simple to get started and create a static website or a blog. You can style the HTML, sprinkle JavaScript on it and create your own design. Or you just grab an existing template that somebody else in the community created. Whatever approach you choose, you have something running in minutes.
Tools like Webpack on the other hand give you all the flexibility and a lot of power, but also require that you do everything yourself. It really depends on your use case whether or not it makes sense to build a static site with them.
I have a Ghost blog. I would like to host it using Jekyll etc. using static pages that I would be generating.
I use Prismjs for syntax highlighting.
How is Jekyll going to handle this situation considering that static pages will have no Javascript support?
Do I need to make changes from my side?
Thanks.
Static pages will have no JavaScript support.
Wrong. Static page doesn't have database support, but it supports JavaScript (quite obvious actually).
Jekyll has built-in syntax highlight engines with Pygments or Rouge. Pygments needs Python, while Rouge is pure Ruby based. Please have a look at documentation here.
If you don't want to use built-in engine, yes, Prism is also possible. You can totally follow the usual usage like this, or use this Jekyll Prism Plugin. For example, this article in my blog uses both built-in Pygments highlighting (for Ruby and Python code) and JavaScript Google prettify highlighting (for C# code).
If you don't know how to use JavaScript in your Jekyll project, please post your repository link, so we can help out.
I'd like to use polymer.dart to build a set of portable web components that can be embedded in any random html page (including pages outside of any dart project). The idea is that a customer could embed my polymer.dart elements on his html pages without the customer needing to create a dart application. I would think this would be an obvious and straightforward thing to do - but after going through many tutorials and instructional pages, and reading through lots of dart/polymer.dart documentation, I haven't found any explanation of how to go about this. Presumably the dart/polymer code would have to be compiled to javascript for inclusion on the customer's html page. Could someone comment on if this is possible, and if so, provide an explanation with examples of how to go about it? This dart/polymer.dart newbie would be grateful for any assistance.
I don't think this will work with Dart.
You need to run pub build over a Dart application to get a deployable result.
I guess this would work better with JavaScript Polymer elements.
There are plans to support this scenario but I guess it will still take a while.
Is there a way to internationalization html pages based on user locale?
I had a website developed using html pages but now I am asked to internationalize that website in 4 different languages.
I know how to do it using Spring Framework via resource bundles but I wanted to know if there is a way to do something similar using HTML pages so that you just have to write the code considering internationalization and just keep adding the resource bundles to be picked based on user locale when a user accesses the website?
I've just developed a solution a little bit lighter, using CSS content property :
https://github.com/k-yak/stati18n
Take a look, all informations are available in the readme file.
How about this?
http://code.google.com/p/jquery-i18n-properties/
Or How about this?
How does internationalization work in JavaScript?
If you can't do Javascript you'll have to use some form of templating or dispatching. That is either respectively:
Use JSP and Spring's Message taglib (or any other templating language that supports i18n)
For each locale you would copy all the HTML pages in a locale directory and then dispatch to the directory based on the locale (I don't recommend this).
What I personally do is use jMustache which is barely a templating language and then for each page (or many pages) I will have request controller that will load all the translations for the request locale into a Map object which I feed to jMustache (see Option 2 of my answer here: https://stackoverflow.com/a/10004113/318174).
If you keep your site static, you'll end up having multiple copies of your site, unless you can dynamically modify the page using javascript. But, you'll also want the URL's to have the language code in them to save state and be good for SEO.
I developed this free solution. http://www.sitetran.com/
I am looking for a blogging platform that has built in tools for programming-related content. For example, I've seen blogs that have line-numbers, color-coded line separation, code-formatting and tool tips for copying and pasting code-samples. Some of these are better than others. (I'm sure I'm not the only one here who gets annoyed by blog entries with posted source that you can't copy without also copying all the line numbers). So, my question is what blogging-platform does the community recommend for a developer-oriented blog?
er...none that i know of. at the moment, you have to get the bits and pieces together. for my own blog (Blogger, so i'm limited in addons), i use Highlight code converter to generate the display HTML/inline CSS, clean it up a bit (the default settings assume you're creating an entire web page from the code) by removing unnecessary markup, then using it in my blog posts.
Wordpress has the code highligthing feature using some addins, if you are going to host it yourself it will be a very good option to use Wordpress.
BlogDown is a static blogging platform, so it can be hosted on GitHub. You can write posts with markdown files, which has great support for code snippets. You can write your own themes and modules for it also. Unlike Jekkyl, BlogDown does not have a compilations step. You just swap out the markdown files, and you're good to go. It's also worth noting that BlogDown supports custom renderers.