Skip to content

Feature: firestore visitor counter#1978

Merged
ivan-nginx merged 3 commits intoiissnan:masterfrom
maple3142:master
Nov 1, 2017
Merged

Feature: firestore visitor counter#1978
ivan-nginx merged 3 commits intoiissnan:masterfrom
maple3142:master

Conversation

@maple3142
Copy link
Copy Markdown
Contributor

@maple3142 maple3142 commented Nov 1, 2017

PR Type

What kind of change does this PR introduce?

  • Bugfix.
  • [*] Feature.
  • Code style update (formatting, local variables).
  • Refactoring (no functional changes, no api changes).
  • Build related changes.
  • CI related changes.
  • Documentation content changes.
  • Other... Please describe:

What is the current behavior?

Issue Number(s): N/A

What is the new behavior?

Add a visitors counter for each article.

  • Screens with this changes:
  • Link to demo site with this changes: link

How to use?

In NexT _config.yml:

# Another tool to show number of visitors to each article.
# visit https://console.firebase.google.com/u/0/ to get apiKey and projectId
# visit https://firebase.google.com/docs/firestore/ to get more information about firestore
firestore:
  enable: false
  collection: articles #required, a string collection name to access firestore database
  apiKey: #required
  projectId: #required

Does this PR introduce a breaking change?

  • Yes.
  • No.

Copy link
Copy Markdown
Collaborator

@ivan-nginx ivan-nginx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And please, remove yarn.lock file from pull (8988398).

Comment thread layout/_layout.swig
@@ -10,6 +10,7 @@
{% include '_partials/head.swig' %}
<title>{% block title %}{% endblock %}</title>
{% include '_third-party/analytics/index.swig' %}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think firestore count need to add into _third-party/analytics/index.swig (where leancloud already exists) instead of global layout.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in e52c4fd

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So fast fix! 👍

But i'm sorry, it was mistake about move to _third-party/analytics/index.swig.
Please, add firestore in line 84, after _third-party/analytics/lean-analytics.swig:

{% include '_third-party/analytics/lean-analytics.swig' %}

+{% include '_third-party/analytics/firestore.swig' %}

I think it will right.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok
0935f11

@ivan-nginx
Copy link
Copy Markdown
Collaborator

Good job and thank you! 👍

@ivan-nginx ivan-nginx merged commit 4613a57 into iissnan:master Nov 1, 2017
@ivan-nginx ivan-nginx added this to the v5.1.4 milestone Nov 1, 2017
@maple3142 maple3142 mentioned this pull request Nov 3, 2017
hk-mp5a3 pushed a commit to hk-mp5a3/hexo-theme-next that referenced this pull request Oct 11, 2025
Feature: firestore visitor counter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants