Skip to content

Commit

Permalink
add preview image
Browse files Browse the repository at this point in the history
  • Loading branch information
naustica committed Sep 4, 2024
1 parent 8811e77 commit 34355f5
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 161 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ author:
date: "`r Sys.Date()`"
output: distill::distill_article
bibliography: literature.bib
preview: distill-preview.png
css: vis.css
---

Expand Down
18 changes: 9 additions & 9 deletions _posts/openalex_document_types/openalex_document_types_2024.html

Large diffs are not rendered by default.

266 changes: 133 additions & 133 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2174,153 +2174,153 @@ <h3>${suggestion.title}</h3>
<!--radix_placeholder_site_before_body-->
<!--/radix_placeholder_site_before_body-->
<!--radix_placeholder_article_listing-->


<script type="application/javascript">

function init_posts_list() {

function load_image(img) {
var src = $(img).attr('data-src');
if (src) {
$(img).attr('src', src);
$(img).on("load", function() {
img.removeAttribute('data-src');
});
}
}

function set_posts_visible(posts, visible) {
if (visible) {

// show bottom border by default
$(posts).removeClass('post-preview-last');

// apply limits if need be
var max_posts = 25;
var apply_limits = $('.posts-container').hasClass('posts-apply-limit');
if (apply_limits && posts.length > max_posts) {
posts = $(posts).slice(0, max_posts);
} else {
$('.posts-more a').addClass('hidden');
}

// apply last style
$(posts.slice(-1)[0]).addClass('post-preview-last');

$(posts).removeClass('hidden');
$(posts).find('img[data-src]').each(function(i, img) {
load_image(img);
});
} else {
$(posts).addClass('hidden');
}
}

function apply_hash_filter() {

// clear active state
$('.categories .active').removeClass('active');

// mark all posts invisible to start
set_posts_visible($('.posts-list').children('a'), false);

// if we have a hash filter
if (window.location.hash && window.location.hash.startsWith("#category:")) {

// mark posts that match the category visible
var page_category = window.location.hash.replace(/^#category:/, "");
page_category = decodeURIComponent(page_category)
var posts = $('.post-metadata').map(function(idx, script) {
var metadata = $.parseJSON($(script).html());
var post = null;
$.each(metadata.categories, function(idx, category) {
category = category.replace(/ /g,"_");
if ((page_category || '').toLowerCase() === "articles" || category === page_category) {
post = $(script).parent().get();
return false;
}
});
return post;
});
set_posts_visible(posts, true);

// mark the hash active
$('.categories li>a[href="' + decodeURIComponent(window.location.hash) + '"]').addClass('active');

// update the list_caption
var list_caption = $('.posts-list-caption');
var caption = (page_category || '').toLowerCase() === "articles"
? list_caption.attr('data-caption')
: ('Category: ' + page_category.replace(/_/g," "));
list_caption.text(caption);

} else {

// no hash filter, make all posts visible (subject to max display)
set_posts_visible($('.posts-list').children(), true);

// reset list caption
var list_caption = $('.posts-list-caption');
list_caption.text(list_caption.attr('data-caption'));


}
}

// more articles
function apply_post_limits(apply) {
if (apply) {
$('.posts-container').addClass('posts-apply-limit');
$('.posts-more a').removeClass('hidden');
} else {
$('.posts-container').removeClass('posts-apply-limit');
$('.posts-more a').addClass('hidden');
}
}

// click handling for tags
$('.dt-tag').click(function(ev) {
window.location.hash = '#category:' + $(this).text().replace(/ /g, "_");
return false;
})

// hash filter handling
apply_hash_filter();
$(window).on('hashchange',function() {
apply_post_limits(true);
apply_hash_filter();
});

// more articles link
$('.posts-more a').click(function(e) {
e.preventDefault();
apply_post_limits(false);
apply_hash_filter();
return false;
});

}

</script>




<script type="application/javascript">

function init_posts_list() {

function load_image(img) {
var src = $(img).attr('data-src');
if (src) {
$(img).attr('src', src);
$(img).on("load", function() {
img.removeAttribute('data-src');
});
}
}

function set_posts_visible(posts, visible) {
if (visible) {

// show bottom border by default
$(posts).removeClass('post-preview-last');

// apply limits if need be
var max_posts = 25;
var apply_limits = $('.posts-container').hasClass('posts-apply-limit');
if (apply_limits && posts.length > max_posts) {
posts = $(posts).slice(0, max_posts);
} else {
$('.posts-more a').addClass('hidden');
}

// apply last style
$(posts.slice(-1)[0]).addClass('post-preview-last');

$(posts).removeClass('hidden');
$(posts).find('img[data-src]').each(function(i, img) {
load_image(img);
});
} else {
$(posts).addClass('hidden');
}
}

function apply_hash_filter() {

// clear active state
$('.categories .active').removeClass('active');

// mark all posts invisible to start
set_posts_visible($('.posts-list').children('a'), false);

// if we have a hash filter
if (window.location.hash && window.location.hash.startsWith("#category:")) {

// mark posts that match the category visible
var page_category = window.location.hash.replace(/^#category:/, "");
page_category = decodeURIComponent(page_category)
var posts = $('.post-metadata').map(function(idx, script) {
var metadata = $.parseJSON($(script).html());
var post = null;
$.each(metadata.categories, function(idx, category) {
category = category.replace(/ /g,"_");
if ((page_category || '').toLowerCase() === "articles" || category === page_category) {
post = $(script).parent().get();
return false;
}
});
return post;
});
set_posts_visible(posts, true);

// mark the hash active
$('.categories li>a[href="' + decodeURIComponent(window.location.hash) + '"]').addClass('active');

// update the list_caption
var list_caption = $('.posts-list-caption');
var caption = (page_category || '').toLowerCase() === "articles"
? list_caption.attr('data-caption')
: ('Category: ' + page_category.replace(/_/g," "));
list_caption.text(caption);

} else {

// no hash filter, make all posts visible (subject to max display)
set_posts_visible($('.posts-list').children(), true);

// reset list caption
var list_caption = $('.posts-list-caption');
list_caption.text(list_caption.attr('data-caption'));


}
}

// more articles
function apply_post_limits(apply) {
if (apply) {
$('.posts-container').addClass('posts-apply-limit');
$('.posts-more a').removeClass('hidden');
} else {
$('.posts-container').removeClass('posts-apply-limit');
$('.posts-more a').addClass('hidden');
}
}

// click handling for tags
$('.dt-tag').click(function(ev) {
window.location.hash = '#category:' + $(this).text().replace(/ /g, "_");
return false;
})

// hash filter handling
apply_hash_filter();
$(window).on('hashchange',function() {
apply_post_limits(true);
apply_hash_filter();
});

// more articles link
$('.posts-more a').click(function(e) {
e.preventDefault();
apply_post_limits(false);
apply_hash_filter();
return false;
});

}

</script>



<div class="posts-container posts-apply-limit l-page">
<div class="posts-list">
<h1 class="posts-list-caption" data-caption="Blog | Scholarly Communication Analytics with R">Blog | Scholarly Communication Analytics with R</h1>
<a href="posts/openalex_document_types/" class="post-preview">
<script class="post-metadata" type="text/json">{"categories":[]}</script>
<div class="metadata">
<div class="publishedDate">Sept. 4, 2024</div>
<div class="publishedDate">Sept. 3, 2024</div>
<div class="dt-authors">
<div class="dt-author">Nick Haupka</div>
<div class="dt-author">Sophia Dörner</div>
<div class="dt-author">Najko Jahn</div>
</div>
</div>
<div class="thumbnail">
<img/>
<img src="posts/openalex_document_types/distill-preview.png"/>
</div>
<div class="description">
<h2>Recent Changes in Document type classification in OpenAlex compared to Web of Science and Scopus</h2>
Expand Down
5 changes: 3 additions & 2 deletions docs/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ to publish case-studies rapidely showing how to support data-driven workflows an
decision-making around scholarly communication in libraries using R.
</description>
<generator>Distill</generator>
<lastBuildDate>Wed, 04 Sep 2024 00:00:00 +0000</lastBuildDate>
<lastBuildDate>Tue, 03 Sep 2024 00:00:00 +0000</lastBuildDate>
<item>
<title>Recent Changes in Document type classification in OpenAlex compared to Web of Science and Scopus</title>
<dc:creator>Nick Haupka</dc:creator>
Expand All @@ -20,7 +20,8 @@ decision-making around scholarly communication in libraries using R.
<link>https://subugoe.github.io/scholcomm_analytics/posts/openalex_document_types</link>
<description>In June 2024, we published a preprint on the classification of document types in OpenAlex and compared it with the scholarly databases Web of Science, Scopus, PubMed and Semantic Scholar. In this follow-up study, we want to investigate further developments in OpenAlex and compare the results with the proprietary databases Scopus and Web of Science.</description>
<guid>https://subugoe.github.io/scholcomm_analytics/posts/openalex_document_types</guid>
<pubDate>Wed, 04 Sep 2024 00:00:00 +0000</pubDate>
<pubDate>Tue, 03 Sep 2024 00:00:00 +0000</pubDate>
<media:content url="https://subugoe.github.io/scholcomm_analytics/posts/openalex_document_types/distill-preview.png" medium="image" type="image/png" width="1416" height="1250"/>
</item>
<item>
<title>Analysing and reclassifying open access information in OpenAlex</title>
Expand Down
Loading

0 comments on commit 34355f5

Please sign in to comment.