Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

blog-easy-client

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

blog-easy-client - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

28

index.js

@@ -1596,18 +1596,19 @@ // Main OBJECT

inp.onkeydown = function(e){
if(e.key === 'Enter' && Selected.tagName === 'H1'){
e.preventDefault();
}
}
inp.oninput = function(e){
inp.style.height = '';
inp.style.height = inp.scrollHeight + "px";
inp.style.height = '';
inp.style.height = inp.scrollHeight + "px";
if(InpSpace && e.data === " " && Selected.tagName !== 'PRE'){
Input.value= Input.value.substring(0,Input.value.length-1);
return;
}
if(InpSpace && e.data === " " && Selected.tagName !== 'PRE'){
Input.value= Input.value.substring(0,Input.value.length-1);
return;
}
if(e.data === null && Selected.tagName === 'H1'){
Input.value= Input.value.substring(0,Input.value.length-1);
return;
}
e.data === " " ? InpSpace=true : InpSpace=false
e.data === " " ? InpSpace=true : InpSpace=false
}

@@ -1620,2 +1621,3 @@

destroyInput();
InpSpace = false;
}

@@ -1622,0 +1624,0 @@

{
"name": "blog-easy-client",
"version": "1.0.2",
"version": "1.0.3",
"description": "A javascript client library for blog-easy which integrates a fully automated blog CMS (content management system) which makes it easy to create and publish blog post",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -21,2 +21,6 @@ # blog-easy-client

## Screen Shots
---
![Preview 1](https://allkods.in/img/p1.jpg)![Preview 1](https://allkods.in/img/p2.jpg)![Preview 1](https://allkods.in/img/p3.jpg)![Preview 1](https://allkods.in/img/p4.jpg)
---
## Installation

@@ -102,79 +106,14 @@ ---

## How to use variables which are automatically passed to the views by [blog-easy](https://github.com/allkods/blog-easy)
## How to use variables which are automatically passed to the views by [blog-essy](https://github.com/allkods/blog-easy)
---
Read documentation here -> [setting up views](https://allkods.in/projects/blog-easy)
### Inside the view of getting all Blog Post
- How to create search bar
```html
<form action="/blog" method="GET">
<input name= "search" type="search" value="<%= search %>" placeholder="your search query here....">
<button>Search</button>
</form>
```
`The route for the action will be same as getting all blog post route`
- How to create next button
```html
<% if(next) {%>
<a href="/blog?page=<%= page+1 %>&search=<%= search %>">Next</a>
<% } %>
```
- How to create back button
```html
<% if(back) {%>
<a href="/blog?page=<%= page-1 %>&search=<%= search %>">Back</a>
<% } %>
```
- How to render all posts
```html
<% posts.forEach(post =>{ %>
<a href="/blog/<%= post.slug %>">
<div>
<p><%= post.title %></p>
<div style="
background:url('<%= post.coverImage %>');
background-size: cover;">
</div>
<p><%- readableDate %></p>
</div>
</a>
<% }) %>
```
### Inside the view of getting Single blog post
- How to render post
```html
<div><%- blogHtml %></div>
```
> You can use `<%= blogTitle %> `and `<%= blogImageSrc %>` in their meta tags for creating search engine friendly content
- How to create edit button
```html
<a href="/blog/<%= slug %>/edit">
<button>Edit</button>
</a>
```
> You can implement your own logic for showing button only if user is logged in or is admin
- How to create delete button
```html
<form action="/post-delete" method="POST">
<input type="hidden" name="slug" value="<%= slug %>">
<button>Delete</button>
</form>
```
> You can implement your own logic for showing button only if user is logged in or is admin
## Missing feature
---
- For adding links we have to use dafault html `<a>` tag ( we will be providing link adding feature soon. )
## TO-DO
---
- Link adding feature
- Automatic compression of images
- Converting the cover image into 2 qualities ( preview and original, to decrease the load time of view while viewing multiple post at a time )
- Tag adding feature
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc