Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added blogs #55

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added public/__pycache__/app.cpython-38.pyc
Binary file not shown.
Binary file added public/__pycache__/configFile.cpython-38.pyc
Binary file not shown.
445 changes: 285 additions & 160 deletions public/app.py

Large diffs are not rendered by default.

12 changes: 0 additions & 12 deletions public/key.json

This file was deleted.

8,334 changes: 8,333 additions & 1 deletion public/static/css/bootstrap.min.css

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions public/static/js/scripts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*!
* Start Bootstrap - Clean Blog v6.0.3 (https://startbootstrap.com/theme/clean-blog)
* Copyright 2013-2021 Start Bootstrap
* Licensed under MIT (https://github.com/StartBootstrap/startbootstrap-clean-blog/blob/master/LICENSE)
*/
window.addEventListener('DOMContentLoaded', () => {
let scrollPos = 0;
const mainNav = document.getElementById('mainNav');
const headerHeight = mainNav.clientHeight;
window.addEventListener('scroll', function() {
const currentTop = document.body.getBoundingClientRect().top * -1;
if ( currentTop < scrollPos) {
// Scrolling Up
if (currentTop > 0 && mainNav.classList.contains('is-fixed')) {
mainNav.classList.add('is-visible');
} else {
console.log(123);
mainNav.classList.remove('is-visible', 'is-fixed');
}
} else {
// Scrolling Down
mainNav.classList.remove(['is-visible']);
if (currentTop > headerHeight && !mainNav.classList.contains('is-fixed')) {
mainNav.classList.add('is-fixed');
}
}
scrollPos = currentTop;
});
})
107 changes: 107 additions & 0 deletions public/templates/add_blog_post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{% include './includes/_navbar.html' %}

<body>
<h2 style="text-align: center; color: white;">Add blog post</h2>
<hr >
<!-- Main Content -->
<div style="color:white" class="container">
<div class="row">
<div class="col-lg-8 col-md-10 mx-auto">

<form name="addForm" id="addForm" method="POST" action="{{ url_for('addPost') }}" novalidate>
<div class="control-group">
<div class="form-group floating-label-form-group controls">
<label>Title</label>
<input type="text" class="form-control" placeholder="Title" name="title" id="title" required
data-validation-required-message="Please enter a title.">
<p class="help-block text-danger"></p>
</div>
</div>
<div class="control-group">
<div class="form-group floating-label-form-group controls">
<label>Subtitle</label>
<input type="text" class="form-control" placeholder="Subtitle" name="subtitle" id="subtitle"
required data-validation-required-message="Please enter subtitle.">
<p class="help-block text-danger"></p>
</div>
</div>
<div class="control-group">
<div class="form-group col-xs-12 floating-label-form-group controls">
<label>Author</label>
<input type="text" class="form-control" placeholder="Author" name="author" id="author" required
data-validation-required-message="Please enter author name.">
<p class="help-block text-danger"></p>
</div>
</div>
<div class="control-group">
<div class="form-group col-xs-12 floating-label-form-group controls">
<label>Topic:</label>
<input type="text" class="form-control" placeholder="UI/UX, Web Development, App Development, Career Advice" name="topic" id="topic" required
data-validation-required-message="Please enter topic.">
<p class="help-block text-danger"></p>
</div>
</div>


<div class="control-group">
<div class="form-group col-xs-12 floating-label-form-group controls">
<label>Image-Url</label>
<input type="text" class="form-control" placeholder="background image url" name="imageUrl"
id="imageUrl" required data-validation-required-message="Please enter ">
<p class="help-block text-danger"></p>
</div>
</div>
<div class="control-group">
<div class="form-group floating-label-form-group controls">
<label>Blog Content</label>
<textarea rows="5" class="form-control" placeholder="Blog content" name="content" id="content"
required data-validation-required-message="Please enter blog content."></textarea>
<p class="help-block text-danger"></p>
</div>
</div>
<br>
<div id="success"></div>
<div class="form-group">
<button type="submit" class="btn btn-primary" id="sendButton">Post Blog</button>
</div>
</form>
</div>
</div>


<hr>

<h2 style="text-align: center;">Instructions to add blogs:</h2>
<p style="margin: 10px;" >

## Every Paragraph should be in <code>p</code> tag.
<br>
## for Heading use <code>h2</code> tag with <code>class='section-heading'</code>
<br>
## For qoute style use <code>blockquote</code> with <code>class="blockquote"</code>
<br>
## for any image add <code>class="img-fluid" </code> to make it responsive.
<br>
## <code>span</code> tag can be used as description for image with <code>class="caption text-muted"</code>.
<br>
## You can also embed codepens by copy pasting the code from codepen dashboard.
<br>
## For list use <code>h2</code>for heading with <code>class='section-heading'</code> and <code>ol , li</code> as used in html.
</p>

<hr >
<!-- Core theme JS-->
<!-- <script src="https://cdn.ckeditor.com/4.16.1/standard/ckeditor.js"></script>
<script>
CKEDITOR.replace('content');
</script> -->
<script src="https://rawgit.com/jackmoore/autosize/master/dist/autosize.min.js"></script>
<script src="{{url_for('static' , filename='js/scripts.js')}}"></script>
<script src="https://www.gstatic.com/firebasejs/8.6.8/firebase-app.js"></script>
<script>autosize(document.getElementById("content"))</script>


</body>


{% include './includes/footer.html' %}
45 changes: 45 additions & 0 deletions public/templates/blog_post.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{% include './includes/_navbar.html' %}


<body>
<!-- Page Header-->
{% if post|length > 0 %}
{% for thisPost in post %}
<header class="masthead" style="background-image: url({{thisPost.image}}) ;background-size:cover; height: 25rem;">
<div class="container position-relative px-4 px-lg-5">
<div class="row gx-4 gx-lg-5 justify-content-center">

<div class="col-md-10 col-lg-8 col-xl-7">
<div class="post-heading" >
<h1>{{thisPost.title|safe}}</h1>
<h2 class="subheading">{{thisPost.subtitle}}</h2>
<span class="meta">
Posted by
<a href="#!" style="color:#fff;text-decoration: none;">{{thisPost.author}}</a>
on {{thisPost.date}}
</span>
</div>
</div>
</div>
</div>
</header>
<!-- Post Content-->
<article class="mb-4 mt-4">
<div class="container px-4 px-lg-5">
<div class="row gx-4 gx-lg-5 justify-content-center">
<div class="col-md-10 col-lg-8 col-xl-7" style="color: white; ">
{{thisPost.blogContent|safe}}
</div>
{% endfor %}
{% endif %}
</div>
</div>
</article>


<!-- Core theme JS-->
<script src="{{url_for('static' , filename='js/scripts.js')}}"></script>

</body>

{% include './includes/footer.html' %}
Loading