Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
blog-easy-client
Advanced tools
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
blog-easy-client is a javascript client library for blog-easy which enables us to integrates a full automated blog system to a website without having to write any code. It consists of :
A javascript client library for the browser (this repository)
Header
, Sub-headers
, Paragraphs
, Notes
, List
, images
, code-snippets
and many more elementsA Node.js package (for server)
npm i blog-easy-client
Once you have installed the blog-easy-client library, you can now init the client.
Using CDN
<script src="https://cdn.allkods.in/blog-easy-client.js"></script>
using NPM
import { blogEasy } from 'blog-easy-client'
blogEasy({
wrapper: /* The selected div container where all the elements will added */,
post: /* URL or route where the data will be posted */,
type: /* can be upload or edit */
})
blogEasy({
wrapper: document.getElementById('container'),
post: '/blogPost',
type: 'upload'
})
blogEasy({
wrapper: document.getElementById('container'),
post: '/blogPost',
type: 'edit'
})
To style elements you need to link your custom CSS and pass the class name to the elements as follow:
blogEasy({
wrapper: document.getElementById('container'),
post: '/blogPost',
type: 'upload',
class:{
header : 'custom_class_name',
subHeader : 'custom_class_name',
para : 'custom_class_name',
h3 : 'custom_class_name',
h4 : 'custom_class_name',
h5 : 'custom_class_name',
h6 : 'custom_class_name',
list : 'custom_class_name',
listElem : 'custom_class_name',
paraSpace : 'custom_class_name',
note : 'custom_class_name',
code : 'custom_class_name',
imageBox : 'custom_class_name',
coverImage : 'custom_class_name',
date : 'custom_class_name'
}
})
For styling all the text of code, Select all the child element with a
*
, Example :your_class *{}
<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
<% if(next) {%>
<a href="/blog?page=<%= page+1 %>&search=<%= search %>">Next</a>
<% } %>
<% if(back) {%>
<a href="/blog?page=<%= page-1 %>&search=<%= search %>">Back</a>
<% } %>
<% 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>
<% }) %>
<div><%- blogHtml %></div>
You can use
<%= blogTitle %>
and<%= blogImageSrc %>
in their meta tags for creating search engine friendly content
<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
<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
FAQs
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
The npm package blog-easy-client receives a total of 1 weekly downloads. As such, blog-easy-client popularity was classified as not popular.
We found that blog-easy-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.