Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add generator meta #649

Closed
wants to merge 1 commit into from
Closed

Add generator meta #649

wants to merge 1 commit into from

Conversation

chawyehsu
Copy link

This allow Wappalyzer to Identify the site is built with Hexo.

@NoahDragon
Copy link
Member

Thanks for the contribution. I never realize such meta tag before. Could you please also add Hexo version on it?

@chawyehsu
Copy link
Author

chawyehsu commented Feb 3, 2018

Many other applications use this meta tag, too. e.g. jekyll, hugo, etc.

I could add the semver, but we have to update the version number manually when Hexo update next time. I wonder if Hexo has exposed an API that we can get the version number (this would be the best solution).

@NoahDragon
Copy link
Member

Yeah, hexo.version should be able to derive the version of using Hexo package.

@chawyehsu
Copy link
Author

I tried by setup a fresh hexo instance via hexo init, then add the meta tag, it seems not working:

...
    2| <html>
    3| <head>
 >> 4|   <meta name="generator" content="Hexo <%= hexo.version %>">
    5|   <meta charset="utf-8">
    6|   <%- partial('google-analytics') %>
    7|   <%

hexo is not defined
...

Or maybe, I think we could implement the generator meta tag auto injection function, like hugo, in Hexo. This will affect all site built with Hexo, instead we do it one by one.

@JLHwung
Copy link
Contributor

JLHwung commented Feb 4, 2018

@h404bi Have you tried

<meta name="generator" content="Hexo {{ hexo.version }}">

You can check some swig examples at https://github.com/node-swig/swig-templates/tree/master/examples/express/views.

@chawyehsu
Copy link
Author

Yes, I tried, It's not the template syntax problem, It's because hexo.version is not accessible, hexo is undefined. Your PR works, by extending hexo helper. Look my comment left on your PR.

@chawyehsu
Copy link
Author

chawyehsu commented Feb 4, 2018

Oh, I mean @NoahDragon 's PR. #650
I have tested it on my blog instance: layout & script

@NoahDragon
Copy link
Member

@h404bi Thanks for the confirmation. I have made the change as you suggested. If you could review that change, it would be really appreciated.

@chawyehsu
Copy link
Author

@NoahDragon Your PR LGTM. I will close mine.

@chawyehsu chawyehsu closed this Feb 5, 2018
@chawyehsu chawyehsu deleted the patch-1 branch February 5, 2018 15:16
@NoahDragon
Copy link
Member

@h404bi Thank you. This is a really neat feature, we always like to know how many sites are using Hexo.

@chawyehsu
Copy link
Author

Yes. But as I said, this is only available on https://hexo.io. I think Hexo should implement the generator meta tag auto injection function, like hugo. Then all instances built with Hexo will have the meta tag. (I'm not very familiar with javascript, so I can't help with this new feature). But this is the final state I want. Otherwise Hexo users and developers have to add this meta tag into their instances' layout, manually. That's 'uncontrollable'.

I created the 'Add Hexo detection' Pull Request a month ago. And I added the meta tag into my blog instance. But till now, Wappalyzer doesn't have data available for Hexo yet.

Because currently there are rarely sites can be detected.

Thank you, too. Hope Hexo becomes greater!

@NoahDragon
Copy link
Member

@h404bi You are right, I will try to implement this feature into Hexo core, which every site using Hexo will automatically add this line in the head.

@NoahDragon NoahDragon mentioned this pull request Feb 5, 2018
53 tasks
yamgent pushed a commit to MarkBind/markbind that referenced this pull request Mar 14, 2019
The Agolia team has requested that we add <meta name="generator">
(#754) tags to identify pages generated by MarkBind. Since this tag is
part of HTML5 [1] and can be used by other external providers to
identify MarkBind generated sites, we can include this tag in all
MarkBind pages. We can also include the version number to allow
tracking the use of different MarkBind versions, as other projects
have done [2, 3].

Let's include the <meta name="generator"> tag to identify MarkBind
pages, as well as including the version number to track the use of
different MarkBind versions.

[1]: https://www.w3.org/TR/html5/document-metadata.html#generator
[2]: hexojs/site#649
[3]: gatsbyjs/gatsby#8221
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants