Skip to content

Commit

Permalink
#17 - Minifying css, converting custom.css to scss, setting up grunt …
Browse files Browse the repository at this point in the history
…pipeline for scss conversion and css minification, adding option for release vs debug mode build with configuring to use the proper variant, remove unused bulma scss files from the repo
  • Loading branch information
Jooseppi12 committed Jan 22, 2021
1 parent 6d98453 commit fb46472
Show file tree
Hide file tree
Showing 14 changed files with 537 additions and 487 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@
/.ionide
*.bak*
*.done
*.min.css
*.map
src/Hosted/assets/custom.css
*.ionide*
14 changes: 11 additions & 3 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
echo "Copy legal files"

xcopy .\legal\site-docs\intellifactory.com\* .\src\Hosted\legal\ /s /e
xcopy .\legal\site-docs\intellifactory.com\* .\src\Hosted\legal\ /s /e /y

echo "Copy blog posts files"

xcopy .\blogs\user\* .\src\Hosted\posts\ /s /e
xcopy .\blogs\user\* .\src\Hosted\posts\ /s /e /y

echo "Running npm install"

Expand All @@ -14,4 +14,12 @@ popd

echo "Running dotnet build"

dotnet build SiteFi.sln
$mode=$args[0]
echo "Param $mode"
if ($mode -ieq "debug") {
echo "Running build in Debug mode..."
dotnet build SiteFi.sln -c Debug
} else {
echo "Running build in Release mode..."
dotnet build SiteFi.sln
}
7 changes: 6 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,10 @@ popd

echo "Running dotnet build"

dotnet build SiteFi.sln
if ["{$1^^}" -eq "DEBUG"]
then
dotnet build SiteFi.sln -c Debug
else
dotnet build SiteFi.sln
fi

28 changes: 25 additions & 3 deletions src/Hosted/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,30 @@ module.exports = function(grunt) {
grunt.initConfig({
cssmin: {
build: {
src: 'css/all.css',
dest: 'css/all.min.css'
files: [{
expand: true,
cwd: 'assets',
src: ['*.css', '!*.min.css'],
dest: 'assets',
ext: '.min.css'
}, {
expand: true,
cwd: 'themekit/css',
src: ['*.css', '!*.min.css'],
dest: 'themekit/css',
ext: '.min.css'
}]
}
},
sass: {
options: {
implementation: sass,
sourceMap: true
},
dist: {
files: {
'assets/custom.css': 'assets/custom.scss'
}
}
}
});
Expand All @@ -14,5 +36,5 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-cssmin');

grunt.registerTask('default', ['cssmin']);
grunt.registerTask('default', ['sass','cssmin']);
};
1 change: 0 additions & 1 deletion src/Hosted/Hosted.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

<ItemGroup>
<Content Include="posts/**/*.*" />
<Content Include="scss/**/*.*" />
<Compile Include="Main.fs" />
<Compile Include="Startup.fs" />
<Content Include="404.html" />
Expand Down
24 changes: 24 additions & 0 deletions src/Hosted/Main.fs
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,9 @@ module Site =
.Map(client <@ ClientSideCode.TalksAndPresentations.GMap(mapStyles) @>)
.Doc()
TrainingsTemplate()
#if !DEBUG
.ReleaseMin(".min")
#endif
.MenuBar(menubar config.Value)
.HeaderContent(header)
.Footer(MainTemplate.Footer().Doc())
Expand All @@ -919,6 +922,9 @@ module Site =
|> Content.Page
let TERMSOFUSE (ctx: Context<_>) =
LegalTemplate()
#if !DEBUG
.ReleaseMin(".min")
#endif
.MenuBar(menubar config.Value)
.HeaderContent(Doc.Empty)
.Content(Doc.Verbatim <| Markdown.Convert (getContent ctx "TermsOfUse.md"))
Expand Down Expand Up @@ -950,6 +956,9 @@ module Site =
let CONTACT () =
let mapContactStyles = mapContactStyles()
ContactTemplate()
#if !DEBUG
.ReleaseMin(".min")
#endif
.MenuBar(menubar config.Value)
.Map(client <@ ClientSideCode.TalksAndPresentations.GMapOffice(mapContactStyles) @>)
.Footer(MainTemplate.Footer().Doc())
Expand All @@ -958,27 +967,39 @@ module Site =
|> Content.Page
let RESEARCH () =
ResearchTemplate()
#if !DEBUG
.ReleaseMin(".min")
#endif
.MenuBar(menubar config.Value)
.Footer(MainTemplate.Footer().Doc())
.Cookie(Cookies.Banner false)
.Doc()
|>Content.Page
let CONSULTING () =
ConsultingTemplate()
#if !DEBUG
.ReleaseMin(".min")
#endif
.MenuBar(menubar config.Value)
.Footer(MainTemplate.Footer().Doc())
.Cookie(Cookies.Banner false)
.Doc()
|>Content.Page
let CAREERS () =
CareersTemplate()
#if !DEBUG
.ReleaseMin(".min")
#endif
.MenuBar(menubar config.Value)
.Footer(MainTemplate.Footer().Doc())
.Cookie(Cookies.Banner false)
.Doc()
|>Content.Page
let OPENPOSITION () =
OpenPositionTemplate()
#if !DEBUG
.ReleaseMin(".min")
#endif
.MenuBar(menubar config.Value)
.Footer(MainTemplate.Footer().Doc())
.Cookie(Cookies.Banner false)
Expand All @@ -1004,6 +1025,9 @@ module Site =
let isFirst = pageNo = 1
let isLast = List.length as1 - pageNo < 1
BlogListTemplate()
#if !DEBUG
.ReleaseMin(".min")
#endif
.Menubar(menubar config.Value)
.Banner(banner)
.ArticleList(ARTICLES articles)
Expand Down
Loading

0 comments on commit fb46472

Please sign in to comment.