Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Made search collection name use the cms hash#1333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
SilasMarvin merged 2 commits intomasterfromsilas-cms-hash-collection-name
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletionspgml-dashboard/Cargo.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -52,3 +52,6 @@ yaml-rust = "0.4"
zoomies = { git="https://github.com/HyperparamAI/zoomies.git", branch="master" }
ws = { package = "rocket_ws", git = "https://github.com/SergioBenitez/Rocket" }
futures = "0.3.29"

[build-dependencies]
glob = "*"
19 changes: 17 additions & 2 deletionspgml-dashboard/build.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
use glob::glob;
use std::collections::BTreeSet;
use std::fs::read_to_string;
use std::hash::Hasher;
use std::path::PathBuf;
use std::process::Command;

fn main() {
Expand DownExpand Up@@ -27,9 +31,11 @@ fn main() {

let css_version = read_to_string("static/css/.pgml-bundle").expect("failed to read .pgml-bundle");
let css_version = css_version.trim();
println!("cargo:rustc-env=CSS_VERSION={css_version}");

let js_version = read_to_string("static/js/.pgml-bundle").expect("failed to read .pgml-bundle");
let js_version = js_version.trim();
println!("cargo:rustc-env=JS_VERSION={js_version}");

let status = Command::new("cp")
.arg("static/js/main.js")
Expand All@@ -41,6 +47,15 @@ fn main() {
panic!("failed to bundle main.js");
}

println!("cargo:rustc-env=CSS_VERSION={css_version}");
println!("cargo:rustc-env=JS_VERSION={js_version}");
let files_paths = glob("./../pgml-cms/**/*.md")
.expect("Failed to read pgml-cms directory")
.map(|p| p.unwrap())
.collect::<BTreeSet<PathBuf>>();
let mut hasher = std::hash::DefaultHasher::new();
for path in files_paths {
let contents = read_to_string(path.clone()).expect("Error reading file");
hasher.write(&contents.into_bytes());
}
let cms_hash = hasher.finish();
println!("cargo:rustc-env=CMS_HASH={cms_hash}");
}
2 changes: 1 addition & 1 deletionpgml-dashboard/src/utils/markdown.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1239,7 +1239,7 @@ pub struct SiteSearch {
impl SiteSearch {
pub async fn new() -> anyhow::Result<Self> {
let collection = pgml::Collection::new(
"hypercloud-site-search-c-2",
env!("CMS_HASH"),
Some(
std::env::var("SITE_SEARCH_DATABASE_URL")
.context("Please set the `SITE_SEARCH_DATABASE_URL` environment variable")?,
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp