I have a multi-language site organised into directories (e.g., pages_EN, pages_FR, etc.), each directory containing webpages such as index.html, contact.html, and referencing common files in separate directories (e.g., "../images/picture.jpg") and external css and js files. This structure has allowed me to copy the code wholesale when adding a new language, only then needing to edit the prose content/text of each.
The problem is now that I'm ready to go live, my web host requires that I have a page called 'index.html' in a directory of theirs (called 'html_public'); this will completely break my page navigation. I can't put all of my language index pages in that directory (because they're all called index.html) and I can't re-name them (e.g., to 'index_EN.html') because of the aforementioned naming requirement.
Must I redesign the whole site? Is this convention common/the rule, or have I just picked the wrong host? If I have just a single (say, English) index page in 'html_public' with all of the others in their respective language directories, then I'm concerned that the content of those other pages might not be indexed. Does anyone have any suggestion about what to do here -- I thought I was structuring this site the right (i.e., simple) way, and now I find that I've got to put twists and turns in to get it online...
If answering, please don't suggest that I just add auto-translation to a single language site -- I'm polylingual, and I've seen how translation software mangles content.
This is common, the server wants an index.html file. A quick and painless solution for you would be to rename your index_EN.html file to index.html and use it as the home for everyone, from there, you can go to the other languages. A more complex but cleaner solution, would be to create an index.php file and in there read the language of the browser visiting your site and redirect to the correct index file.
This should get you started with the php solution Detect Browser Language in PHP
Related
In the polymer.json file is there anyway to point to multiple points of entry?
"entrypoint": ["index.html", "index2.html", "index3.html"]
Or would it be best just to include the other indexes in the fragments section?
This would be for a domain and some sub domains.
example.com
app.example.com
shop.example.com
I don't really need this but it would be nice to have one folder for production.
I'm just adding text to satisfy the validation.
Thanks for your time in advance
Remember a polymer "application" is a single application, it's a single page, except it's not really a page at all, it's an application.
Having multiple entrypoints doesn't make sense, because loading that entry point is really just loading an application specified in that file... index.html is a sort of manifest and bootstrap that starts your application.
If you have multiple entry points, these are different applications, which will involve page load. Either build them as three different apps, and share the common code in libraries of your custom elements, etc, or refactor your applications so there is one index.html/app load entrypoint, and load the features that make up index2.html and index3.html as fragments.
Perhaps all your index?.html files are really views, different "screens" in your application, and you should make them all fragments, and in index.html have the shared code load the original index123.html's as views.
Is there a way for an organization that uses a series of Jekyll blogs (ideally running on Github Pages) that are related in that they'd have the same header, style, and footer, but manage separate contents to work together? The blogs are necessarily separate because the idea is that each should be able to stand on its own, but should still work nicely together. Specifically the concern is local development.
To see the specific use case, check out Open Source Design, and how it plays out on the actual website. Right now changing a style for the jobs subdirectory involves copying over the CSS, tweaking it, and moving it back to the the website.
Something I've seen work for rails apps and might be an idea is looking into setting up Anvil to work with Jekyll instances to power all the instances? Is there anything out there that has tried that?
organisation.github.io is the repository that manage organization wide styles in organization.github.io/css/main.css.
Any layout in a repository at github.com/organization/project will use the central css at organization.github.io/css/main.css. Any specific css can be in the repository itself.
This is also true for javascript files with no fear of cors.
The only problem can be for local development and the need to link css with an absolute path to online resources.
Note that Open source design is already doing this, pointing all pages to http://opensourcedesign.net/css/main.css or /css/main.css which is the same file.
I would suggest that what are you trying to do is outside the scope of a static site generator. You need to configure assets based on the environment in which they will be used. You need a build system like grunt, gulp, or even Rake. The build system can pull assets from a single source folder, pre-process them as needed (changing asset URLs as needed), and move them to various output directories for each of your blogs.
Or you could try to put your assets in one repo and make each of your other repos depend on the assets repo as as submodule. Then you can update the assets independently of the contents.
Since my experience with HTML is fairly rudimentary (and pretty old), I am not sure if my requirement is realistic.
Lets say that I have quite a few files containing Lua source-code, and all of them have the ".lua" extension and available in a particular subdirectory. What I'd like to do is create a static index.html file, which when loaded in a browser, would show the list of the lua source-code files in a drop-down. Once one of the source-code files is selected, I'd like that the file gets loaded into an "area" on the same page, and is pretty-printed, i.e. with syntax-highlighting in browser. I was wondering if I could use something like the google-code-prettyfy for the syntax-highlighting part ? Also, I am not clear if an external lua sourcecode file can be loaded, and displayed within a certain region of html page as being rendered. If yes, would appreciate elaboration on the how part.
A tool like LDoc can be used to accomplish a lot of what you want, much as Doxygen would be used for a C language source kit.
Both are heavily driven by inclusion of specially formatted comments that carry documentation.
I know Doxygen can fold source code into the generated document set, I don't recall about LDoc. Both are actively under development.
It isn't necessarily a bad idea to use both tools on a project, especially if you have C source code implementing Lua modules. You could use Doxygen to build the overall document tree for your engine and C modules, and LDoc to build documentation of the Lua parts. It should be possible with a little care and configuration of both tools to get them to play well together.
I have a page with loads of repetitive directory paths for images, and all of those images need to replace with new files (that are the same file name, but in a different directory) when duplicating the page. Rather than updating the folder name in each directory I'd like to replace it with a variable and just change that variable once when duplicating pages.
I've tried a bunch of different combinations (like below) but I can't find anything that works, and google efforts were unsuccessful.
var Shirtloc='Shirts/FolderNameThatWouldBeUpdated/'
<img src="'Shirtloc'+title.gif" width="952" height="119">
HTML is not a programming language but a markup language and as such does not provide variables or any other programming tools. This is where serverside scripting comes in, with PHP, ASP.NET and JSP as the most common examples.
Technically, you could do it with Javascript as well but you should not attempt to do that, as it comes with a myriad of problems and possible future issues that you really would not want to deal with.
Is it possible to reuse HTML tags across multiple files, headers and footers for example? Placing them in separate files adds an extra HTTP request, that I'd like to avoid.
I don't want to replicate minor changes in headers and footers across every html file every time a change request comes along.
HTML is not a programming language - it's a markup language. You don't do object-oriented HTML because it isn't object based. This is the whole purpose of a server-side language, so you can make include files and use them in your server-side application.
If you have Apache however, you can use server-side includes which don't require a programming language such as PHP, but it's less flexible:
<!--#include virtual="/footer.html" -->
First, HTML isn't even a programming language, so it's impossible to have "Object-oriented" HTML.
Placing them in separate files adds an
extra HTTP request, that I'd like to
avoid.
If this is the reason for your "without server side code" requirement, then you are mistaken - the client does not fetch the templates that make up a page separately; the server side code will return a single HTML page to the client.
If, on the other hand, you don't have the option to run any server-side code at all and have to make do with static HTML pages, then there's only two options I can think of: iframes (which do result in separate HTTP requests, of course), or some sort of tool that basically runs the equivalent of server-side code to embed your reused templates everywhere and spits out the result to be uploaded to the server. You can have this effect by running a PHP/Apache-with-SSI/JSP/Whatever server on your development machine and using wget to make a static snapshot of the pages.
What I want to do is this. The files can be scattered during development. But I when I'm ready to release, a toolkit should compile the included files into a single html file.
You can use a template language/engine, such as jinja2.
You can layout files in a certain hierarchy, and have templates inherit from other templates, and include other templates, and define reusable macros (closest thing to what you referred to as "reusable tags").
What I want to do is this. The files can be scattered during development. But I when I'm ready to release, a toolkit should compile the included files into a single html file
I know this is late, but CodeKit's .kit language lets you do exactly what you were saying.
http://incident57.com/codekit/help.php
I think the language you've chosen in your question (object oriented HTML) is actually masking the real issue you have here...
What I want to do is this. The files can be scattered during development. But I when I'm ready to release, a toolkit should compile the included files into a single html file.
This sounds like a job for a preprocessor, I don't believe it has anything to do with your webserver or server side technology, as this is a step which would happen before deployment.
There's a number of text pre-processors available eg M4 - hell you could even use the C compiler pre-processor if you wanted. A quick google reveals that there are specialised pre-processors for HTML as well....
Automatic file inclusion, automatic escaping, and whatnot that can be done with automatically inserted headers and footers, chosen based on path patterns.
Seems to fit the bill?
Sure . But these would have to be separate ajax calls form the client . There are lot of javascript mvc frameworks like that do that .
If you want to have include files during development, then compile them into free-standing HTML files, you could do that by spidering your development server with wget: whatever server-side technology you use will combine the files and return the HTML, which wget will saves as one file.
As everithing is object over the technology but not directly, indirectly interacting with the object that are created at different level as per security implementation.
You can do this.
I just released a mature framework called Hypertag that is, in fact, Object Oriented HTML. It is entirely client-side, in continuous development, and allows for very interesting, yet HTML-compatible, advanced solutions for logic and layout.
See http://hypertag.io for more.