Skip to content

Commit

Permalink
Fix config
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed Nov 28, 2020
1 parent a3bf3b8 commit c8fa54e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
const Util = require('@next-theme/utils');
const utils = new Util(hexo, __dirname);

function capitalize(input) {
return input.toString().charAt(0).toUpperCase() + input.toString().substr(1);
}

function iconText(icon, key, defaultValue) {
if (!defaultValue) {
defaultValue = capitalize(key);
Expand Down
6 changes: 3 additions & 3 deletions valine.njk
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{%- set serverURLs = theme.valine.serverURLs or 'https://' + theme.valine.appId.slice(0, 8) | lower + '.api.lncldglobal.com' %}
{%- set serverURLs = config.valine.serverURLs or 'https://' + config.valine.appId.slice(0, 8) | lower + '.api.lncldglobal.com' %}
<script>
NexT.utils.loadComments('#valine-comments', () => {
NexT.utils.getScript('{{ theme.vendors.valine }}', () => {
new Valine(Object.assign({{ theme.valine | safedump }}, {
NexT.utils.getScript('https://cdn.jsdelivr.net/npm/valine@1.4.14/dist/Valine.min.js', () => {
new Valine(Object.assign({{ config.valine | safedump }}, {
el: '#valine-comments',
path: {{ url_for(page.path) | replace(r/index\.html$/, '') | safedump }},
serverURLs: {{ serverURLs | safedump }}
Expand Down

0 comments on commit c8fa54e

Please sign in to comment.