Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5bb69bac34 | |||
| a8e009b957 | |||
| 348dc8819d |
14
CHANGELOG.md
14
CHANGELOG.md
@ -6,6 +6,20 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
|
|||||||
[Semantic Versioning](https://semver.org/lang/en/).
|
[Semantic Versioning](https://semver.org/lang/en/).
|
||||||
|
|
||||||
|
|
||||||
|
## `v0.6.3` - 20.07.2026
|
||||||
|
### Fixed
|
||||||
|
- Fixed minify script and templates.
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## `v0.6.2` - 20.07.2026
|
||||||
|
### Changed
|
||||||
|
- Links are now opens in new tab.
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## `v0.6.1` - 17.07.2026
|
## `v0.6.1` - 17.07.2026
|
||||||
### Added
|
### Added
|
||||||
- Add compile-time templates minificattion.
|
- Add compile-time templates minificattion.
|
||||||
|
|||||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1567,7 +1567,7 @@ checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mdpreview"
|
name = "mdpreview"
|
||||||
version = "0.6.1"
|
version = "0.6.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"askama",
|
"askama",
|
||||||
"askama_axum",
|
"askama_axum",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "mdpreview"
|
name = "mdpreview"
|
||||||
version = "0.6.1"
|
version = "0.6.3"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
authors = ["Vladislav Kan <thek4n@yandex.ru>"]
|
authors = ["Vladislav Kan <thek4n@yandex.ru>"]
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
|||||||
8
build.rs
8
build.rs
@ -14,12 +14,12 @@ const MERMAID_SCRIPT_URL_TEMPLATE: &str =
|
|||||||
fn main() {
|
fn main() {
|
||||||
println!("cargo:rerun-if-changed=build.rs");
|
println!("cargo:rerun-if-changed=build.rs");
|
||||||
println!("cargo:rerun-if-changed=assets/");
|
println!("cargo:rerun-if-changed=assets/");
|
||||||
println!("cargo:rerun-if-env-changed=RANDOM");
|
println!("cargo:rerun-if-env-changed=FORCE_DEPS_DOWNLOAD");
|
||||||
|
|
||||||
println!("cargo:rerun-if-changed=templates/");
|
println!("cargo:rerun-if-changed=templates/");
|
||||||
minify_template_file("templates/base.html", "templates/base.min.html").unwrap();
|
minify_template_file("templates/base.html", "templates/.base.min.html").unwrap();
|
||||||
minify_template_file("templates/dir.html", "templates/dir.min.html").unwrap();
|
minify_template_file("templates/dir.html", "templates/.dir.min.html").unwrap();
|
||||||
minify_template_file("templates/file.html", "templates/file.min.html").unwrap();
|
minify_template_file("templates/file.html", "templates/.file.min.html").unwrap();
|
||||||
|
|
||||||
let out_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
let out_dir = env::var("CARGO_MANIFEST_DIR").unwrap();
|
||||||
let assets_path = Path::new(&out_dir).join("assets");
|
let assets_path = Path::new(&out_dir).join("assets");
|
||||||
|
|||||||
@ -52,7 +52,7 @@ pub struct FileEntry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Template)]
|
#[derive(Template)]
|
||||||
#[template(path = "dir.min.html")]
|
#[template(path = ".dir.min.html")]
|
||||||
pub struct DirectoryTemplate {
|
pub struct DirectoryTemplate {
|
||||||
pub title_path: String,
|
pub title_path: String,
|
||||||
pub files: Vec<FileEntry>,
|
pub files: Vec<FileEntry>,
|
||||||
@ -65,7 +65,7 @@ pub struct DirectoryTemplate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Template)]
|
#[derive(Template)]
|
||||||
#[template(path = "file.min.html")]
|
#[template(path = ".file.min.html")]
|
||||||
pub struct NoteTemplate {
|
pub struct NoteTemplate {
|
||||||
pub filename: String,
|
pub filename: String,
|
||||||
pub back_link: String,
|
pub back_link: String,
|
||||||
|
|||||||
@ -435,7 +435,9 @@ fn render_blockquote(quote_kind: Option<BlockQuoteKind>) -> String {
|
|||||||
fn render_link(link_type: LinkType, dest_url: &CowStr<'_>, title: &CowStr<'_>) -> String {
|
fn render_link(link_type: LinkType, dest_url: &CowStr<'_>, title: &CowStr<'_>) -> String {
|
||||||
match link_type {
|
match link_type {
|
||||||
LinkType::Email => format!("<a href=\"mailto:{dest_url}\" title=\"{title}\">"),
|
LinkType::Email => format!("<a href=\"mailto:{dest_url}\" title=\"{title}\">"),
|
||||||
_ => format!("<a href=\"{dest_url}\" title=\"{title}\">"),
|
_ => format!(
|
||||||
|
"<a href=\"{dest_url}\" title=\"{title}\" target=\"_blank\" rel=\"noopener noreferrer\">"
|
||||||
|
),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -236,8 +236,6 @@
|
|||||||
<script src="{{ mermaid_script_url }}"></script>
|
<script src="{{ mermaid_script_url }}"></script>
|
||||||
<script src="{{ highlight_script_url }}"></script>
|
<script src="{{ highlight_script_url }}"></script>
|
||||||
<script>
|
<script>
|
||||||
{% block scripts %}{% endblock %}
|
|
||||||
|
|
||||||
function copyCode(button) {
|
function copyCode(button) {
|
||||||
const wrapper = button.closest('.code-block-wrapper');
|
const wrapper = button.closest('.code-block-wrapper');
|
||||||
if (!wrapper) return;
|
if (!wrapper) return;
|
||||||
@ -276,5 +274,6 @@
|
|||||||
|
|
||||||
hljs.highlightAll();
|
hljs.highlightAll();
|
||||||
</script>
|
</script>
|
||||||
|
<script>{% block scripts %}{% endblock %}</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
{% extends "base.min.html" %}
|
{% extends ".base.min.html" %}
|
||||||
|
|
||||||
{% block title %}Directory: /{{ title_path }}{% endblock %}
|
{% block title %}Directory: /{{ title_path }}{% endblock %}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
{% extends "base.min.html" %}
|
{% extends ".base.min.html" %}
|
||||||
|
|
||||||
{% block title %}{{ filename }}{% endblock %}
|
{% block title %}{{ filename }}{% endblock %}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user