Skip to content

Commit

Permalink
configured prettier and github actions (#19)
Browse files Browse the repository at this point in the history
* prettier setup

* formatted by prettier

* github actions test

* github actions fix

* fix
  • Loading branch information
MathyouMB authored May 16, 2021
1 parent ba5a267 commit 6cad47d
Show file tree
Hide file tree
Showing 23 changed files with 244 additions and 149 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: CI
'on':
- push
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install modules
run: |
npm install
- name: Run Prettier
run: |
npm run check
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/public
_gen
_gen
node_modules
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"overrides": [
{
"files": ["*.html"],
"options": {
"parser": "go-template"
}
}
]
}
6 changes: 3 additions & 3 deletions assets/js/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function fileClosure(){
console.log("Hello World")
function fileClosure() {
console.log("Hello World");
}

window.addEventListener('load', fileClosure());
window.addEventListener("load", fileClosure());
6 changes: 3 additions & 3 deletions assets/js/navbar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function loadNavbar(){
console.log("Loaded Navbar")
function loadNavbar() {
console.log("Loaded Navbar");
}

window.addEventListener('load', loadNavbar());
window.addEventListener("load", loadNavbar());
6 changes: 3 additions & 3 deletions assets/scss/_global.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
body {
margin: 0;
padding: 0;
background-color: var(--bg);
margin: 0;
padding: 0;
background-color: var(--bg);
}
9 changes: 4 additions & 5 deletions assets/scss/components/_navbar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ li {
height: 195px;
}

.actual_content{
.actual_content {
color: black;
position: fixed;
-webkit-transition: all 600ms ease-out;
Expand Down Expand Up @@ -133,8 +133,8 @@ li {
z-index: 2;
}

@for $i from 1 through $navItemsLength{
#item#{$i}:hover ~ {
@for $i from 1 through $navItemsLength {
#item#{$i}:hover ~ {
#actual_content#{$i} {
z-index: 3 !important;
-webkit-transition: all 400ms ease-in;
Expand All @@ -148,7 +148,6 @@ li {
}
}


.item_block {
-webkit-transition: all 500ms ease-out;
-moz-transition: all 500ms ease-out;
Expand Down Expand Up @@ -176,7 +175,7 @@ li {
border-right: 2px solid black;
}

.right_image{
.right_image {
background-repeat: no-repeat;
background-position: 50%;
background-size: cover;
Expand Down
59 changes: 29 additions & 30 deletions assets/scss/components/_overlaypost.scss
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@

.overlaypost_header {
background-size: cover;
background-repeat: no-repeat;
background-position: center;
position: absolute;
width: 100%;
height: 75vh;
background-color:black;
margin-top: -10rem;
z-index: -1;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
position: absolute;
width: 100%;
height: 75vh;
background-color: black;
margin-top: -10rem;
z-index: -1;
}

.overlaypost_blur {
filter: blur(0.2rem);
-webkit-filter: blur(0.2rem);
filter: blur(0.2rem);
-webkit-filter: blur(0.2rem);
}

.overlaypost_header::after {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
background: rgba(10,15,30,0.72);
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
background: rgba(10, 15, 30, 0.72);
}

.overlaypost {
padding: 1rem 3.5rem;
max-width: 45rem;
margin: 0 auto;
margin-top: 10rem;
background-color: var(--bg);
box-shadow: 0px 0.5rem 1rem -0.5rem rgba(19, 17, 16, 0.384);
border-radius: 0.25rem;
padding: 1rem 3.5rem;
max-width: 45rem;
margin: 0 auto;
margin-top: 10rem;
background-color: var(--bg);
box-shadow: 0px 0.5rem 1rem -0.5rem rgba(19, 17, 16, 0.384);
border-radius: 0.25rem;

h2 {
margin-top: 2rem;
}
h2 {
margin-top: 2rem;
}
}
44 changes: 22 additions & 22 deletions assets/scss/components/_posts.scss
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
.post_header {
background-size: cover;
background-repeat: no-repeat;
background-position: center;
position: relative;
height: 40vh;
background-color: var(--bg);
margin-top: 3rem;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
position: relative;
height: 40vh;
background-color: var(--bg);
margin-top: 3rem;
}

.post_header::after {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
background: rgba(10,15,30,0.72);
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 1;
background: rgba(10, 15, 30, 0.72);
}

.post {
padding: 1rem 1.5rem;
margin-top: 1.5rem;
max-width: 45rem;
margin: 0 auto;
padding: 1rem 1.5rem;
margin-top: 1.5rem;
max-width: 45rem;
margin: 0 auto;

h2 {
margin-top: 2rem;
}
h2 {
margin-top: 2rem;
}
}
6 changes: 3 additions & 3 deletions assets/scss/main.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@import 'variables';
@import 'components';
@import 'global';
@import "variables";
@import "components";
@import "global";
1 change: 0 additions & 1 deletion layouts/404.html
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

25 changes: 14 additions & 11 deletions layouts/_default/announcement.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
{{ define "main" }}
{{- partial "navbar.html" . -}}
{{- partial "navbar.html" . -}}

<!--Header-->
{{- if ne .Params.hideBanner true }}
<section class = 'post_header' style = 'background-image:url({{ absURL .Params.background }});'></section>
{{- end }}
<!--Header-->
{{- if ne .Params.hideBanner true }}
<section
class="post_header"
style="background-image:url({{ absURL .Params.background }});"
></section>
{{- end }}

<!--Content-->
<div class = '{{ if .Params.full }}wrap post{{ else }}post{{ end }}'>
<article class='post_content'>
{{- .Content }}
</article>
</div>
<!--Content-->
<div class="{{ if .Params.full }}wrap post{{ else }}post{{ end }}">
<article class="post_content">
{{- .Content }}
</article>
</div>
{{ end }}
10 changes: 5 additions & 5 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!DOCTYPE html>
<html>
{{- partial "head.html" . -}}
<body>
{{- block "main" . }}{{- end }}
</body>
{{- partial "footer.html" . -}}
{{- partial "head.html" . -}}
<body>
{{- block "main" . }}{{- end }}
</body>
{{- partial "footer.html" . -}}
</html>
6 changes: 3 additions & 3 deletions layouts/_default/list.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "main" }}
<h1>List</h1>
<h1>{{ .Title }}</h1>
{{ .Content }}
<h1>List</h1>
<h1>{{ .Title }}</h1>
{{ .Content }}
{{ end }}
34 changes: 20 additions & 14 deletions layouts/_default/overlaypost.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
{{ define "main" }}
{{- partial "navbar.html" . -}}
{{- partial "navbar.html" . -}}

<!--Header-->
{{- if ne .Params.hideBanner true }}
<section class = 'overlaypost_header' style = 'background-image:url({{ absURL .Params.background }});'></section>
<section class = 'overlaypost_header overlaypost_blur' style = 'background-image:url({{ absURL .Params.background }});'></section>
{{- end }}
<!--Header-->
{{- if ne .Params.hideBanner true }}
<section
class="overlaypost_header"
style="background-image:url({{ absURL .Params.background }});"
></section>
<section
class="overlaypost_header overlaypost_blur"
style="background-image:url({{ absURL .Params.background }});"
></section>
{{- end }}

<!--Content-->
<div class = '{{ if .Params.full }}wrap post{{ else }}overlaypost{{ end }}'>
<article class='overlaypost_content'>
<!--Temp-->
<h1 style="font-size: 3rem">{{- .Params.title }}</h1>
{{- .Content }}
</article>
</div>
<!--Content-->
<div class="{{ if .Params.full }}wrap post{{ else }}overlaypost{{ end }}">
<article class="overlaypost_content">
<!--Temp-->
<h1 style="font-size: 3rem">{{- .Params.title }}</h1>
{{- .Content }}
</article>
</div>
{{ end }}
6 changes: 3 additions & 3 deletions layouts/_default/single.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "main" }}
<h1>Single</h1>
<h1>{{ .Title }}</h1>
{{ .Content }}
<h1>Single</h1>
<h1>{{ .Title }}</h1>
{{ .Content }}
{{ end }}
6 changes: 3 additions & 3 deletions layouts/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{ define "main" }}
{{- partial "navbar.html" . -}}
<h1>Site</h1>
{{ .Content }}
{{- partial "navbar.html" . -}}
<h1>Site</h1>
{{ .Content }}
{{ end }}
5 changes: 2 additions & 3 deletions layouts/partials/footer.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<div class="footer">Footer</div>


<!--JS Bundle-->

{{- $mainScriptPath := "js/index.js" }}
Expand All @@ -9,9 +8,9 @@
{{- $navbarScriptPath := "js/navbar.js" }}
{{- $navbar := resources.Get $navbarScriptPath | resources.ExecuteAsTemplate $navbarScriptPath . }}

{{- $bundle := slice $main $navbar}}
{{- $bundle := slice $main $navbar }}
{{- if site.Params.Staticman }}
{{- $bundle = slice $main $navbar}}
{{- $bundle = slice $main $navbar }}
{{- end }}
{{- $bundle = $bundle | resources.Concat "js/bundle.js" | resources.Fingerprint "sha512" -}}

Expand Down
23 changes: 14 additions & 9 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
{{- $options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") -}}
{{- $styles := resources.Get "scss/main.scss" | resources.ExecuteAsTemplate "main.scss" . | resources.ToCSS $options | resources.Fingerprint "sha512" }}
<link rel = 'stylesheet' href = '{{ $styles.Permalink }}' crossorigin="anonymous" integrity = '{{ $styles.Data.Integrity }}'>
<!--<link rel="stylesheet" type="text/css" href="/css/style.css">-->
{{ $title := print .Site.Title " | " .Title }}
{{ if .IsHome }}{{ $title = .Site.Title }}{{ end }}
<title>{{ $title }}</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
{{- $options := (dict "targetPath" "css/styles.css" "outputStyle" "compressed" "enableSourceMap" "true") -}}
{{- $styles := resources.Get "scss/main.scss" | resources.ExecuteAsTemplate "main.scss" . | resources.ToCSS $options | resources.Fingerprint "sha512" }}
<link
rel="stylesheet"
href="{{ $styles.Permalink }}"
crossorigin="anonymous"
integrity="{{ $styles.Data.Integrity }}"
/>
<!--<link rel="stylesheet" type="text/css" href="/css/style.css">-->
{{ $title := print .Site.Title " | " .Title }}
{{ if .IsHome }}{{ $title = .Site.Title }}{{ end }}
<title>{{ $title }}</title>
</head>
Loading

0 comments on commit 6cad47d

Please sign in to comment.