我的 Hugo 页面有以下代码,用于列出使用 Tailwind CSS 格式化的新帖子:
{{ define "main" }}
{{ range .Pages }}
<div class="grid grid-flow-row grid-cols-3">
<div class="flex justify-center">
<div class="bg-white shadow-xl rounded-lg overflow-hidden">
<div class="bg-cover bg-center h-56 p-4" style="background-image: url(https://ui-avatars.com/api/?name=John+Doe&size=512)">
<div class="flex justify-end">
</div>
</div>
<div class="p-4">
<p class="uppercase tracking-wide text-sm font-bold text-gray-700">{{ .Params.Major}}</p>
<p class="text-3xl text-gray-900 font-bold">{{ .Title }}</p>
<p class="text-gray-700">A small description and a bucnch of stuff.</p>
</div>
<div class="flex p-4 border-t border-gray-300 text-gray-700">
<div class="flex-1 inline-flex items-center">
<svg class="h-6 w-6 text-gray-600 fill-current mr-3" viewBox="0 …Run Code Online (Sandbox Code Playgroud) I have the following code for plotting a simple lollipop chart for my data:
p <-
data %>% mutate(Activity_Name = fct_reorder(Activity_Name, count)) %>%
ggplot(aes(x = Activity_Name, y = count)) +
geom_segment(aes(
x = Activity_Name,
xend = Activity_Name,
y = 0,
yend = count
),
color = "skyblue") +
geom_point(color = "#F2F7F2",
size = 5,
alpha = 0.6) +
theme_light() +
scale_y_log10() +
coord_flip()
Run Code Online (Sandbox Code Playgroud)
I would like to order this in descending order of Activity Name's counts. Even though I've …