Skip to content

Commit

Permalink
fix: tag rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
linsyking committed Aug 12, 2024
1 parent bbb63fe commit 015952a
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 12 deletions.
4 changes: 2 additions & 2 deletions scripts/md.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { md } from "./md-it.mjs";
import { readFileSync } from "fs";
import { readFileSync, writeFileSync } from "fs";
import { execSync } from "child_process";
import { argv } from "process";
import jyml from "js-yaml";
Expand Down Expand Up @@ -91,7 +91,7 @@ tags:
-
---\n\n`;
new_content += input;
fs.writeFileSync(fpath, new_content);
writeFileSync(fpath, new_content);
} else {
var res = md.render(new_s);
console.log(res);
Expand Down
11 changes: 11 additions & 0 deletions site/blog/testsecret.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: Testing secret post
date: 2024-08-11 23:14:08
secret: true
tags:
- test
---

## Test secret content

Hello
4 changes: 4 additions & 0 deletions site/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# Changelog

## 2024-08-11

- Use `block` to render tags

## 2024-08-09

- Add better dark mode support
8 changes: 1 addition & 7 deletions site/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -499,12 +499,6 @@ blockquote {
background-color: var(--Pre-bg);
}

.post-tags {
align-items: center;
justify-content: flex-start;
display: flex;
}

.tag-container {
width: fit-content;
height: 25px;
Expand All @@ -513,7 +507,7 @@ blockquote {
padding-inline: 5px;
align-items: center;
justify-content: center;
display: flex;
display: inline-flex;
margin-inline: 5px;
cursor: pointer;
}
6 changes: 3 additions & 3 deletions soupault.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@

[preprocessors]
# Automatically call pandoc on every *.md page to convert it to HTML
md = 'node scripts/md.js'
md = 'node scripts/md.mjs'

## Autogenerated section index settings
[index]
Expand Down Expand Up @@ -122,7 +122,7 @@
<div class="post-tags">
<strong>Tags: </strong>
{%- for t in e.tags -%}
<a href="/blog/tag/{{t}}">
<a href="/blog/tag/{{t}}" style="text-decoration: none;">
<div class="tag-container">
<svg t="1721493582945" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1460" width="20" height="20"><path d="M323.008 786.752c-52.928 0-96-43.072-96-96s43.072-96 96-96 96 43.072 96 96S375.936 786.752 323.008 786.752zM323.008 658.752c-17.632 0-32 14.336-32 32s14.368 32 32 32 32-14.336 32-32S340.64 658.752 323.008 658.752z" fill="#1296db" p-id="1461"></path><path d="M416.096 927.072 284.224 927.072c-159.936 0-186.912-59.232-186.912-192l0-140.8c0-74.272 14.304-96.256 70.72-150.976l327.04-319.904c36.576-35.488 105.888-35.392 142.304-0.096l263.072 256.032c18.336 17.792 28.864 43.552 28.864 70.656 0 27.296-10.656 53.28-29.248 71.264l-290.016 294.592C544.544 880.416 497.216 927.072 416.096 927.072zM566.24 159.488c-10.496 0-20.16 3.52-26.528 9.696l-327.04 319.936c-49.952 48.48-51.36 54.528-51.36 105.152l0 140.8c0 110.272 8.352 128 122.912 128l131.872 0c52.672 0 83.744-28.48 148.992-92.8l26.656-26.144 263.232-268.256c6.784-6.592 10.336-15.808 10.336-25.888 0-9.888-3.424-18.88-9.472-24.736l-263.072-256.032C586.432 163.04 576.736 159.488 566.24 159.488z" fill="#1296db" p-id="1462"></path></svg>
<p style="margin-left:3px;font-size: 14px; color: #822082" class="post-tag">{{t}}</p>
Expand Down Expand Up @@ -225,7 +225,7 @@
<div class="post-tags">
<span><strong>Tags:</strong> </span>
{%- for t in tags -%}
<a href="/blog/tag/{{t}}">
<a href="/blog/tag/{{t}}" style="text-decoration: none;">
<div class="tag-container">
<svg t="1721493582945" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1460" width="20" height="20"><path d="M323.008 786.752c-52.928 0-96-43.072-96-96s43.072-96 96-96 96 43.072 96 96S375.936 786.752 323.008 786.752zM323.008 658.752c-17.632 0-32 14.336-32 32s14.368 32 32 32 32-14.336 32-32S340.64 658.752 323.008 658.752z" fill="#1296db" p-id="1461"></path><path d="M416.096 927.072 284.224 927.072c-159.936 0-186.912-59.232-186.912-192l0-140.8c0-74.272 14.304-96.256 70.72-150.976l327.04-319.904c36.576-35.488 105.888-35.392 142.304-0.096l263.072 256.032c18.336 17.792 28.864 43.552 28.864 70.656 0 27.296-10.656 53.28-29.248 71.264l-290.016 294.592C544.544 880.416 497.216 927.072 416.096 927.072zM566.24 159.488c-10.496 0-20.16 3.52-26.528 9.696l-327.04 319.936c-49.952 48.48-51.36 54.528-51.36 105.152l0 140.8c0 110.272 8.352 128 122.912 128l131.872 0c52.672 0 83.744-28.48 148.992-92.8l26.656-26.144 263.232-268.256c6.784-6.592 10.336-15.808 10.336-25.888 0-9.888-3.424-18.88-9.472-24.736l-263.072-256.032C586.432 163.04 576.736 159.488 566.24 159.488z" fill="#1296db" p-id="1462"></path></svg>
<p style="margin-left:3px;font-size: 14px; color: #822082" class="post-tag">{{t}}</p>
Expand Down

0 comments on commit 015952a

Please sign in to comment.