Why language specific params defined in “[lanuage]” missing some information defined outside “[lanuage]” [params] [params.home] var1 ="1" var2 ="2" [languages] [languages.en] [languages.en.params.home] var1="changed" The language specific params will override the variable with the same name defined outside of “[language]“, In above example, there is no var2 availble, and Site.Params.Home only can see var1=“changed” Why baseURL defined in config file doesn’t take effect when running in hugo server mode?

Read More…

CORS in Golang

2017-11-17

Background While I design wxgigo installer, I would like to get install configuration web via http, and then go through https to save install configuration into server, because the deploy information contains sensitive server access crendentials. Below is what I did: ... function getHttpsUrl(pathname) { var withSlash = true; if (pathname.substring(0, 1) == "/") { withSlash = false; } var httpsUrl = "https://" + window.location.hostname; if (withSlash) { httpsUrl += "/" + pathname; }else{ httpsUrl += pathname; } return httpsUrl } .

Read More…

How to send jquery datatables data via Ajax A: Use: dataTable_instanc().rows().data().toArray() How to send json data via Ajax A: It need use JSON.stringtify(Array) to make the javascript object/array to be string, and set the contentType to be: “application/json; charset=utf-8” $.ajax({ ... contentType:"application/json; charset=utf-8", data: JSON.stringtify({'name': 'ryan'}) }) How to send Vue instance data via Ajax A: Use {‘key’: Vue_instance.$data } $.ajax({ ... contentType:"application/json; charset=utf-8", data: JSON.stringtify({'general': general.$data}) })