remove github stuf

This commit is contained in:
Morrígan 2025-02-16 16:35:39 +01:00
parent 8341310684
commit 7f7367a34d
No known key found for this signature in database
GPG key ID: E15A4E1F85721D46
11 changed files with 61 additions and 80 deletions

View file

@ -1,14 +0,0 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "monthly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "monthly"

View file

@ -35,19 +35,19 @@ button {
/* styles for the index page */
.search-container {
.search_container {
display: flex;
flex-direction: column;
flex-direction: row;
gap: 5rem;
justify-content: center;
align-items: center;
}
.search-container svg {
.search_container svg {
color: var(--logo-color);
}
.search-container div {
.search_container div {
display: flex;
}
@ -102,10 +102,10 @@ button {
}
.search_bar button img {
position:absolute;
left:50%;
top:50%;
transform:translate(-50%, -50%);
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
.search_bar button:active {
@ -336,7 +336,7 @@ footer div {
.results_aggregated {
display: flex;
flex-direction: column;
justify-content: space-between;
justify-content: space-between;
margin: 2rem 0;
content-visibility: auto;
}
@ -593,7 +593,7 @@ footer div {
font-size: 2.5rem;
}
.settings > h1 {
.settings>h1 {
margin-bottom: 4rem;
margin-left: 2rem;
}
@ -603,7 +603,7 @@ footer div {
margin: 0.3rem 0 1rem;
}
.settings > hr {
.settings>hr {
margin-left: 2rem;
}
@ -796,15 +796,15 @@ footer div {
transition: .2s;
}
input:checked + .slider {
input:checked+.slider {
background-color: var(--color-three);
}
input:focus + .slider {
input:focus+.slider {
box-shadow: 0 0 1px var(--color-three);
}
input:checked + .slider::before {
input:checked+.slider::before {
transform: translateX(2.6rem);
}
@ -817,7 +817,7 @@ input:checked + .slider::before {
border-radius: 50%;
}
@media screen and (width <= 1136px) {
@media screen and (width <=1136px) {
.hero-text-container {
width: unset;
}
@ -827,7 +827,7 @@ input:checked + .slider::before {
}
}
@media screen and (width <= 706px) {
@media screen and (width <=706px) {
.about-container article .logo-container svg {
width: clamp(200px, 290px, 815px);
}
@ -851,7 +851,7 @@ input:checked + .slider::before {
.features {
grid-template-columns: 1fr;
}
.feature-list {
padding: 35px 0;
}
@ -859,4 +859,4 @@ input:checked + .slider::before {
.feature-card {
border-radius: 0;
}
}
}

View file

@ -7,7 +7,7 @@ use serde::Deserialize;
pub struct SearchParams {
/// It stores the search parameter option `q` (or query in simple words)
/// of the search url.
pub q: Option<String>,
pub query: Option<String>,
/// It stores the search parameter `page` (or pageno in simple words)
/// of the search url.
pub page: Option<u32>,

View file

@ -147,9 +147,7 @@ pub async fn aggregate(
};
}
let mut results: Vec<SearchResult> =
result_map.iter().map(|(_, value)| value.clone()).collect();
let results: Vec<SearchResult> = result_map.iter().map(|(_, value)| value.clone()).collect();
results.sort_by(|a, b| a.description.len().cmp(&b.description.len()));
Ok(SearchResults::new(results, &engine_errors_info))
}

View file

@ -35,13 +35,14 @@ pub async fn search(
) -> Result<HttpResponse, Box<dyn std::error::Error>> {
let params = web::Query::<SearchParams>::from_query(req.query_string())?;
if params.q.as_ref().is_some_and(|q| q.trim().is_empty()) || params.q.is_none() {
if params.query.as_ref().is_some_and(|q| q.trim().is_empty()) || params.query.is_none() {
log::info!("wha!");
return Ok(HttpResponse::TemporaryRedirect()
.insert_header(("location", "/"))
.finish());
}
let query = params.q.as_ref().unwrap().trim();
let query = params.query.as_ref().unwrap().trim();
let cookie = req.cookie("appCookie");

View file

@ -1,6 +1,6 @@
//! A module that handles `bar` partial for the `search_bar` partial and the home/index/main page in the `crabbysearch` frontend.
use maud::{html, Markup, PreEscaped};
use maud::{html, Markup};
/// A functions that handles the html code for the bar for the `search_bar` partial and the
/// home/index/main page in the search engine frontend.
@ -12,15 +12,40 @@ use maud::{html, Markup, PreEscaped};
/// # Returns
///
/// It returns the compiled html code for the search bar as a result.
pub fn bar(query: &str) -> Markup {
pub fn bar(query: &str, engines: Vec<(&'static str, bool)>) -> Markup {
html!(
.search_container {
(PreEscaped("<div class=\"search_bar\">"))
form action="/search" method="get" {
input type="search" name="query" value=(query) placeholder="Type to search";
input type="hidden" name="page" value="0";
button type="submit" {
img src="./images/magnifying_glass.svg" alt="Info icon for error box";
div class="search_bar" {
input type="search" name="query" value=(query) placeholder="Type to search";
input type="hidden" name="page" value="1";
button type="submit" {
img src="./images/magnifying_glass.svg" alt="Info icon for error box";
}
}
div class="search_bar" {
.engine_selection {
@for (name, selected) in engines{
@if selected {
.toggle_btn{
span {(name)}
label class="switch"{
input type="checkbox" class="engine" checked;
span class="slider round"{}
}
}
}
@else {
.toggle_btn {
(name)
label class="switch"{
input type="checkbox" class="engine";
span class="slider round"{}
}
}
}
}
}
}
}
}

View file

@ -1,7 +1,6 @@
//! A module that handles the header for all the pages in the `crabbysearch` frontend.
use crate::templates::partials::navbar::navbar;
use maud::{html, Markup, PreEscaped, DOCTYPE};
use maud::{html, Markup, DOCTYPE};
/// A function that handles the html code for the header for all the pages in the search engine frontend.
///
@ -26,10 +25,8 @@ pub fn header() -> Markup {
link href=("static/themes/simple.css") rel="stylesheet" type="text/css";
}
(PreEscaped("<body onload=\"getClientSettings()\">"))
header{
h1{a href="/"{"crabbysearch"}}
(navbar())
}
)
}

View file

@ -3,4 +3,3 @@
pub mod bar;
pub mod footer;
pub mod header;
pub mod navbar;

View file

@ -1,19 +0,0 @@
//! A module that handles `navbar` partial for the header partial in the `crabbysearch` frontend.
use maud::{html, Markup};
/// A functions that handles the html code for the header partial.
///
/// # Returns
///
/// It returns the compiled html code for the navbar as a result.
pub fn navbar() -> Markup {
html!(
nav{
ul{
li{a href="about"{"about"}}
li{a href="settings"{"settings"}}
}
}
)
}

View file

@ -1,6 +1,6 @@
//! A module that handles the view for the index/home/main page in the `crabbysearch` frontend.
use maud::{html, Markup, PreEscaped};
use maud::{html, Markup};
use crate::templates::partials::{bar::bar, footer::footer, header::header};
@ -15,13 +15,7 @@ use crate::templates::partials::{bar::bar, footer::footer, header::header};
///
/// It returns the compiled html markup code as a result.
pub fn index() -> Markup {
html!(
(header())
main class="search-container"{
(bar(&String::default()))
(PreEscaped("</div>"))
}
script src="static/index.js"{}
(footer())
)
html!((header())(bar(&String::default(), vec![("bing", true)]))(
footer()
))
}

View file

@ -23,7 +23,7 @@ pub fn search(query: &str, search_results: &SearchResults) -> Markup {
html!(
(header())
main class="results"{
(bar(query))
(bar(query, vec![("Bing", true)]))
.results_aggregated{
@if !search_results.results.is_empty() {
@for result in search_results.results.iter(){