formatting and semantics

This commit is contained in:
sakrecoer 2020-12-15 21:15:33 +01:00
parent e4443eca9f
commit 6e8a81051e
5 changed files with 98 additions and 54 deletions

View file

@ -12,8 +12,7 @@
href="{{ author.gpg }}" rel="pgpkey authn">GPG</a>{% endif %}</p>
<p class="date">
Published the
{% include dates.html %}
<time datetime="{{ page.date }}">{% include dates.html %}</time>
</p>
{% endif %}

View file

@ -4,7 +4,53 @@ layout: default
{% if page.category == 'releases' %}
{% include header.html %}
<script type="text/javascript">
function generateRandomPosts()
{
$.getJSON("/posts.json", function(data) {
console.log("[posts.json loaded for random posts]");
var postsCount = data.length;
var posts = data;
var randomIndexUsed = [];
var counter = 0;
var numberOfPosts = 1;
var divRandomPosts = $("#random_posts");
while (counter < numberOfPosts)
{
var randomIndex = Math.floor(Math.random() * postsCount);
if (randomIndexUsed.indexOf(randomIndex) == "-1")
{
var postHREF = posts[randomIndex].href;
var postTitle = posts[randomIndex].title;
if (counter == (numberOfPosts - 1))
{
divRandomPosts.append('<a class="button" href="' + postHREF + '">🔥</a>');
}
else
{
divRandomPosts.append('<a class="button" href="' + postHREF + '">🔥</a>');
}
randomIndexUsed.push(randomIndex);
counter++;
}
}
});
}
$(document).ready(function() {
generateRandomPosts();
});
</script>
<section id="play">
<div class="album-player">
@ -111,9 +157,11 @@ layout: default
</div>
{% endif %}
<p class="right" id="npTitle" style="font-weight: bold;"></p>
<p class="left" id="npAction">Paused...</p>
</div>
<p id="npTitle" style="font-weight: bold;"></p>
<div id="random_posts" style="margin-right: 40px;"></div>
</div>
</div>
{% if onetracker > 1 %}

View file

@ -11,48 +11,36 @@ layout: default
{% endfor %}
<script type="text/javascript">
function generateRandomPosts()
{
$.getJSON("/posts.json", function(data) {
console.log("[posts.json loaded for random posts]");
function generateRandomPosts() {
$.getJSON("/posts.json", function (data) {
console.log("[posts.json loaded for random posts]");
var postsCount = data.length;
var posts = data;
var randomIndexUsed = [];
var counter = 0;
var numberOfPosts = 1;
var divRandomPosts = $("#random_posts");
while (counter < numberOfPosts) {
var randomIndex = Math.floor(Math.random() * postsCount);
if (randomIndexUsed.indexOf(randomIndex) == "-1") {
var postHREF = posts[randomIndex].href;
var postTitle = posts[randomIndex].title;
var postsCount = data.length;
var posts = data;
var randomIndexUsed = [];
var counter = 0;
var numberOfPosts = 1;
var divRandomPosts = $("#random_posts");
while (counter < numberOfPosts)
{
var randomIndex = Math.floor(Math.random() * postsCount);
if (randomIndexUsed.indexOf(randomIndex) == "-1")
{
var postHREF = posts[randomIndex].href;
var postTitle = posts[randomIndex].title;
if (counter == (numberOfPosts - 1))
{
divRandomPosts.append('<a class="button" href="' + postHREF + '">🔥</a>');
}
else
{
divRandomPosts.append('<a class="button" href="' + postHREF + '">🔥</a>');
}
randomIndexUsed.push(randomIndex);
counter++;
}
if (counter == (numberOfPosts - 1)) {
divRandomPosts.append('<a class="button" href="' + postHREF + '">🔥</a>');
}
});
else {
divRandomPosts.append('<a class="button" href="' + postHREF + '">🔥</a>');
}
randomIndexUsed.push(randomIndex);
counter++;
}
}
});
}
$(document).ready(function() {
generateRandomPosts();
$(document).ready(function () {
generateRandomPosts();
});
</script>

View file

@ -15,7 +15,7 @@ apps:
icon: 📺
external: true
- name: Read
link: '/log/#read'
link: '/log/'
icon: 📰
external: false
- name: Support

View file

@ -11,17 +11,26 @@ image: /images/pages/4-darkweb-instrumental-.jpeg
</section>
{% for post in site.posts %}
{% if post.category == 'ramblings' %}
<section class="news" style="margin:0;">
<div style="background-image:url({{ relBase }}{{ post.image }}"></div>
<div class="description">
<h2>{{ post.title }}</h2>
<p><strong>{% include forloop-dates.html %}</strong></p>
<p>{{ post.description }}</p>
<p><a href="{{ relBase }}{{ post.url }}#read" class="button">👀 Read post</a></p>
</div>
<section id="read" class="front-section">
<div style="background-image:url({{ post.image }})">
<p class="editor-link">
<a href="cloudcannon:collections/_posts/{{ post.path }}" rel="nofollow" class="btn">
<strong>&#9998;</strong> Edit Post
</a>
</p>
</div>
<div class="description">
<div class="container">
<div class="">
<h3>{{ post.title }}</h3>
<p><strong><time datetime="{{ post.date }}">{% include forloop-dates.html %}</time></strong></p>
<p>{{ post.description }}</p>
</div>
<div>
<p><a class="button" href="{{ relBase }}{{ post.url }}#read">📰 Read Highlight</a></p>
</div>
</div>
</div>
</section>
{% endif %}
{% endfor %}