Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

akashacms-base

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

akashacms-base - npm Package Compare versions

Comparing version 0.6.1 to 0.6.3

71

index.js

@@ -265,46 +265,29 @@ /**

module.exports.mahabhuta.addMahafunc(
function($, metadata, dirty, done) {
if (metadata.config.authorship) {
var auname;
if (!metadata.authorname && metadata.config.authorship.defaultAuthorName) {
auname = metadata.config.authorship.defaultAuthorName;
} else if (metadata.authorname) {
auname = metadata.authorname;
}
if (auname) {
var elements = [];
$('author-link').each(function(i, elem) { elements.push(elem); });
if (elements.length <= 0) return done();
log('author-link');
async.eachSeries(elements,
function(element, next) {
var author;
for (var i in metadata.config.authorship.authors) {
if (metadata.config.authorship.authors[i].name === auname) {
author = metadata.config.authorship.authors[i];
break;
}
}
if (author) {
akasha.partial(metadata.config, "ak_authorship.html.ejs", {
fullname: author.fullname,
authorship: author.authorship
})
.then(html => {
$(element).replaceWith(html);
next();
})
.catch(err => { next(err); });
} else {
log('no author data found for '+ auname);
next();
}
}, function(err) {
if (err) { error(err); done(err); }
else { done(); }
});
} else done();
} else done();
});
// TODO revamp this
// TODO this doesn't seem to be used anywhere so I haven't tested it.
class AuthorLinkElement extends mahabhuta.CustomElement {
get elementName() { return "author-link"; }
process($element, metadata, dirty, done) {
if (typeof metadata.config.authorship === 'undefined') {
return Promise.resolve("");
}
var author;
for (var i in metadata.config.authorship.authors) {
if (metadata.config.authorship.authors[i].name === auname) {
author = metadata.config.authorship.authors[i];
break;
}
}
if (author) {
return akasha.partial(metadata.config, "ak_authorship.html.ejs", {
fullname: author.fullname,
authorship: author.authorship
});
} else {
console.error(`author-link: no author data found for ${auname} in ${metadata.document.path}`);
throw new Error(`author-link: no author data found for ${auname} in ${metadata.document.path}`);
}
}
}
module.exports.mahabhuta.addMahafunc(new AuthorLinkElement());

@@ -311,0 +294,0 @@ class OpenGraphPromoteImages extends mahabhuta.Munger {

@@ -29,3 +29,3 @@ {

},
"version": "0.6.1",
"version": "0.6.3",
"engines": {

@@ -32,0 +32,0 @@ "node": ">=6.1"

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc