devdata.io
devdata.io copied to clipboard
The Website Keywords Meta Tag
You can use the available datasets names in keywords, the current meta tag is:
<meta name="keywords" content="dev data, developer data, states list, countries list, list of states, list of countries"></meta>
but you can replace it with better functionally, easily include below code to your app.js
:
/**
* Config
*/
var supportedFormats = {
'javascript': 'JavaScript',
'php': 'PHP',
'python': 'Python',
'ruby': 'Ruby',
'csharp': 'C#',
'lua': 'Lua'
};
var datasets = {
'states': 'U.S. States',
'canadian-provinces': 'Canadian Provinces',
'countries': 'World Countries',
'currencies': 'World Currencies',
'timezones': 'World Time Zones',
'airport-codes': 'International Airport Codes',
'http-status-codes': 'HTTP Status Codes'
};
var keywords = [ 'dev data', 'developer data' ];
var dashPattern = new RegExp( '-', 'g' );
var datasetNames = Object.keys( datasets );
for ( var i = 0; i < datasetNames; i++ ) {
var datasetName = datasetNames[ i ];
datasetName.replace( dashPattern, ' ' ); // Remove dash from dataset name
keywords.push( datasetName + ' list' );
keywords.push( 'list of ' + datasetName );
}
keywords = keywords.toString(); // Convert the keywords array to string
/**
* Express
*/
var app = express();
app.set('view engine', 'jade');
app.engine('jade', require('jade').__express);
app.use(express.static(__dirname + '/public'));
app.get('/', function(req, res) {
res.render('index', { languages: supportedFormats, datasets: datasets, keywords: keywords });
});
then use it in your layout/main.jade
:
doctype html
html(lang="en")
head
meta(charset="utf-8")
meta(http-equiv="X-UA-Compatible", content="IE=edge")
meta(name="viewport", content="width=device-width, initial-scale=1.0")
meta(name="keywords", content="#{keywords}")
...
Nice idea. Thanks for this.
Thanks for accepting, i am very happy to see you are back.
@vlucas How can i join the repository? Can you add me?
Just added you.
I am tied up at work at the moment, but I should be able to do a new deploy in a few hours.
Thanks for adding me. Should i have website access to make the website changes?
I don't have an easy way of giving you access to deploy at the moment (like hooking this up to git), but let me know when it's ready, and I can deploy it manually.