Static html site generating with templating - html

Ive got to do some work on a static html site that was originally developed using dreamweaver, i want to keep the site as static html, but ideally not use dreamweaver (even though it dose have templating as the programme feels ancient compared to Sublime Text).
In the past ive experimented with Hammer app, which was great, but had some minor flaws in my opinion to do with the variables throwing an error if they weren't defined, ie. when you dont want / need to set a meta description and as far as i can tell its no longer being developed.
Are there any other ways of generating static html that allow you to use what ever editor you prefer and have templating ?

If you really want just static (aka plain text?) file, what I do is load the original Macromedia generated file in a browser, then pull up the browser's Developer Tools, copy the main < HTML > tag, and paste that into whatever editor you're using now.

Related

A Better Way to Edit Tumblr Blogs in HTML?

I'm writing blogs on Tumblr using HTML (I use HTML in order to control the content of my blogs flexibly and precisely) and I'm coding with Tumblr's own HTML editor, which is not so bad and I can continue writing in this way. However, there're some points I don't like, e.g.:
I can't adjust the width of the editor window and so the view looks a little compact.
After posting (or saving as draft), the source code will be automatically rearranged, pretty differently from my original version. That includes the line breaks, automatic adding of HTML tags (like </p>), and converting of special characters, like > to > and   to   (displayed as a dot).
My ideal wish is that I can use my own editor (namely Visual Studio Code) to manage my blogs. I could get a more familiar and comfortable working environment, together with useful functions like auto-complete. But there's still a conflict here - Very often I need to use the "Preview on Blog" feature (so that I can check the actual result).
To explain the situation, I describe an odd plan as example here. I could edit the source code using VS Code, during this I copy everything to Tumblr's editor when I need to "Preview on Blog", until posting. And whenever I need to update blogs I do the same work. That is, to keep a synchronous update of my blogs as local HTML files and online on Tumblr. But this way is not pretty convenient.
Is there a magical way to achieve a connection between the local editor and the website? Or, in general, how can I get a more comfortable workspace to write blogs on Tumblr using HTML?
Thanks a lot!
EDIT:
I'm not blogging on Tumblr anymore, I started to set up my own blogging platform using GitHub Pages and Jekyll.
(BTW, the code editor I use has changed from Visual Studio Code to NeoVim.)

Can we manually define all the HTML for one page of a Squarespace site, and use their UI for the other pages?

I have a single complete HTML file which describes a webpage, and I would like to use this as the homepage for a Squarespace site. I would then like to design the other pages of the site as normal with the Squarespace editor UI, and have links to these pages from the homepage.
Does anyone know if it this can be done, and we can edit the HTML of a blank page from scratch in SqSp? I am aware of Code Blocks, but I can only seem to add a code block within an existing template.
Many thanks
For templates using Squarespace 7.0 (as opposed to 7.1 which at time of writing is the version that powers the templates currently promoted on Squarespace's website), this can be accomplished only by enabling Developer Mode and then making use of either static pages or a custom .region file, or both. This is something I do frequently.
As a disclaimer, I would not recommend enabling dev. mode on a live site or a site you have heavily invested time into unless you are experienced with dev. mode or are a very experienced developer in general. That is because there are consequences to enabling developer mode.
Besides the method described above, there are two other alternatives:
Use JavaScript to rewrite the page, which of course has its own drawbacks.
Use CSS to hide everything but the main body of the page, then use a code block in the body, pasting your code in there. Depending on your HTML, that might not work properly.

Is there a WYSIWYG editor that will render inline, and linked stylesheets during editing?

Disclaimer: This question is not about fixing visual studio
So, I've used VSS for so long to edit HTML source that I actuall completely forgot there was a design view button. So for fun I clicked it. When I clicked it here is what I got.
Now, I fully expected it to look like crap since my styles are defined in separate css files. This got me wondering. Has there ever been a WYSIWYG editor that will render a page while editing using all stylesheets even external ones?
I think that WebPutty would help. You embed a WebPutty script on your site and it allows you to edit your CSS real-time and publish to your site as well right from WebPutty. It's not as powerful as Coda but does the trick if all you're concerned about is adjusting your CSS.
Dreamweaver. *cough
The design view is usually pretty close, but sometimes chokes for no apparent reason.
I would check out Coda and Espresso - both of these editors render external stylesheets in the design view when editing html. They also have beautiful interfaces and embedded ftp clients : )

Alternatives to HTML for website creation?

It seems the most common aproach to web design is to use HTML/XHTML & CSS in conjunction with other technologies or languages like Javascript or PHP.
On a theoretical level, I'm interested to know what other languages or technologies could be used to build an entire site without using a single HTML tag or CSS style for styling/positioning?
Could a website be made only using XML or PHP alone, including actual styling and positioning?
Presumably Flash sites are till embedded in HTML tags?
Thanks
There are actually several solutions that allow you to nearly completely avoid CSS and HTML.
GWT: Google Web Toolkit
Written in Java and will allow you to build both server and client code in Java. Used to build Google Wave.
Cappuccino and Objective-J:
Objective-J is to JavaScript as Objective-C is to C. It extends JavaScript with many near features, including type-checking, classes and types.
Cappuccino is like Cacoa (Mac OS X GUI toolkit).
Using these two you can build incredibly rich and desktop like webapps. They run mostly on the client side and you can use whatever you want on the server.
A good example is 280slides
SproutCore is similar to Cappuccino, but it uses pure JavaScript instead. Apple is using SproutCore to make me.com.
I should also mention that knowledge to HTML, CSS, JavaScript is a good skill to know, just like understanding your compiler is a good skill.
EDIT:
As said above Adobe Flash can also be used.
You can make a website with out a single html tag. Just give folder read access to all your directories, have sensible file names. From here you user will be able to browse images , read text files, download videos and depending on the content he may or may not come back ever again, but you do achieve the goal of setting up a "website" with out a single line of html or css or any other code for that matter.
:-) :-) :-)
You can host a telnet server with anonymous access and a specialized shell that restricts the user to doing whatever it is you want the site to do. ;)
Lets make the distinction between what is required by the web browser, and what you as a developer use to create that markup.
Remember that HTML nowadays is xml. You could use any markup language you like and convert that to HTML using XML.
eg ASP.NET uses markup such as which is converted on the server to .
As long as the content going down the wire to the browser is HTML, or generates HTML through script, you can use any approach you like.
However these approaches have mostly failed as developers prefer having direct control over the markup. It makes css as well as scripting much easier when you are certain what the html is going to be.
ASP.NET MVC is a product created in response to criticisms leveled at the ASP.NET webforms model.
Also, this is another answer because it's a completely different technology, but you can write an application in XUL and it'll run in Mozilla-based browsers without any HTML.
There's also XML. You can create websites with XML only. A well known one is World Of Warcraft. Check the page source. An XSL is used as stylesheet. There exist even XML based web frameworks like OpenLaszlo. You can let it serve either DHTML or Flash on reqeust out of a single XML template.
The Wt C++ Web Toolkit.
You can write your web application in C++ using Qt-style widgets (input boxes, buttons, tabs etc) and hook up client-side events to C++ code on your server. All without writing any HTML or CSS.
A sample application from their website (you may also want to look at this excellent tutorial):
HelloApplication::HelloApplication(const WEnvironment& env)
: WApplication(env)
{
setTitle("Hello world"); // application title
root()->addWidget(new WText("Your name, please ? ")); // show some text
nameEdit_ = new WLineEdit(root()); // allow text input
nameEdit_->setFocus(); // give focus
WPushButton *b = new WPushButton("Greet me.", root()); // create a button
b->setMargin(5, Left); // add 5 pixels margin
root()->addWidget(new WBreak()); // insert a line break
greeting_ = new WText(root()); // empty text
/* when the button is clicked, call the 'greet' method */
b->clicked().connect(this, &HelloApplication::greet);
}
void HelloApplication::greet()
{
/* set the empty text object greeting_ to greet the name entered */
greeting_->setText("Hello there, " + nameEdit_->text());
}
Curl (requires a browser plugin)
Wikipedia article
A webpage looks like this:
{curl 1.7 applet}
{value
let b:int=99
let song:VBox={VBox}
{while b > 0 do
{song.add b & " bottle(s) of beer on the wall,"}
{song.add b & " bottle(s) of beer."}
{song.add "Take one down, pass it around,"}
set b = b - 1
{song.add b & " bottle(s) of beer on the wall."}
}
song
}
Source
Since browsers view HTML, I'm assuming you mean create a site without ever having to edit/write HTML/CSS. The framework/app environment/whatever taking care of everything for you - yet still allowing you control over the presentation layer.
Seems like that is certainly possible on a theoretical level.
I ran across Noloh (not one line of html) a while back. Was intrigued, but never actually tried it out.
From various places on the Noloh site:
Because NOLOH does not rely on HTML or pages, maintaining complex rich Internet applications is significantly easier than with other methods.
Developing applications with NOLOH only requires using a single, unified language: a superset of PHP that completely maintains all aspects of server-client communication for you!
I think you could build a site entirely in SVG.
The front page of emacsformacosx is almost entirely SVG, for example.
Downsides: It wouldn't be viewable in IE (at least through version 8). And last I looked, text support, like flowing and justification, was weaker in SVG. (You could embed HTML inside an SVG element when you needed sophisticated text features, but that would violate your no-HTML rule.)
You'd probably still want to use CSS with SVG, because it's a good idea there for the same reason it's a good idea with HTML, but it wouldn't be necessary.
A website is always viewed through a browser (at least always if you are human :)). Browsers understand HTML. Whatever the technology - you have to basically render HTML. Even in cases with rich technologies like flash, the flash object that is rendered by a browser plugin is embedded inside the HTML.
In theory it is possible to do it without HTML, but the question becomes how much does the product diverge from the definition of a website...
One really short, simple answer... you can't :D
Flash requires an embed tag, an image requires an embed tag etc, so you'd have to use HTML in some method or another.
PHP is an embedded language, it is used to generate HTML on which the browsers renders, with XML, well technically a browser like Ie or FireFox will render it in it's own way for readability, but I would not class that as a website.
The major developments in the world of web technologies involves the development of HTML and CSS to improve them, there isn't any need for an alternative. In fact we're pushing towards a standard, what point would there be in introducing a new language to negate these standards. The whole IE saga would simply get worse.
Like the others have suggested, you could directly load an image or a flash file, but an image is useless on it's own, and a flash interface throws up loads of problems like SEO, accessibility etc, not least it's very heavy and usually completely misused. In my mind I wouldn't even class this method as a website, it just doesn't tick any of the boxes (IMO).
I think you can have an URL pointing directly at a hosted Flash (SWF) file, I've certainly done this though I don't know if all browsers work.
Anyhow, I tested this when developing MyDinos.
e.g: http://mydinos.com/home.swf
You can use Emscripten and its SDL subset.
You could try using quickstatic. You can code HTML templates from Python3. What is super cool about it is the fact that if you put in a for-loop for a certain item, you can generate that many items (maybe even use it to print items from a directory or quickly serve thousands of links).

Templated HTML Editor

I'm looking for a HTML editor that kinda supports templated editing or live snippets or something like that.
Background: I'm working on a website for a friend. As there are no specifications what the webspace/webserver can or can't do, I decided to make it a pure HTML/CSS page, or rather 10 of them. I wrote a template, copied it 10 times and edited the content. And guess what, the template has to be changed.
Therefore I'm looking for a (HTML-)editor that has some kind of live template system where I can edit the content in as it where plain text and then save the project into the 10 pure HTML/CSS files.
I thought about using PHP (the only script language I've some knowledge in), but writing the underlying template script would cost me enough time that I could change all files by hand. I'm not that familiar with AJAX to know if there's a way to load content from another file. If so, this would be an option if there already is a script. With Webdeveloper (firefox extension) I could save the generated source code as HTML/CSS.
Thanks in advance
Edit: any hints how to do this without an editor are welcome
Edit2: In my mind the tool looks like a plain old text editor like SciTe, but capable of editing multiple files simultaneously in the same text area, so it looks like editing one ordinary file, but actually it's a whole bunch of files.
Dreamweaver will do this for you, it's had HTML templating of the type your describe built in from very early versions (because from how you phrase the question I do not think you're thinking along the lines of a PHP templating engine such as Smarty, but some sort of HTML layout formating)
Although I regularly look around for Dreamweaver replacements, and I've certainly been impressed by Aptana, I still tend to use Dreamweaver in my development stack simply because whereas I can compensate for some of the more coding-orientated features it misses, I find the WYSIWYG nature of the editor invaluable.
I would have used a template engine.
I wrote a post about a dead simple script using the Dwoo template engine and mod_rewrite, where I am taking the uri and loading the forrect data and template based on that. You should be able to get it running in a few minutes.
Maybe I am way off on this, but why don't you look into an Open Source Content Management System (PHP/MYSQL)? There are MANY light systems that are not like Drupal, Joomla (if you do not want the big bulk of those CMS's).
There are even a few good ones for light web design that are flat file driven.
That would be my suggestion, at least if not for this project, look into it for future projects.
Here is an example of a great micro CMS that would seem to fit the bill for what you are doing:
http://www.mini-print.com/