Last active
December 20, 2015 21:59
-
-
Save vagnerzampieri/6202010 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang='pt' ng-app='FrelletoBlog'> | |
| {% include head.html %} | |
| <body class="preview" id="top" data-spy="scroll" data-target=".subnav" data-offset="80"> | |
| {% include navbar.html %} | |
| <div class="container" ng-controller='SearchController'> | |
| {{ content }} | |
| </div> <!-- /container --> | |
| {% include footer.html %} | |
| </body> | |
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var FrelletoBlog = angular.module('FrelletoBlog', []); | |
| FrelletoBlog.filter('highlight', function () { | |
| return function (text, filter) { | |
| if (filter === '') { | |
| return text; | |
| } | |
| else { | |
| return text.replace(new RegExp(filter, 'gi'), '<span class="match">$&</span>'); | |
| } | |
| }; | |
| }); | |
| SearchController.$inject = ['$scope']; | |
| function SearchController($scope) { | |
| $scope.posts = FrelletoBlog.posts; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [ | |
| {% for post in site.posts %} | |
| { | |
| "title" : "{{ post.title }} - {{ post.author}}", | |
| "url" : "{{ post.url }}", | |
| "date" : "{{ post.date | date_to_string }}", | |
| "subtitle" : "{{ post.subtitle}}", | |
| }{% if forloop.rindex0 != 0 %},{% endif %} | |
| {% endfor %} | |
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| layout: default | |
| title: Blog - Frelleto | |
| --- | |
| <script type='text/javascript'> | |
| FrelletoBlog.posts = {% include Helper/FrelletoBlogPosts %} | |
| </script> | |
| {% include search.html %} | |
| <div id="home"> | |
| <ul class="posts"> | |
| <div class="post" ng-repeat="post in posts | filter:searchText"> | |
| <li><span ng-bind-html-unsafe="post.date | highlight:searchText"></span> » <a ng-href="{{ '{{ post.url' }} }}" ng-bind-html-unsafe="post.title | highlight:searchText"></a></li> | |
| <p ng-bind-html-unsafe="post.subtitle | highlight:searchText"></p> | |
| <hr/> | |
| </div> | |
| </ul> | |
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="right"> | |
| <input type='search' class='form-controll col-lg-8' placeholder="Busca" data-ng-model='searchText'> | |
| </div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment