Live Server for Static Markdown Websites - web

I am currently looking into static site generators.
I build a testing documentation site with Vuepress and am now fiddling with going into the live operation.
i don't want to publish my files to services (GitHub Pages, Netlify etc.) but I want to host it on my own server.
Generating static html sites everytime I add markdown pages or change the content is not an option.
Is there a way to host Vuepress (or maybe similar markdown generators) where I just need to upload the .md files and everything goes automatically?

There are two basic ways to use markdown as your website...
use a live server:
In this scenario, each request is processed by a program which retrieves the markdown text and does some pre or post processing (templateengine, formatting etc).
This could be a simple CGI script, a web framework or a custom server.
use a static site generator:
You process the markdown on your lokal machine and generate static html files, which are uploaded and served by a web server.
To answer your question whether or how you can use vuepress:
There are multiple possible ways, depending on your current setup.
If you only have some webspace, than you have to upload prerendered html files (or using another framework).
If you have a virtual server, than you can automate the build/rending process by using scripts, e. g. with file watchers.
Note to GitHub:
Even if you said, that you don't want to use GH... If you only want to hide the markdown files, you can create a private repository and use GH Actions as CI/CD pipeline.
Unfortunately Stackoverflow is not for software recommendation, so for alternatives to vuepress have a lookt at Software Recommendations.

Related

How to deploy TerriaJS on my site

I would like to deploy an instance of TerriaJS on my site for the purpose of 3D (with 2D-fallback) geospatial mapping. I am a bit confused as to how to actually "deploy" TerriaJS on my site. I am very familiar with Leaflet... pretty much just include the leaflet.js file, create a div, and off you go. However, I am running through the wiki on TerriaJS's github page and all I see is a bunch of NodeJS.
What am I missing? I am able to get the map to run with NPM and I see a nice 3D map (running inside of a node web server instance), but that doesn't do me any good as I want to be able to embed the map on my web site.
If anyone has a nice (plain English) tutorial or starting point, that would be awesome.
Thanks.
The Node-based web server that we usually use with TerriaJS only does a few things:
It serves up the static HTML, JavaScript, and CSS that make up the application.
It includes a simple service at /proxy that allows TerriaJS to access geospatial data servers that don't support CORS.
It includes another service at /convert that uses OGR to transform geospatial vector data (e.g. shapefiles) to GeoJSON for display by the TerriaJS client.
Of these, only the first is required. So, you can copy the wwwroot directory of a working TerriaJS application up to whatever web server runs your site and it will run there just as well as it does on the Node-based server. You'll have to make sure that all of your geospatial data is either on the same server or is hosted on servers that support CORS, and shapefile conversion won't be supported, but other than that you should be good to go.
Embedding TerriaJS in an existing web page is a bit trickier. You'll want to start with the index.js, index.html, and index.less files in the TerriaJS app you started with (NationalMap maybe?) and modify them to suite your needs. You'll need to use the gulp-based build process. But once that is all done, you can just copy the files up to your web server as before.
Depending on your needs, you may also consider embedding TerriaJS on your page in an iframe rather than building it into the page directly. You can control the content of the catalog and customize some basic aspects of the UI by specifying parameters to the URL. You can also control it by posting cross-window messages as described here.
Finally, it's possible to use TerriaJS without the provided user interface, e.g. by providing your own. This is a pretty advanced scenario, though, so probably best to post a separate question if you want to go down that road.

How do I host HTML files on cloudant?

the answer to this question must be so trivial because I can't find anything that spells it out for me.
I'm trying to set up a database on cloudant but I keep hearing that to abide the same origin policy the html files will need to be hosted in the same location.
How do I get my html files onto my cloudant domain?
I feel pretty stupid that I haven't been able to figure this out for myself.
You can host static sites on Cloudant similarly to CouchDB. Your best "Getting Started" resource is probably CouchApp.org which explains the mechanism and provides links to tooling which will help you bundle the assets together.
It's also worth mentioning that Cloudant now supports CORS so an externally hosted site is possible as well.
As attachments.
Upload your files as attachments and then access them by going to https://you.cloudant.com/dbname/documentid/name_of_file.html.
Tools like erica (a bigger list of options here) will do that for you. With them, you just need to put all your HTML, CSS and JS files in a folder and the tool will save them all as attachments of a Design Document, then that bundle will become your Couchapp.
(After that you just have to mix some ajax calls to _views and pure docs with links to _list and _show functions -- if you want -- and you'll be a complete couchapper).

Clojure website to html and javascript?

The question is: is there a way to get or compile a website written in clojure to HTML and Javascript files without having .WAR file for the server? Thank you.
For that you may want to look into writing the site in ClojureScript. It's a different language though very similar to Clojure. This would make it possible to write the entire site using client side java script and static resources like HTML, CSS, Images, etc. Or you could use node to run the generated server side JavaScript.
Another option, depending on how I interpret your question would be to write it as a dynamic site in Clojure, then spider the whole thing using wget and save a static snapshot of it. Though perhaps that's not what you where asking for? You could also use Hickup or Enlive to create templates and then run the templates to produce html that you serve statically with no app server or dynamic content.
If you want to create a static site, there are couple of options,
https://github.com/nakkaya/static
https://github.com/liquidz/misaki

How to write documents like YUI user guides?

YUI user guides are really nice, please visit http://yuilibrary.com/yui/docs/event/ for example,I just wanna write documents like that. My question is: these documents were generated by some tools like Dockbook,Sphix or written by hand?
The YUI User Guides are generated from Mustache templates using a tool called Selleck. Selleck is a Node.js tool that generates pages from different templates based on the information provided in a component.json file and a predefined folder structure. One of the coolest features of this tool is that it has a --server mode which runs a local web server in which you can see the changes you made live by just refreshing the page.
You can check it out at http://yui.github.com/selleck/.

CMS for already-built site

I redesigned a website that was using CMS Made Simple. It's a relatively small site and I'm learning as I go along, so I first built the redesign using just HTML but I'm now going to use PHP includes.
But I don't know how to integrate what I'm building into the CMS. I searched around the server and I can't find any traces of the pages built with CMSMS, so I assume that everything is contained somewhere within the CMS.
But I want something that will allow pages to be built and edited both inside and outside the CMS. If it's done outside, I want to be able to just FTP the new or changed content to the server.
Is this possible, and if so, what would be the best free CMS?
Thank you.
I don't know if I understood yout question, but I think you don't understand the concept of a CMS.
The redesign you made should only change the Theme/Style files, the content itself should be changed only in the administration of the CMS. What you may change from outside and FTP is only the theme files.
Things work this way so the person that put content in the site doesn't have do be a designer/developer.
BUT, there are some kind of CMS that may allow you to do what you want, but they are not completely free. Give it a look at CushyCMS and PageLime.
Since they intend to be a CMS for editing already made static sites, you may use it and if needed you can pull some page from FTP, edit it and then push it back.
You can try Template Externalizer http://dev.cmsmadesimple.org/projects/externalizer, which will give you FTP Access to Edit different content blocks, all templates, css and some content. I'm sure it will make your life easier when developing or integrating HTML into the page.
Template Externalizer, "watches" a FTP folder. and when you upload files onto the server, it saves the changes into the database making your change visible right away.
The files willl be located here: CMSROOT-INSTALLATION-PLACE/tmp/externalizer/
I hope this helps a bit.

Resources