Skip to content

Commit

Permalink
Merge pull request #255 from mobusoperandi/work
Browse files Browse the repository at this point in the history
refactor: rm some field prefixes
  • Loading branch information
mightyiam authored Jun 1, 2024
2 parents 7a5eed2 + 33a07a2 commit 6991175
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions builder/src/components/page_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,21 +51,21 @@ impl From<String> for PageDescription {

#[derive(Debug, Clone)]
pub(crate) struct PageBase {
index_path: RelativePathBuf,
current_path: RelativePathBuf,
zulip_logo_path: RelativePathBuf,
inverticat_path: RelativePathBuf,
twitter_logo_path: RelativePathBuf,
index: RelativePathBuf,
current: RelativePathBuf,
zulip_logo: RelativePathBuf,
inverticat: RelativePathBuf,
twitter_logo: RelativePathBuf,
}

impl PageBase {
pub(crate) fn new(expected_files: &mut ExpectedFiles, current_path: RelativePathBuf) -> Self {
Self {
index_path: expected_files.insert_("/index.html"),
current_path,
zulip_logo_path: expected_files.insert_("/zulip_logo.svg"),
inverticat_path: expected_files.insert_("/inverticat.svg"),
twitter_logo_path: expected_files.insert_("/twitter_logo.svg"),
index: expected_files.insert_("/index.html"),
current: current_path,
zulip_logo: expected_files.insert_("/zulip_logo.svg"),
inverticat: expected_files.insert_("/inverticat.svg"),
twitter_logo: expected_files.insert_("/twitter_logo.svg"),
}
}

Expand Down Expand Up @@ -155,13 +155,13 @@ impl Render for Page {
div class=(header_classes) {
div class=(classes!("flex", "flex-col", "gap-x-2", "whitespace-nowrap"))
{
@if self.base.index_path == self.base.current_path {
@if self.base.index == self.base.current {
p
class=(brand_classes)
{ (NAME) }
} @else {
a
href=(self.base.index_path)
href=(self.base.index)
class=(brand_classes)
{ (NAME) }
}
Expand All @@ -173,21 +173,21 @@ impl Render for Page {
img
width=(NAV_ICON_SIZE)
alt="Zulip"
src=(self.base.zulip_logo_path);
src=(self.base.zulip_logo);
}

a class=(classes!("invert")) href=(*GITHUB_ORGANIZATION_URL) {
img
width=(NAV_ICON_SIZE)
alt="GitHub"
src=(self.base.inverticat_path);
src=(self.base.inverticat);
}

a href="https://twitter.com/mobusoperandi" {
img
width=(NAV_ICON_SIZE)
alt="Twitter"
src=(self.base.twitter_logo_path);
src=(self.base.twitter_logo);
}
}
}
Expand Down

0 comments on commit 6991175

Please sign in to comment.