Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update header implementation for upcoming Discourse changes #120

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 2 additions & 6 deletions common/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ p.footer-donation {
padding: 5px 10px;
}

@include at-least(screen-sm-min){
@include at-least(screen-sm-min) {
.trending-guides-row {
display: flex;
flex-direction: row;
Expand Down Expand Up @@ -443,12 +443,8 @@ body.no-ember {
}

a.curriculum-nav {
z-index: 1000;
color: white;
position: fixed;
padding: 0 10px;
left: 15px;
margin-top: -19px;
height: $--global-nav-height;
display: flex;
align-items: center;
Expand Down Expand Up @@ -827,7 +823,7 @@ div.select-kit-header {
margin-top: calc(-1rem - #{$--global-nav-height} * 2);
}

@include at-least(screen-md-min) {
@include at-least(screen-md-min) {
.anchor {
padding-top: calc(#{$--global-nav-height} + 1rem);
margin-top: calc(-1rem - #{$--global-nav-height});
Expand Down
54 changes: 0 additions & 54 deletions common/header.html

This file was deleted.

27 changes: 27 additions & 0 deletions javascripts/discourse/api-initializers/freecodecamp.gjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { apiInitializer } from "discourse/lib/api";

export default apiInitializer("0.8", (api) => {
const siteSettings = api.container.lookup("service:site-settings");
const rawLabel = api.container.lookup("service:site").mobileView
? settings.curriculum_title_short
: settings.curriculum_title;

api.renderInOutlet("before-header-panel", <template>
<a class="curriculum-nav" href={{settings.curriculum_src}}>{{rawLabel}}</a>
</template>);

api.renderInOutlet("above-site-header", <template>
<nav class="site-nav nav-padding">
<div class="site-nav-logo">
<a href="/">
<img
id="site-logo"
class="logo-big"
src={{siteSettings.site_logo_url}}
alt={{settings.title}}
/>
</a>
</div>
</nav>
</template>);
});
Loading