Skip to content

Commit

Permalink
adding comments
Browse files Browse the repository at this point in the history
  • Loading branch information
codermarcos committed Mar 5, 2018
1 parent 67f9425 commit 80a4317
Show file tree
Hide file tree
Showing 18 changed files with 500 additions and 457 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,5 @@
{
"files.associations": {
"*.ejs": ["xml","html"]
}
}
11 changes: 3 additions & 8 deletions _config.yml
Expand Up @@ -17,6 +17,9 @@ language: pt
date_format: YYYY-MM-DD
time_format: HH:mm:ss

# Show comments
comments: true

# RSS
feed:
type: atom
Expand Down Expand Up @@ -93,11 +96,3 @@ deploy:
branch: gh-pages
message: "Deploy theme: {{ now('YYYY-MM-DD HH:mm:ss') }})"

# Staticman
## Docs: https://staticman.net/docs/index.html

# FORM POST
comments:
username: codermarcos
branch: develop
repository: dev-dark-theme
2 changes: 1 addition & 1 deletion source/_data/comments/comment-2018-03-04_20-03-63.json
@@ -1 +1 @@
{"_id":"223b88b0-1fec-11e8-8e5c-bbd9119aac8b","date":"Sun Mar 04 2018 17:39:27 GMT-0300 (E. South America Standard Time)","lang":"pt","title":"About-Theme","category":"Theme","name":"Marcos","email":"5ccddd4e7cf7a5266ac229a691cabb5a","url":"https://staticman.net/docs/index.html","message":"Testando","data":"2018-03-04T20:39:28.636Z"}
{"_id":"223b88b0-1fec-11e8-8e5c-bbd9119aac8b","lang":"pt","title":"About-Theme","category":"Theme","name":"Marcos","email":"5ccddd4e7cf7a5266ac229a691cabb5a","url":"https://staticman.net/docs/index.html","message":"Testando","date":"2018-03-04T20:39:28.636Z"}
15 changes: 0 additions & 15 deletions staticman.yml

This file was deleted.

7 changes: 3 additions & 4 deletions themes/dev-dark-theme/layout/category.ejs
@@ -1,7 +1,7 @@
<%- partial('partial/category/header') %>
<main class="main-content">
<section class="categories index">
<div class="categories__container index">
<section class="categories">
<div class="categories__container">
<% site.categories.forEach((category) => { %>
<a
class="categories__category"
Expand All @@ -15,8 +15,7 @@
<%- partial('partial/post-item', {
title: post.title,
datetime: post.date,
categories:
post.categories,
categories: post.categories,
description: post.description,
lang: post.lang
}) %>
Expand Down
1 change: 1 addition & 0 deletions themes/dev-dark-theme/layout/layout.ejs
Expand Up @@ -5,6 +5,7 @@
<body itemscope itemprop="blogPost">
<%- body %>
<%- js('scripts/script.min') %>
<%- partial('partial/script-fb') %>
<%- partial('partial/analytics') %>
</body>
</html>
7 changes: 0 additions & 7 deletions themes/dev-dark-theme/layout/partial/comment/comments.ejs

This file was deleted.

16 changes: 0 additions & 16 deletions themes/dev-dark-theme/layout/partial/comment/form.ejs

This file was deleted.

4 changes: 4 additions & 0 deletions themes/dev-dark-theme/layout/partial/comments.ejs
@@ -0,0 +1,4 @@
<% if(config.comments) { %>
<div id="fb-root"></div>
<div class="fb-comments" data-colorscheme="dark" data-order-by="reverse_time" data-href="<%- config.url %>/<%- page.lang %>/<%- url_data(page.categories) %>/<%- url_title(page.title) %>" data-numposts="1"></div>
<% } %>
121 changes: 11 additions & 110 deletions themes/dev-dark-theme/layout/partial/footer.ejs
@@ -1,113 +1,14 @@
<footer class="main-footer">
<address class="social-icons">

<% if (config.feed.path) { %>
<a
class="icon"
target="_blank"
title="rss"
href="<%- config.feed.path %>">
<svg class="icon__svg">
<use xlink:href="#rss">
</svg>
</a>
<% } %>

<% if (theme.github) { %>
<a
class="icon"
target="_blank"
title="github"
href="<%- theme.github %>">
<svg class="icon__svg">
<use xlink:href="#github">
</svg>
</a>
<% } %>

<% if (theme.gmail) { %>
<a
class="icon"
target="_blank"
title="gmail"
href="<%- theme.gmail %>">
<svg class="icon__svg">
<use xlink:href="#gmail">
</svg>
</a>
<% } %>

<% if (theme.whatsapp) { %>
<a
class="icon"
target="_blank"
title="whatsapp"
href="<%- theme.whatsapp %>">
<svg class="icon__svg">
<use xlink:href="#whatsapp">
</svg>
</a>
<% } %>

<% if (theme.linkedin) { %>
<a
class="icon"
target="_blank"
title="linkedin"
href="<%- theme.linkedin %>">
<svg class="icon__svg">
<use xlink:href="#linkedin">
</svg>
</a>
<% } %>

<% if (theme.twitter) { %>
<a
class="icon"
target="_blank"
title="twitter"
href="<%- theme.twitter %>">
<svg class="icon__svg">
<use xlink:href="#twitter">
</svg>
</a>
<% } %>

<% if (theme.facebook) { %>
<a
class="icon"
target="_blank"
title="facebook"
href="<%- theme.facebook %>">
<svg class="icon__svg">
<use xlink:href="#facebook">
</svg>
</a>
<% } %>

<% if (theme.instagram) { %>
<a
class="icon"
target="_blank"
title="instagram"
href="<%- theme.instagram %>">
<svg class="icon__svg">
<use xlink:href="#instagram">
</svg>
</a>
<% } %>

<% if (theme.youtube) { %>
<a
class="icon"
target="_blank"
title="youtube"
href="<%- theme.youtube %>">
<svg class="icon__svg">
<use xlink:href="#youtube">
</svg>
</a>
<% } %>
</address>
<%- partial('partial/social/links', {
feed: config.feed.path,
github: theme.github,
gmail: theme.gmail,
whatsapp: theme.whatsapp,
linkedin: theme.linkedin,
twitter: theme.twitter,
facebook: theme.facebook,
instagram: theme.instagram,
youtube: theme.youtube
}) %>
</footer>
<%- partial('partial/svg-icons') %>
74 changes: 23 additions & 51 deletions themes/dev-dark-theme/layout/partial/post/footer.ejs
@@ -1,56 +1,26 @@
<h5 class="divisor"><%= __('share') %></h5>

<a
device-link
class="icon"
target="_blank"
data-action="share/whatsapp/share"
title="<%= __('shareon') %> whatsapp"
href='{ "mobile": "whatsapp://send?text=<%- config.url %>/<%- page.lang %>/<%- url_data(page.categories) %>/<%- url_title(page.title) %>/", "desktop": "https://web.whatsapp.com/send?text=<%- config.url %>/<%- page.lang %>/<%- url_data(page.categories) %>/<%- url_title(page.title) %>/" }'>
<svg class="icon__svg">
<use xlink:href="#whatsapp">
</svg>
</a>

<a
class="icon"
target="_blank"
title="<%= __('shareon') %> linkedin"
href="https://www.linkedin.com/shareArticle?mini=true&summary=<%- config.title %>&title=<%- page.title %>&url=<%- config.url %>/<%- page.lang %>/<%- url_data(page.categories) %>/<%- url_title(page.title) %>/">
<svg class="icon__svg">
<use xlink:href="#linkedin">
</svg>
</a>

<a
class="icon"
target="_blank"
title="twitter"
href="http://twitter.com/share?text=<%- page.title %>&url=<%- config.url %>/<%- page.lang %>/<%- url_data(page.categories) %>/<%- url_title(page.title) %>/&hashtags=<%- config.title %>,<%- url_data(page.categories) %>">
<svg class="icon__svg">
<use xlink:href="#twitter">
</svg>
</a>
<a
class="icon"
target="_blank"
title="<%= __('shareon') %> facebook"
href="https://www.facebook.com/sharer.php?u=<%- config.url %>/<%- page.lang %>/<%- url_data(page.categories) %>/<%- url_title(page.title) %>/&t=<%- page.title %>">
<svg class="icon__svg">
<use xlink:href="#facebook">
</svg>
</a>

<h5 class="divisor"><%= __('comment') %></h5>

<%- partial('partial/comment/form') %>

<%- partial('partial/comment/comments') %>

<%- partial('partial/social/share', {
whatsapp: {
message: `${config.url}/${page.lang}/${url_data(page.categories)}/${url_title(page.title)}`
},
linkedin: {
url: `${config.url}/${page.lang}/${url_data(page.categories)}/${url_title(page.title)}`,
title: page.title,
summary: config.title
},
twitter: {
text: page.title,
tags: `${config.title},${url_data(page.categories)}`,
url: `${config.url}/${page.lang}/${url_data(page.categories)}/${url_title(page.title)}`,
},
facebook: {
url: `${config.url}/${page.lang}/${url_data(page.categories)}/${url_title(page.title)}`,
title: page.title
}
}) %>

<h5 class="divisor"><%= __('tags') %></h5>
<% if (page.tags.length > 0) { %>
<h5 class="divisor"><%= __('tags') %></h5>
<section class="tags">
<div class="tags__container">
<% page.tags.forEach((tag) => { %>
Expand All @@ -64,4 +34,6 @@
<% } %>

<%- partial('partial/comments') %>

<%- partial('partial/svg-icons') %>
12 changes: 12 additions & 0 deletions themes/dev-dark-theme/layout/partial/script-fb.ejs
@@ -0,0 +1,12 @@
<% if(config.comments) { %>
<script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.12';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script>
<% } %>

0 comments on commit 80a4317

Please sign in to comment.