hexojs / hexo-generator-feed

Feed generator for Hexo.

Home Page:http://hexo.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Option to remove generator from output atom.xml

freak3dot opened this issue · comments

I would like to remove the <generator uri="http://hexo.io/">Hexo</generator> tag from my atom.xml file. I'm using version 2.0.0 of hexo-generator-feed.

The generator tag is not required per https://validator.w3.org/feed/docs/atom.html#optionalFeedElements

I believe it adds unnecessary bytes to the payload. I also believe it reveals details about my site that I would rather not share.

I looked through the options and there is no option to remove the tag via options.

I also looked for an option to replace the template with my own template. That option doesn't exist either. The option to replace the template would be useful for a wide variety of use cases and is probably the best solution. For an example of a template option, see https://github.com/hexojs/hexo-generator-sitemap

commented

Well, you see, it is an optional tag, not a deprecated tag. I see no reason we have to remove it.

'<generator uri="http://hexo.io/">Hexo</generator>'.length
// 49

49 bytes is not such a big payload, unless your RSS is been requested 1 Million times a day or more.

49 bytes is not such a big payload

That's only one of the reasons I want to remove it. The other reason is that it reveals details about the tooling behind my site. That used to be a problem before static sites because that information could be used to exploit the site. I guess it's not much of an issue with a static site.

In any case my real suggestion is that hexo-generator-feed should have an option for a custom template like hexo-generator-sitemap. This would allow developers to customize the feed in numerous ways. It would meet my needs as well as allow developers to support other use cases like replacing text.

In any case my real suggestion is that hexo-generator-feed should have an option for a custom template like hexo-generator-sitemap.

+1

Meanwhile, another option is that you could also re-implement this plugin as a custom script, which is what I did for my blog (source).

Making a bit of publicity for Hexo is our right. As this plugin is open source. It's up to you to clone it and remove the publicity :)