HiJoe
HiJoe
DDeno
Created by HiJoe on 1/12/2024 in #help
Fresh - Page title to Layout
In "tradional" like tempalting engine it is often called blocks or sections and sometimes slots
10 replies
DDeno
Created by HiJoe on 1/12/2024 in #help
Fresh - Page title to Layout
Hopefully that explains what I'm trying todo
10 replies
DDeno
Created by HiJoe on 1/12/2024 in #help
Fresh - Page title to Layout
I have a section in my layout that depends on per route data. So like a head tag, I have a section within the layout that expects data from the Page (route). This is not a real example but Ill try to illustrate it. Layout
<head>
<title>{from_page: title} - John Doe Company</title>
</head>
<body>
<navbar />
<welcome />
<main>
<sidebar />
<section>
// Page content (<Component />)
</section>
<aside>
<p>Info 1: {from_page: info_a}</p>
</aside>
</main>
</body>
<head>
<title>{from_page: title} - John Doe Company</title>
</head>
<body>
<navbar />
<welcome />
<main>
<sidebar />
<section>
// Page content (<Component />)
</section>
<aside>
<p>Info 1: {from_page: info_a}</p>
</aside>
</main>
</body>
Page:
// title = 'Page'
// info_a = 'Something page related'
export default function Home() {
return (
<>
Page Content
</>
);
}
// title = 'Page'
// info_a = 'Something page related'
export default function Home() {
return (
<>
Page Content
</>
);
}
So title and info_a are defined within the page and should be rendered within the layout
10 replies
DDeno
Created by HiJoe on 1/12/2024 in #help
Fresh - Page title to Layout
This was a example. So it could also be a other part of the layout that expects per route values
10 replies
DDeno
Created by HiJoe on 1/12/2024 in #help
Fresh - Page title to Layout
Right, I gave this as like recognizable example. I should have been more clear but it applies to non-head things
10 replies
DDeno
Created by HiJoe on 1/11/2024 in #help
Using SCSS with Fresh
Yea I created a plugin for the fresh config. Only can't reload on file change
8 replies
DDeno
Created by HiJoe on 1/11/2024 in #help
Using SCSS with Fresh
Thanks I think a found a workaround with the Fresh plugins.
8 replies
DDeno
Created by HiJoe on 1/11/2024 in #help
Using SCSS with Fresh
I did try now this in the fersh.config:
import { defineConfig } from "$fresh/server.ts";
import { sassPlugin } from "npm:esbuild-sass-plugin@2.16.1";

export default defineConfig({
plugins: [sassPlugin()],
});
import { defineConfig } from "$fresh/server.ts";
import { sassPlugin } from "npm:esbuild-sass-plugin@2.16.1";

export default defineConfig({
plugins: [sassPlugin()],
});
Only without success
8 replies