From d67201b260be706f21ceade83e93db15e1f635f8 Mon Sep 17 00:00:00 2001
From: Marc Stammerjohann
Date: Wed, 25 Nov 2020 17:48:40 +0100
Subject: [PATCH 01/19] feat(series): add series page
---
content/series/angular-scully-tailwind.md | 20 ++++++++++
content/series/nestjs-prisma.md | 15 +++++++
scully.notiz.config.ts | 11 ++++++
src/app/app-routing.module.ts | 5 +++
src/app/app.component.html | 7 ++++
src/app/app.module.ts | 4 +-
src/app/components/article/article.module.ts | 2 -
src/app/components/components.module.ts | 3 +-
.../series-details-routing.module.ts | 12 ++++++
.../series-details.component.css | 2 +
.../series-details.component.html | 30 ++++++++++++++
.../series-details.component.spec.ts | 25 ++++++++++++
.../series-details.component.ts | 17 ++++++++
.../series-details/series-details.module.ts | 18 +++++++++
src/app/pages/series/series-routing.module.ts | 31 +++++++++++++++
src/app/pages/series/series.component.css | 0
src/app/pages/series/series.component.html | 39 +++++++++++++++++++
src/app/pages/series/series.component.spec.ts | 25 ++++++++++++
src/app/pages/series/series.component.ts | 18 +++++++++
src/app/pages/series/series.module.ts | 12 ++++++
src/app/services/scully-content.service.ts | 4 ++
tailwind.config.js | 1 +
22 files changed, 295 insertions(+), 6 deletions(-)
create mode 100644 content/series/angular-scully-tailwind.md
create mode 100644 content/series/nestjs-prisma.md
create mode 100644 src/app/pages/series-details/series-details-routing.module.ts
create mode 100644 src/app/pages/series-details/series-details.component.css
create mode 100644 src/app/pages/series-details/series-details.component.html
create mode 100644 src/app/pages/series-details/series-details.component.spec.ts
create mode 100644 src/app/pages/series-details/series-details.component.ts
create mode 100644 src/app/pages/series-details/series-details.module.ts
create mode 100644 src/app/pages/series/series-routing.module.ts
create mode 100644 src/app/pages/series/series.component.css
create mode 100644 src/app/pages/series/series.component.html
create mode 100644 src/app/pages/series/series.component.spec.ts
create mode 100644 src/app/pages/series/series.component.ts
create mode 100644 src/app/pages/series/series.module.ts
diff --git a/content/series/angular-scully-tailwind.md b/content/series/angular-scully-tailwind.md
new file mode 100644
index 00000000..abc3c69c
--- /dev/null
+++ b/content/series/angular-scully-tailwind.md
@@ -0,0 +1,20 @@
+---
+title: Angular + Scully + Tailwind CSS Series
+description: Build Angular Jamstack application with Scully styled by Tailwind CSS
+tags:
+ - Angular
+ - Scully
+ - Tailwind CSS
+---
+
+## What will you build?
+
+- Setting up Angular with Tailwind CSS
+- Jamstack with Scully
+- Deploy via GitHub Actions to firebase Hosting
+
+## Live Demo
+
+You are using right **now** a Scully application styled with Tailwind - notiz.dev uses the following stack: Angular, Scully, Tailwind CSS and Firebase Hosting.
+
+Try another [Live Demo](https://angular-scully-tailwindcss.web.app) of a Scully blog styled with Tailwind CSS. Find the full [source code](https://github.com/notiz-dev/angular-scully-tailwindcss) on GitHub.
diff --git a/content/series/nestjs-prisma.md b/content/series/nestjs-prisma.md
new file mode 100644
index 00000000..7a5b6d4d
--- /dev/null
+++ b/content/series/nestjs-prisma.md
@@ -0,0 +1,15 @@
+---
+title: NestJS + Prisma Series
+description: Build backend application with NestJS and access databases via Prisma
+tags:
+ - NestJs
+ - Prisma
+---
+
+## What is is all about?
+
+- Integrate Prisma with NestJS
+- Build GraphQL endpoit with NestJS
+- Deployment of NestJS and Prisma to Heroku
+- Dockerize NestJS and Prisma application
+- more to come
diff --git a/scully.notiz.config.ts b/scully.notiz.config.ts
index 144e0f38..611526c8 100644
--- a/scully.notiz.config.ts
+++ b/scully.notiz.config.ts
@@ -46,6 +46,11 @@ setPluginConfig(SitemapPlugin, {
priority: '0.9',
sitemapFilename: 'sitemap-links.xml',
},
+ '/series/:slug': {
+ changeFreq: 'daily',
+ priority: '0.9',
+ sitemapFilename: 'sitemap-series.xml',
+ },
'/tags/:slug': {
changeFreq: 'daily',
priority: '0.9',
@@ -80,6 +85,12 @@ export const config: ScullyConfig = {
folder: './content/authors',
},
},
+ '/series/:slug': {
+ type: 'contentFolder',
+ slug: {
+ folder: './content/series',
+ },
+ },
'/tags/:slug': {
type: 'contentFolder',
slug: {
diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts
index 77f9c9e0..f9dec847 100644
--- a/src/app/app-routing.module.ts
+++ b/src/app/app-routing.module.ts
@@ -27,6 +27,11 @@ const routes: Routes = [
loadChildren: () =>
import('./pages/tags/tags.module').then((m) => m.TagsModule),
},
+ {
+ path: 'series',
+ loadChildren: () =>
+ import('./pages/series/series.module').then((m) => m.SeriesModule),
+ },
{
path: 'confirm-subscription',
loadChildren: () =>
diff --git a/src/app/app.component.html b/src/app/app.component.html
index 39bfb0fa..054168b1 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -20,6 +20,13 @@
>
Blog
+
+ Series
+
-
-
Chapters
+
+
+
+
+ {{ chapter.title }}
+
+
+
+
+
diff --git a/src/app/pages/series-details/series-details.component.ts b/src/app/pages/series-details/series-details.component.ts
index 74700bff..c5ac5c68 100644
--- a/src/app/pages/series-details/series-details.component.ts
+++ b/src/app/pages/series-details/series-details.component.ts
@@ -1,17 +1,31 @@
import { ScullyContentService } from '@services/scully-content.service';
-import { Component, OnInit } from '@angular/core';
+import { Component, OnInit, OnDestroy } from '@angular/core';
import { ScullyRoute } from '@scullyio/ng-lib';
-import { Observable } from 'rxjs';
+import { Observable, Subject } from 'rxjs';
+import { takeUntil, switchMap } from 'rxjs/operators';
@Component({
selector: 'niz-series-details',
templateUrl: './series-details.component.html',
styleUrls: ['./series-details.component.css'],
})
-export class SeriesDetailsComponent implements OnInit {
+export class SeriesDetailsComponent implements OnInit, OnDestroy {
page$: Observable = this.scullyContent.getCurrent();
+ seriesPosts$: Observable;
+
+ private destroy$ = new Subject();
+
constructor(private scullyContent: ScullyContentService) {}
- ngOnInit(): void {}
+ ngOnInit(): void {
+ this.seriesPosts$ = this.page$.pipe(
+ switchMap((page) => this.scullyContent.seriesPosts(page))
+ );
+ }
+
+ ngOnDestroy() {
+ this.destroy$.next();
+ this.destroy$.complete();
+ }
}
diff --git a/src/app/pages/series-details/series-details.module.ts b/src/app/pages/series-details/series-details.module.ts
index 82ccd695..1b8d724e 100644
--- a/src/app/pages/series-details/series-details.module.ts
+++ b/src/app/pages/series-details/series-details.module.ts
@@ -1,3 +1,4 @@
+import { NizInlineSvgModule } from '@notiz/ngx-design';
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
@@ -5,6 +6,7 @@ import { SeriesDetailsRoutingModule } from './series-details-routing.module';
import { SeriesDetailsComponent } from './series-details.component';
import { SeoModule } from '@components/seo/seo.module';
import { ScullyLibModule } from '@scullyio/ng-lib';
+import { PipesModule } from '@pipes/pipes.module';
@NgModule({
declarations: [SeriesDetailsComponent],
@@ -13,6 +15,8 @@ import { ScullyLibModule } from '@scullyio/ng-lib';
SeriesDetailsRoutingModule,
SeoModule,
ScullyLibModule,
+ PipesModule,
+ NizInlineSvgModule,
],
})
export class SeriesDetailsModule {}
diff --git a/src/app/pages/series/series.component.html b/src/app/pages/series/series.component.html
index 3750ab64..2eca4994 100644
--- a/src/app/pages/series/series.component.html
+++ b/src/app/pages/series/series.component.html
@@ -22,7 +22,7 @@
diff --git a/src/app/pipes/filter-chapter.pipe.ts b/src/app/pipes/filter-chapter.pipe.ts
new file mode 100644
index 00000000..5557379e
--- /dev/null
+++ b/src/app/pipes/filter-chapter.pipe.ts
@@ -0,0 +1,18 @@
+import { ScullyRoute } from '@scullyio/ng-lib';
+import { Pipe, PipeTransform } from '@angular/core';
+
+@Pipe({
+ name: 'filterChapter',
+})
+export class FilterChapterPipe implements PipeTransform {
+ transform(posts: ScullyRoute[], chapterSlug: string): ScullyRoute[] {
+ return posts
+ .filter((post) => post.series.find((s) => s.chapterSlug === chapterSlug))
+ .sort((p1, p2) => {
+ return (
+ p1.series.find((s) => s.chapterSlug === chapterSlug).weight -
+ p2.series.find((s) => s.chapterSlug === chapterSlug).weight
+ );
+ });
+ }
+}
diff --git a/src/app/pipes/pipes.module.ts b/src/app/pipes/pipes.module.ts
index 904d54d0..065db5e9 100644
--- a/src/app/pipes/pipes.module.ts
+++ b/src/app/pipes/pipes.module.ts
@@ -4,11 +4,24 @@ import { DashPipe } from './dash.pipe';
import { SearchPipe } from './search.pipe';
import { StartsWithPipe } from './startswith.pipe';
import { MapPostAuthorsPipe } from './map-post-authors.pipe';
+import { FilterChapterPipe } from './filter-chapter.pipe';
@NgModule({
- declarations: [DashPipe, SearchPipe, StartsWithPipe, MapPostAuthorsPipe],
+ declarations: [
+ DashPipe,
+ SearchPipe,
+ StartsWithPipe,
+ MapPostAuthorsPipe,
+ FilterChapterPipe,
+ ],
imports: [CommonModule],
- exports: [DashPipe, SearchPipe, StartsWithPipe, MapPostAuthorsPipe],
+ exports: [
+ DashPipe,
+ SearchPipe,
+ StartsWithPipe,
+ MapPostAuthorsPipe,
+ FilterChapterPipe,
+ ],
providers: [SearchPipe],
})
export class PipesModule {}
diff --git a/src/app/services/scully-content.service.ts b/src/app/services/scully-content.service.ts
index dc51027f..13ef2034 100644
--- a/src/app/services/scully-content.service.ts
+++ b/src/app/services/scully-content.service.ts
@@ -87,6 +87,14 @@ export class ScullyContentService {
return filterRoute(this.scully.available$, '/series/');
}
+ seriesPosts(series: ScullyRoute): Observable
{
+ return this.blogPosts().pipe(
+ map((posts) =>
+ posts.filter((post) => post.series?.find((s) => s.slug === series.slug))
+ )
+ );
+ }
+
authorTags(author: Observable): Observable {
const authorPosts$ = this.authorPosts(author);
const tags$ = this.tags();
diff --git a/tailwind.config.js b/tailwind.config.js
index 7cb7a444..5d91600d 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -76,6 +76,7 @@ module.exports = {
future: {
removeDeprecatedGapUtilities: true,
purgeLayersByDefault: true,
+ standardFontWeights: true,
},
plugins: [],
};
From b32c41a64d29be358e6bebcac17a66cdde628785 Mon Sep 17 00:00:00 2001
From: Marc Stammerjohann
Date: Thu, 26 Nov 2020 13:31:11 +0100
Subject: [PATCH 03/19] feat(tailwind): optin to future changes
---
tailwind.config.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/tailwind.config.js b/tailwind.config.js
index 5d91600d..8e2c80bb 100644
--- a/tailwind.config.js
+++ b/tailwind.config.js
@@ -77,6 +77,7 @@ module.exports = {
removeDeprecatedGapUtilities: true,
purgeLayersByDefault: true,
standardFontWeights: true,
+ defaultLineHeights: true,
},
plugins: [],
};
From ee2f90e9bd072d3aa71c0fed355d6a959dd31995 Mon Sep 17 00:00:00 2001
From: Marc Stammerjohann
Date: Fri, 18 Dec 2020 12:26:51 +0100
Subject: [PATCH 04/19] feat(series): add series to mobile menu
---
src/app/app.component.html | 14 ++++++++++++++
src/app/pages/series/series.component.html | 20 ++++++++------------
src/app/services/scully-content.service.ts | 14 +++-----------
3 files changed, 25 insertions(+), 23 deletions(-)
diff --git a/src/app/app.component.html b/src/app/app.component.html
index bbedc77d..73bb943e 100644
--- a/src/app/app.component.html
+++ b/src/app/app.component.html
@@ -23,6 +23,10 @@
Series
@@ -109,6 +113,16 @@
>
Blog
+
+ Series
+
+
diff --git a/src/app/services/scully-content.service.ts b/src/app/services/scully-content.service.ts
index 13ef2034..e656ae2f 100644
--- a/src/app/services/scully-content.service.ts
+++ b/src/app/services/scully-content.service.ts
@@ -1,16 +1,8 @@
-import { Router, NavigationEnd, RouteConfigLoadEnd } from '@angular/router';
+import { Router, NavigationEnd } from '@angular/router';
import { Injectable } from '@angular/core';
import { ScullyRoutesService, ScullyRoute } from '@scullyio/ng-lib';
-import {
- map,
- switchMap,
- tap,
- reduce,
- filter,
- startWith,
- share,
-} from 'rxjs/operators';
-import { Observable, zip, concat } from 'rxjs';
+import { map, switchMap, filter, startWith } from 'rxjs/operators';
+import { Observable, zip } from 'rxjs';
import { TagWeight } from '../types/types';
@Injectable({
From 1f7ba328754a1549894b987acd7d24923b8ab002 Mon Sep 17 00:00:00 2001
From: Marc Stammerjohann
Date: Fri, 18 Dec 2020 13:20:31 +0100
Subject: [PATCH 05/19] feat(series): update colors and add focus styles to
chapter links
---
...s-purge-optimize-angular-for-production.md | 4 ++++
content/series/angular-scully-tailwind.md | 1 +
content/series/nestjs-prisma.md | 1 +
.../series-details.component.html | 22 ++++++++-----------
src/app/pages/series/series.component.html | 4 +---
5 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/content/blog/tailwindcss-purge-optimize-angular-for-production.md b/content/blog/tailwindcss-purge-optimize-angular-for-production.md
index 6e0948f7..de087d20 100644
--- a/content/blog/tailwindcss-purge-optimize-angular-for-production.md
+++ b/content/blog/tailwindcss-purge-optimize-angular-for-production.md
@@ -11,6 +11,10 @@ tags:
keywords:
- CSS
- Utility-First CSS
+series:
+ - slug: angular-scully-tailwind
+ chapterSlug: getting-started
+ weight: 30
authors:
- Marc Stammerjohann
github: https://github.com/notiz-dev/angular-scully-tailwindcss
diff --git a/content/series/angular-scully-tailwind.md b/content/series/angular-scully-tailwind.md
index 2a60ae37..76a11542 100644
--- a/content/series/angular-scully-tailwind.md
+++ b/content/series/angular-scully-tailwind.md
@@ -1,6 +1,7 @@
---
title: Angular + Scully + Tailwind CSS Series
description: Build Angular Jamstack application with Scully styled by Tailwind CSS
+published: true
slug: angular-scully-tailwind
tags:
- Angular
diff --git a/content/series/nestjs-prisma.md b/content/series/nestjs-prisma.md
index 32b537e4..8fc90412 100644
--- a/content/series/nestjs-prisma.md
+++ b/content/series/nestjs-prisma.md
@@ -1,6 +1,7 @@
---
title: NestJS + Prisma Series
description: Build backend application with NestJS and access databases via Prisma
+published: true
slug: nestjs-prisma
tags:
- NestJs
diff --git a/src/app/pages/series-details/series-details.component.html b/src/app/pages/series-details/series-details.component.html
index a8d4e86d..9769402e 100644
--- a/src/app/pages/series-details/series-details.component.html
+++ b/src/app/pages/series-details/series-details.component.html
@@ -6,21 +6,17 @@
[tags]="[page.title]"
>
-
-
-
+
-
+
@@ -35,12 +31,12 @@
Chapters
{{ chapter.title }}
-
-
+
diff --git a/src/app/pages/series/series.component.html b/src/app/pages/series/series.component.html
index c6c07e73..83259edf 100644
--- a/src/app/pages/series/series.component.html
+++ b/src/app/pages/series/series.component.html
@@ -9,13 +9,11 @@
- {{ series$ | async | json }}
-
-
+
Date: Fri, 18 Dec 2020 14:20:52 +0100
Subject: [PATCH 06/19] feat(series): use tags icon as series cover
* move chapters into prose content
---
content/series/angular-scully-tailwind.md | 2 +-
.../series-details.component.css | 2 -
.../series-details.component.html | 67 +++++++++----------
.../series-details.component.scss} | 0
.../series-details.component.ts | 2 +-
src/app/pages/series/series.component.html | 30 +++++----
src/app/pages/series/series.component.scss | 0
src/app/pages/series/series.component.ts | 2 +-
src/app/pages/series/series.module.ts | 10 ++-
9 files changed, 61 insertions(+), 54 deletions(-)
delete mode 100644 src/app/pages/series-details/series-details.component.css
rename src/app/pages/{series/series.component.css => series-details/series-details.component.scss} (100%)
create mode 100644 src/app/pages/series/series.component.scss
diff --git a/content/series/angular-scully-tailwind.md b/content/series/angular-scully-tailwind.md
index 76a11542..35074144 100644
--- a/content/series/angular-scully-tailwind.md
+++ b/content/series/angular-scully-tailwind.md
@@ -24,6 +24,6 @@ chapters:
## Live Demo
-You are using right **now** a Scully application styled with Tailwind - notiz.dev uses the following stack: Angular, Scully, Tailwind CSS and Firebase Hosting.
+You are using right **now** a Scully application styled with Tailwind - [notiz.dev](/) uses the following stack: Angular, Scully, Tailwind CSS and Firebase Hosting.
Try another [Live Demo](https://angular-scully-tailwindcss.web.app) of a Scully blog styled with Tailwind CSS. Find the full [source code](https://github.com/notiz-dev/angular-scully-tailwindcss) on GitHub.
diff --git a/src/app/pages/series-details/series-details.component.css b/src/app/pages/series-details/series-details.component.css
deleted file mode 100644
index e2c50cea..00000000
--- a/src/app/pages/series-details/series-details.component.css
+++ /dev/null
@@ -1,2 +0,0 @@
-.content {
-}
diff --git a/src/app/pages/series-details/series-details.component.html b/src/app/pages/series-details/series-details.component.html
index 9769402e..1997610a 100644
--- a/src/app/pages/series-details/series-details.component.html
+++ b/src/app/pages/series-details/series-details.component.html
@@ -18,46 +18,43 @@