How to easily write a website using a text editor and version control?

0

Question

I would like to write a website with nice design, say like the ones generated by WordPress, SPIP or with advanced CSS-based templates. At the same time, I would like to write the contents in a text editor (possibly in text mode, with Emacs or vim, for instance) just like one writes a LaTeX file. In addition, I would like to use version control so as to easily see the changes across different versions of the website. I should say that the website I have in mind is not a blog; it is more organized and several pages should be updated with time. I am not looking for a highly complex solution as it is for a personal website with a few dozen pages (organized in "sections", "subsections" and maybe even "subsubsections").

I guess I have in mind the LaTeX model, where you write the contents and let the compiler generate a nice output. The LaTeX code is rather simple, and it is in text format so that it is trivial to apply version control.

Why classical solutions do not seem to work

WordPress is very nice, but as far as I can tell, you cannot really edit from a text editor in a terminal. You must use some kind of graphical interface. SPIP, like WordPress, will generate a database for which version control (with Git or so) does not seem appropriate.

HTML/PHP/CSS templates are nice, but the contents and the design are a bit too intricated. In particular, it is not easy to switch from one template to another, especially as there are no standards. Usually, a template does not evolve, since you just picked it somewhere. In addition, it offers little flexibility and may lack features that you need to add yourself. For instance, it may never produce a mobile version, while a clever exporter might do that.

I am aware of software like orgmode under Emacs and corresponding exporters. But this is more for blogs, and the design is not so great in the end.

I guess my question is whether there is software that could publish webpages written in plain text and organize these webpages (in pages/subpages, with menus, nice design, ...). If the overall organization of the webpages must be carried out of the text editor, that would be acceptable. The webpages could still have images, equations and so forth if the software is clever enough.

I cited WordPress and SPIP, but I considered many other solutions like a wiki (MediaWiki or whatever), other publishers like Dotclear, CMSs like Joomla, CMFs like Drupal or even frameworks like Django, ... Maybe one of those is actually the solution and I just did not realize that?

Edit

There is an additional constraint/example I would like to add. Imagine you want to include pages generated by an external software, e.g., Doxygen for the documentation of some software. Then you may need to automate the addition of the documentation (for a new version of the software). This requires some flexibility, maybe scripting options.

olivaw

Posted 2013-08-02T03:24:55.507

Reputation: 1

Question was closed 2013-08-06T10:29:25.737

Most wikis have built-in version control. Not git, of course, but to undo damage done by spammers and other evil doers they have change logs with the ability to revert the damage easily. The editor for a wiki is built-in to the wiki to edit from the web browser. MediaWiki has hundreds of extension maybe one of them can import files that you generate from a terminal. Can you explain why you need to use a text editor in a terminal? Does any of this info help? – cybernard – 2013-08-02T04:09:26.220

Thank you for this answer. I will investigate the extensions of MediaWiki. But I would like not to be tied to any GUI or specific interface, and I would like to edit remotely (in which case a graphical interface is too heavy). – olivaw – 2013-08-02T04:25:14.197

What is too heavy in kb/s? The reason I ask is because unless your using a 56kbps modem I think you will be pleasantly surprised at how light weight a wiki can be. If you use a wiki the web browser is doing all the heavy lifting. The web browser receives a bunch of text commands and generates a GUI based on text commands. The rest of the work is done by the server that host the wiki. The reason I mention this is the wiki is by far the easiest way to maintain a website. Also use "compare wizard" compare wikis at http://www.wikimatrix.org 26 of them store there contents in files.

– cybernard – 2013-08-03T05:47:46.503

Your question is very open ended, you could achieve your goal with dozens of programming languages, a multitude of platforms (hosted, self-hosted, SAAP, IAAP, whatnot) and it all depends on how well you master these. I fear you'll have to break down the problem into more bite-sized pieces and try to solve those. If you have questions about those more isolated problems, you're always welcome to ask again. – Ivo Flipse – 2013-08-06T10:33:19.370

Answers

2

There's a lot of simplified markup language to html/web-site converter projects. For example

  • there's python-oriented sphinx: converts ReST files to web-site, and
  • ruby-oriened jekyll: which converts Markdown files to web-site.

Also since You mention emacs:

  • org-mode and
  • emacs muse

can generate web-sites from simplified markup languages.

Finally there're complete web-frameworks, e.g.

  • python oriented: flask, django, pyramid
  • ruby oriented: padrino, scourched, pakyow

In each of these cases You can subject source files to version control. I use sphinx with twitter-bootstrap theme my self: using python in research.

Adobe

Posted 2013-08-02T03:24:55.507

Reputation: 1 883

Also stumbled upon python clone of jekyll: hyde.

– Adobe – 2013-08-06T16:09:57.647

0

If a static site is good enough for you, then maybe the following could be helpful for you. I have setup my website on my local machine versioned using git. The local repository is associated to a remote splitted repository - The bare part is on my private server and the content is on the public server. This way, I can edit my site locally, and once it is ready git push web publishes the changes. This is inspired by this and repeated in my blog. You can see the resulting website here.

Using this approach, you can design your website as you wish and have both the design and the content under versioning control. Furthermore, from a technical point of view, you have three(!) synchronized copies of the site: 1. the local copy, 2. the remote bare repository, and 3. the actual public site.

Dror

Posted 2013-08-02T03:24:55.507

Reputation: 1 510

0

I don't believe this is the appropriate place to ask this kind of question as there are a huge number of answers, and indeed the interpretation is variable depending on what you mean by "easily write". I can (and have) written reasonably decent websites with a text editor, but its not easy because it requires in-depth knowledge of CSS and HTML for instance.

That said, since you mentioned VIM, and it appears your site is for a "1 man band" rather then a group endeavour, I found it practical to develop it on a server (live or test) using VI and then use FSVS alongside a SUBVERSION repository to version the code directly on a linux box without leaving ".svn" files all over. [ fsvs appears to be designed more for configuration versioning, but works well for other stuff if you don't need to do merges ]

davidgo

Posted 2013-08-02T03:24:55.507

Reputation: 49 152